-
Hi, I'm getting ready for the change from Octopus Flux to IO and and trying to make the cheap rate periods configurable. To wit, have the following service call
If start is a string literal, then it works as expected, but with the template it fails. binary_sensor.cheap_rate_electricity is a Times of Day helper. Evaluating the template in the Developer Tools Template Editor gives me the result I would expect (e.g. the string literal "02:01:00"). There are no errors in either the log or on the UI when I use the services Developer Tool, but nothing changes on the inverter. Am I doing something wrong? I'm on version 1.7.1 of FoxESS - Modbus. TIA |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
@iancg I think the problem is that your result will have a type of timestamp and not string, the service is expecting a string Try this it should do what you want
|
Beta Was this translation helpful? Give feedback.
-
If the service call fails, you should get an error popping up, at least when you use the services tab on developer tools. If you set the log level to debug, you should at least see a write going out through the ModbusClient if the service call succeeds. I'll try and find time to repro over the weekend. |
Beta Was this translation helpful? Give feedback.
In YAML, a
>
(or|
) starts a multi-line string literal, so yes, any quotes in it will be included.This:
or this
is the same as
In all of these cases the key
foo
has the literal valuebar
. If you use a multi-line literal that has quotes in it the value becomes"bar"
.Note that in YAML the quotes are actually optional in the last case, but it's recommended to use them anywhere it should definitely be a string because things like timestamps (which contain a colon) can confuse the parser.
Now, in @iancg's case he wasn't using the multi-line form so it should work - however he was using quotes inside quotes: