I have a Shelly Dimmer 2 connected to a dimmable LED.
I also have a Shelly Motion which can measure luminosity in lux - e.g.:
Is there some way to setup a HA automation, that sets the LED brightness, based on the ambient light levels?
Firstly - how would you trigger this automation? Should it be done on some kind of periodic schedule, or is there some way to do it when the light levels change by > X amount?
I saw in the HA docs you can do a numeric trigger - but this is on the actual value - e.g.:
trigger:
- platform: numeric_state
entity_id: sensor.shellymotionsensor_60a423beb6c4_luminosity
for:
hours: 0
minutes: 0
seconds: 10
above: '15'
However, there’s no way to trigger based on the delta, or change in a value, is there?
Secondly, how would you “templatise” (if that’s the right word) the luminosity value in the brightness? For example, let’s say the measured lux in this area is between 100-500 - and we just want to scale some fixed value by “lux / 100” - how would you do that in HA?