#turn off a strip light when I turn off my lights from the light switch

1 messages · Page 1 of 1 (latest)

alpine storm
#

Hi all,

I'm trying to turn off a strip light when I turn off my lights from the light switch (the actual switch, not a smart button), but when I set the trigger to one of the lights status as "device offline", nothing happens, attached is the automation that doesn't work.

mossy dagger
#

when you switch the lights off for trigger, are they "offline" or "unavailable"?

alpine storm
#

how do I see?

#

these are the only entities I have:

#

this is the device:

alpine storm
#

I have a helper that becomes "unavailable"

#

but the helper doesn't apepar in device or entity list

alpine storm
#

the automation I have just doesn't work:

warped dew
alpine storm
#

alias: Downstairs bathroom Lights Off
description: ""
triggers:

  • device_id: 42cb5254df2ffb2f50a7e5f92948ce62
    domain: zha
    type: device_offline
    subtype: device_offline
    trigger: device
  • trigger: state
    entity_id:
    • light.downstairs_bathroom_centre_light_2
      from: "on"
      to: unavailable
      conditions: []
      actions:
  • action: light.turn_off
    metadata: {}
    data:
    transition: 0.5
    target:
    device_id: 24ed819c53619cf9f23f0ba59e3b986c
    mode: single
warped dew
#

why are you going from "on" to unavailable?

#

it's a light

#

it'll have on/off states

alpine storm
#

because I'm turning the power off

#

the switch is not a smart switch, it's the switch to power it

warped dew
#

zha has polled unavailable states

#

meaning devices don't immediately go unavailable

alpine storm
#

ah

warped dew
#

they go unavailable within the polling frequency if it's even turned on

#

and when turned on, its 10 minutes

alpine storm
#

so there's no way to know in a decent time the light has been switched off

warped dew
#

not with zigbee

#

unless you hammer the network by checking the heartbeat

#

(not suggested)

alpine storm
#

so I have to use a smart switch

warped dew
#

Yes

alpine storm
#

the light is in the bathroom and the old switch also turns on the fan and radiator

#

if I have the switch perma on, I have to keep turning the fan and radiator on manually