Skip to content

FoxESS - Modbus: Update Charge Period where start/end are templates #404

Answered by jamesog
iancg asked this question in Support
Discussion options

You must be logged in to vote

In YAML, a > (or |) starts a multi-line string literal, so yes, any quotes in it will be included.

This:

foo: >
  bar

or this

foo: |
  bar

is the same as

foo: "bar"

In all of these cases the key foo has the literal value bar. 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:

  start: "{{ state_attr('binary_sensor.cheap_rat…

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
1 reply
@FozzieUK
Comment options

Comment options

You must be logged in to vote
8 replies
@FozzieUK
Comment options

@canton7
Comment options

canton7 Sep 1, 2023
Collaborator

@FozzieUK
Comment options

@jamesog
Comment options

Answer selected by canton7
@canton7
Comment options

canton7 Sep 2, 2023
Collaborator

@jamesog
Comment options

@iancg
Comment options

@jamesog
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
4 participants