Hi,
I’m trying to use a IKEA Vindstyrka to warn me and the children when someone is smoking outside of their bedroom. The room and apartment fills up with smoke so fast and I wan’t to prevent that by lighting up two lamps we can easily notice.
But, how do I fill in the automation to turn the lamps on at one threshold, and then turn of when the sensor goes beneath the threshold?
My code after using the automation fields look like this now:
alias: Smoke warning
description: ""
trigger:
- platform: numeric_state
entity_id:
- sensor.ikea_pm2_5_pm2_5
above: 30
- platform: numeric_state
entity_id:
- sensor.ikea_pm2_5_pm2_5
below: 20
condition: []
action:
- service: light.turn_on
metadata: {}
data:
color_name: red
brightness_pct: 100
flash: long
target:
device_id:
- e19caaf858db4802d92b2bac8271529e
- 812d97b6b05244de1a6f697051176cf7
mode: single
The lamps turn of, but how to I get them to turn off? The lower threshold has no connection to a “off” code?
As I am reading the code now, I will get the lamps to turn on both when the sensor reads above 30, but also beneath 20?
Helpful for any input!