Open hicling opened 6 years ago
Hi @hicling,
i've just set this up myself, i hate the way home assistant is so fussy about the yaml files and the way they keep changing the options. Anyways, here is what i have got, this works for me
- id: Led_Balkong_Golv_Hastighet
alias: "Led Balkong Golv Hastighet"
initial_state: True
hide_entity: False
trigger:
- entity_id: input_number.led_balkong_golv_hastighet
platform: state
action:
- data_template:
topic: "bruh/porch/set"
payload: '{"transition":{{ trigger.to_state.state | int }}}'
service: mqtt.publish
I have moved your settings across to this code block so you should be able to just copy and paste
if the code block above still fails you will need to double check the spacing of the first line, then make sure the spacing of the rest of the lines is as as above
`automation:
tried this whitout luck.. :(
did you restart home assistant?
ye I did
When I serial monitor the esp I can see traffic when I use the on/off and when I switch effect but nothing when is lite the animation speed bar.
Your automation.yaml file is likely failing to load then, do you get the "invalid config" card on the main HA page. also have a look at the info page, to review an errors you may be getting
I dont get the invalid config. but in the log it says "/config/configuration.yaml contains duplicate key "automation"." and its true i have this automation and "automation: !include automations.yaml" can that be the problem?
Yes that will be the issue. If you take that code block above, remove the first line and then paste the rest of the lines in your automations.yaml file
Make sure the spacing is the same as your other automation
Restart hone assistant and check the log again
Thx for the help no it works! 💃
Hmm i seem to just get ESP4/sensornode4/set {"transition":{{ trigger.to_state.state | int }}} on my MQTT server, rather than the input number that i set the slider to.
I input this in automation.yaml and removed it from configuration.yaml.
Just change Id, alias and entity_id so it’s right for you
Gosh darn it, ur post above it correct, but i needed to tweak the formatting. so the line after - data template needs two more spaces, same as the next line, but service: mqtt.publish needed the two extra removed.
Yea I can’t understand the spacing in yaml. But glad it works
Dear all, I'm afraid I do not fully understand how this automation procedure works. I have split my automations from the rest of the config: automation: !include automations.yaml In there I've put:
alias: "Led Strip Animation Speed"
hide_entity: False
initial_state: True
trigger:
platform: state
entity_id: input_number.led_animation_speed
action:
service: mqtt.publish
data_template:
topic: "home-assistant/led/set"
payload: '{"transition":{{ trigger.to_state.state | int }}}'
How is this different from what you have been posting? Do I need to use dashes ("-")? Is this correctly formatted? There is no other automation set up. But still I get the message, that my automation is not correctly formatted. Thank's a lot for your help.
@Rudertier The hyphens/dashes can sometimes be necessary. Try this:
alias: "Led Strip Animation Speed"
hide_entity: False
initial_state: True
trigger:
- platform: state
entity_id: input_number.led_animation_speed
action:
- service: mqtt.publish
data_template:
topic: "home-assistant/led/set"
payload: '{"transition":{{ trigger.to_state.state | int }}}'
@pacobyte, that worked! Many thanks.
You're welcome. YAML can be a real pain in the beginning.
Now that everyone's issues are fixed in this issue, would you mind closing it, @hicling?
Hi my animation speed seams to do nothing. when i watch the serial monitor nothing is sent when i move the slider and I can't see any difference in the animation speed.
my code:
input_number: led_balkong_golv_hastighet: name: Led Balkong Golv Hastighet initial: 5 min: 1 max: 150 step: 5
automation: