so I got an illuminance sensor outdoors and some lamps indoors. As the brightness changes I want to adjust my lamps so that if it’s 1800lx outside the brightness should be set to 0 and with an illuminance of 15lx they should be at max brightness (255).
The mathematical operation would be y(br) = -0.143 * x(lx) + 257.143.
One lamp got the entity id light.deckenlampe and the illuminance sensor sensor.illuminance_b.
How could I turn this into a template? It’s my first time working with templates and I can’t get the equation to work.
And get this error message when checking the config: Invalid config for [sensor.template]: [value template] is an invalid option for [sensor.template]. Check: sensor.template->sensors->brightness->value template. (See ?, line ?).
Any idea on how to fix this?
Or is this even necessary? If not, how can I use the outcoming value as a brightness parameter if it’s less or equal to 255?
I mean, it’s pretty explicit about the problem. value template isn’t a config variable, it’s value_template.
Also, you are using the old sensor configuration, which is not recommended. See the docs for the updated format. You should also just keep the docs handy, giving them a read through can answer most of your questions
But I get this error when I try to run it: Fehler beim Aufrufen des Diensts script/1617121793358. expected int for dictionary value @ data['helligkeit']
So how can I use it as an int value?
Thanks in advance!