Hi @all
I’m currently playing with a WS2812b LED stripe, the long term target is to have multiple LED-Info boards (Exactly the same boards at different places) that show the status of different sensors without the need to use a smartphone all the time (Door/Lock/waterTemp, fillingLevel, …)
Some of the Blueprints I’m checking are
https://www.letscontrolit.com/forum/viewtopic.php?t=5607
and others…
Current status: LEDs are controllable, but I’m not sure about the best practice to go forward, so I thought I’d ask your oppiníon before I do more than playing with 2-3 LEDS:
1 Question:
Due to the warning in light.partition (Don’t use it to controll single LEDs due to memory overhead) I’m using the light.adressable_set to set the status of a LED, depending on the status of a HomeAssistant state:
binary_sensor:
- platform: homeassistant
internal: true
id: doorgroup
name: "Doors open from HA"
entity_id: binary_sensor.gruppeturen
on_state:
then:
- if:
condition:
binary_sensor.is_on: doorgroup
then:
- logger.log: "TüreOffen"
- light.addressable_set:
id: status_fastled2
range_from: 0
range_to: 0
color_brightness: 25%
red: 100%
green: 0%
#blue: 0%
else:
- logger.log: "TüreZu"
- light.addressable_set:
id: status_fastled2
range_from: 0
range_to: 0
color_brightness: 25%
red: 0%
green: 100%
#blue: 0%
Wow, lot of code just for mapping a single entity (open/close) to a single LED. Did I miss something or is this the way to go?
My still existing problem with this is that it won’t recreate the old state when I reboot the ESP. All LEDs are off until the status changes in HA. The suggestion I found was to add the code as well to the on_boot but that would duplicate a lot. Is this really the way to go?
I’ve looked around if there is some way to extract
id: status_fastled2
range_from: 0
range_to: 0
color_brightness: 25%
red: 0%
green: 100%
#blue: 0%
To some kind of methode with parameters and then reuse it since that code section will be likely used 20-50 times. Did I miss here a base functionallity of ESPHome (or the correct search term)?
Question 2:
How dangerous is it to ignore the warning in light.partition? My intention would be to have around 20-30 individually addressable LEDs (With a Wemos D1 mini / pro)
Could I test this by partitioning the LED stripe and check where the memory consumtion ends up and check if it’s acceptable or will this cause some kind of uncontrollable memory leak?
Then I’d have the individual LEDs and could control them out of HA with automations
(having the logic within the espHome sounds better for me, having automations for enabling/disabling 30 LEDs will be a lot of stuff in the Automation section of HA)
I’d love to get some feedback before I waste a lot of time on something that won’t scale when I end up with 30 LEDS