Niclas_82
(Niclas)
October 19, 2021, 8:08pm
1
Hi. New to ha and i am trying to make a simple automation to turn on lights if value is under 49lux.
but can’t make it work. If I run the automation manually the light turns on.
alias: Utebelysning
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.multisensor_6_illuminance
for:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
attribute: unit_of_measurement
below: '49.0'
condition: []
action:
- scene: scene.tand_utebelysning
- choose: []
default: []
mode: single
Any idea what’s missing??
For starters get rid of the attribute line (otherwise you are trying to compare 49.0 to the units of “lux”).
Also the action looks wrong, you need to call the service scene.turn_on as per the example in the docs here:
Finally I don’t think you will need th choose/default lines as you have no choose condition.
Sorry, should be “compare”, I will correct my earlier post.
koying
(Chris B)
October 20, 2021, 7:38am
5
Also (and foremost), never forget your automation will only be triggered when going from above 49 to below 49 (for 1 minute in your case).
Activating or creating the automation when the value is already < 49 will not trigger it.