Hello together,
I have a setup with a few LED stripes, and I’m looking for the most elegant way to configure them.
Some WS2812-Stripes are controlled by esphome, and integrated into home assistant. Their power supply (5V Meanwell) is switched by a Tasmota-Device, of course also integrated into home assistant. The LED-Stripes are used from multiple points (multiple automations, manually, scenes).
I haven’t found a proper way to deal with the power supply yet.
Including the power supply switch on into the scene won’t work out, as the light components themselves are unavailable until they got their power and contacted home assistant.
Adding a manual power-supply on to each automation with a delay may works out, but is pretty anoying and seams to be a dirty hack.
Is there any way to add something like a “hook” to the light entity? Something like “before_on: {{turn on switch}}”
My “dream” would be, that as soon as I turn on a light, home assistant automatically turns on the power switch. This would represent the dependency on device level (where it physically is), and simplifies all further handling of those lights.
I know esphome has something like this: https://esphome.io/components/power_supply.html
This of course does not help in this case, when not esphome locally but home assistant globally is in charge of the power supply.
led_stripe_on:
alias: LED Stripes on
sequence:
- type: turn_on
device_id: [...]
entity_id: switch.sonoff
domain: switch
- alias: Control lights
service: scene.turn_on
data_template:
entity_id: '{{scene}}'
- wait_template: '{{ not (is_state(''light.neopixel_light'', ''unavailable'') or is_state(''light.neopixel_light_2'',
''unavailable'') or is_state(''light.neopixel_light_3'', ''unavailable''))}}'
continue_on_timeout: true
timeout: 00:01:00
- alias: Control lights
service: scene.turn_on
data_template:
entity_id: '{{scene}}'
mode: restart
max: 10
Still not the most elegant way, but the best I found for now.
Unfortunately, I had (and still will have) problems with the availability time of esphome nodes.
Tried to get this configureable, but the PR war rejected (https://github.com/home-assistant/core/pull/41648). I still don’t have an idea how to minimize time from switch turning on to the light available in home assistant.