WTH is it so difficult to keep a bulb and a switch in sync?

Say you’ve got ZWave switches or dimmers, and later want to add smart bulbs. Unfortunately, zwave bulbs effectively don’t exist, so the bulbs will most likely be unable to be paired at the protocol level.
Keeping the switch state in sync with the bulb state regardless of where changes are made (at the physical switch, or directly against the bulb entity.) is a lot more difficult than it probably needs to be!
It would be great if there were built-in functionality for this rather than requiring complex scripts / automations.

FWIW, there is an automation blueprint for this here: Linked Entities - keep mutlple entities binary state in sync (lights, switches, etc.), but it’d be nice if this sort of functionality were native, even in a more simplified form.

I’m not sure if I follow what you mean. So you have a switch, which is a physical device, that has an ‘on’ and and ‘off’ state. So it looks something like this (not really the same necessarily but it has a recognizable state)?
th
But then you switch the smart bulb via some other means, and the switch’s indicator is no longer the same as the state of the light. What exactly do you want HA to do about that?
If the switch is simply a toggle with no further indicators, wouldn’t it make more sense to just include this logic in the automation that you use to process the signals from the switch? So use ‘toggle’ instead of ‘turn on’ or ‘turn off’?

BTW, you haven’t voted for your own proposal. Not sure if there is a WTH about that but I find it quite ridiculous that this is necessary. Maybe it’s meant to be a test if you read the call for WTH proposals well enough.

It would be a smart switch, meaning that there’s no “physical” state that can be discerned by position, but it has an indicator for the brightness level of the attached bulb (because it is a dimmer switch.)
It’s not possible to only ever interact with the switch entity, because a wall switch doesn’t have controls for color temperature or RGB.

If it were a dumb bulb and a smart switch, the switch’s power state would always match the bulb. If it were a switch and bulb of the same protocol, they’d also likely always match (pairing devices at the zwave/zigbee/matter level.)

Can you explain what you mean by this?

A cursory glance at the z-wave alliance database shows many z-wave bulbs exist. e.g. https://products.z-wavealliance.org/products/4036?selectedFrequencyId=4

Ah, so it’s not just about binary states. Since ‘binary’ was in the name of the blueprint you linked I sort of assumed that was what it was about.
Basically what you want is an automation that automatically updates the state of the remote (let’s call it a remote since it can do more than switching) when the state of the light changes? And for that automation to be built in to the integration that drives your remote, so you only have to click a checkbox and select a light on the device page?
It’s something useful, sure. But probably a bit niche, since most remotes don’t have indicators.

Fortunately for me, I only need to follow the off-and-on of my switch and my light doesn’t have any controls. But I know what you mean. Here is my automation YAML The switch bulbs comes from the ISY994i and the desklampsdevice is Tasmota.

alias: Desk Lamps
description: Turn desk lamps on or off depending on the state of the ISY scene Desk Lamps
triggers:
  - trigger: state
    entity_id: switch.bulbs
conditions: []
actions:
  - delay:
      milliseconds: 25
  - if:
      - condition: state
        entity_id: switch.bulbs
        state: "off"
    then:
      - action: switch.turn_off
        target:
          entity_id: switch.desklampsdevice
        data: {}
    else:
      - action: switch.turn_on
        target:
          entity_id: switch.desklampsdevice
        data: {}
mode: single

Yeah, pretty convoluted, but that’s the nature of HA

In your case, you’d have another trigger which would be a change that occured at the light. Then in actions you’d have an if statement to select the actions to take depending on the trigger. (see: here)

Your automation would be just more than double mine. Again, nature of the beast.

Hope this helps,

-OSD

The only bulbs I can find on there are A19, no other shapes/bases, and don’t seem to be available in commerce. They’re not available from any retailers, and only seem to exist on the ZWA website. I’d love / prefer to have an option, but the things don’t seem to be available to be bought.

Most popular ZWave light switches have indicators, either as a simple on/off, or on dimmers, they have lightbars or LED segments to show the current dimming level.

Yeah, and it’s not great! When it’s got to maintain bidirectional state, it’s actually even messier, because it’s pretty easy to get an automation that can loop indefinitely as it triggers updates on one device from a sync. The WTH is an ask to make this kind of task, when the user has devices that should be linked, but have no native support (generally due to a mix of protocols) easier to manage, and not require setting up an automation for each light/switch pairing.

So what you should have said was “Unfortunately zwave bulbs effectively don’t exist in the size I want”.

We are not very good mind readers and would have no way of know that was what you really meant.

Oh, I’d need/use A19 bulbss, too, but those aren’t available for sale anywhere, either. I shouldn’t have confused the point by noting that the products that aren’t sold anywhere also only come in one size/shape/base type.

Smart Bulbs - The Smartest House ← no smart bulbs at a zwave-specific specialty retailer.

Amazon.com : z-wave bulb in the US, this search returns only bulbs that are non z-wave, mainly zigbee. The filters don’t even offer the ability to filter for Z-wave… The choices are “Matter”, “WiFi”, and “Zigbee”. A search for “zwave” does not produce anything different. The major home improvement chains also don’t return any results that are actually z-wave products when looking for light bulbs.

I do have some ZWave bulbs, from Inovelli, but they long stopped offering those. (Again A19 only, but there hasn’t been availability for years, and they are old Zwave, so to have them synced at the zwave level with a switch requires downgrading the switch to not use security, they don’t support S2.)

In my case, this is a zwave-specific problem, but it’s really an issue for anyone who already has smart switches/bulbs and for whatever reason needs or wants to pick bulbs/switches of a differing protocol (like transitioning to matter from BT/WiFi/zigbee incrementally rather than all at once, or the required form factor not being in the ‘right’ protocol.)

Syncing a bunch of lights with light groups is already mostly great! There’s nothing built in for managing the relationships between lights and switches, though, if the devices in question can’t manage it natively outside of H-A.

1 Like

Not really

alias: Desk Lamps
description: Turn desk lamps on or off depending on the state of the ISY scene Desk Lamps
triggers:
  - trigger: state
    entity_id: switch.bulbs
conditions: []
actions:
  - delay:
      milliseconds: 25
  - action: "switch.turn_{{ trigger.to_state.state }}"
    target:
      entity_id: switch.desklampsdevice
    data: {}
mode: single

I’m quite sure you can remove the delay also but you need to test that