The format was correct (I think), but the copy was wrong.
The original entity is correct too, only I change it from my language.
Here’s what I tried (with the original entity):
'1636574064227':
alias: New script
sequence:
- service: input_number.set_value
target:
entity_id: input_number.led_fenyero
data:
value: '{{ state_attr('light.nappali_led_lepcso','brightness') | int }}'
mode: single
The error message (configuration->server control->check configurations:
Error loading /config/configuration.yaml: while parsing a block mapping in “/config/scripts.yaml”, line 8, column 7 expected , but found ‘’ in “/config/scripts.yaml”, line 8, column 30
The other interesting thing, that I edit it at configuration->scripts and sometimes the HA hasn’t save the changes.
One more thing you should know, this script’s service call won’t work as you might expect if the light is off. A light has no brightness attribute when it’s off. So, in that case, the int filter will supply a default value of zero. If that’s how you want it to work, when the light is off, then no worries.
You’re welcome! Glad to hear it solved the problem.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions. For more information, refer to guideline 21 in the FAQ.