Fix issues with lux threshold conditions

This commit is contained in:
2024-01-16 12:11:28 -05:00
parent a882871842
commit d644e3d8e0
5 changed files with 16 additions and 12 deletions

View File

@ -1,8 +1,8 @@
const states = global.get('homeassistant.homeAssistant.states')
const lights = states['light.emma_bedroom_light'].state
const duration = states['input_number.emma_bedroom_lights_off_delay'].state
const lux = states['sensor.emma_bedroom_illuminance'].state
const threshold = states['input_number.emma_bedroom_lux_threshold'].state
const lux = parseInt(states['sensor.emma_bedroom_illuminance'].state)
const threshold = parseInt(states['input_number.emma_bedroom_lux_threshold'].state)
const sleeping = states['input_boolean.emma_sleeping'].state
const payload = msg.payload
const newDuration = duration * 60