Hey guys,
I cant find how to turn on a switch on startup.
Im using UART switches to control my tv, but if the device just boots, I need to send a blank switch with a NL and CR to clear the buffer on the TV.
Basically, I just need a switch to turn on when the boot completes on the node.
Cant find it in the docs, any help please ?
brahmafear
(Brahmafear)
September 29, 2019, 12:07am
2
Not sure I quite understand you’re setup, but you should be able to create an automation with a trigger for homeassistant start.
kanga_who
(Jason)
September 29, 2019, 12:18am
3
Just write an automation to turn the switch on when HA reboots/starts
trigger:
platform: homeassistant
event: start
condition:
condition: template
value_template: '{{ states.sensor.uptime.state > "0.01" }}'
action:
service: switch.turn_on
entity_id: switch.yourswitch
DeadEnd
September 29, 2019, 1:52am
4
If you are trying to do this in ESPHome, i would think using these two references should get you there.
First, UART automation, “uart.write…”
Once you know what you need, the “on…” part could be done on boot so that everytime the ESP device reboots the signal is sent:
See if that gets you what you are trying to accomplish!
Good Luck!
DeadEnd
1 Like
Not HA boot, the esphome device ! @brahmafear @kanda_who
Thanks DeadEnd!!! Second link is exactly what I need
Mutt
(Muttley)
September 29, 2019, 10:58am
7
Please mark deadends post as the solution to your issue, it helps others differentiate if I’m looking for a similar solution AND doesn’t waste my time if I’m trying to help people
Glad you found a solution
Note: the I and MY above were not ME specifically but ANYONE on the forum.
I re-read my post and it seemed like I was irritated
1 Like