Dimmer perpetually 'On' in HASS

I’ve noticed that one of my Leviton Z-Wave Plus dimmers recently started showing ‘On’ in HASS (Currently on , and if I try to turn it off in HASS, the indicator just bounces back to ‘On’. If the dimmer actually is ‘On’ and I click the indicator to turn them off, they actually do turn off, but the indicator returns to ‘On’. If they’re off, I can’t turn them on by way of HASS unless I select the dimmer and select a light level, at which point the lights come on.

So far I’ve restarted HASS, Restarted the RPi and power cycled the Pi, and it’s still showing ‘on’, despite being off.

Before I go through the gyrations of excluding, resetting and including the switch, is it possible/likely that it’s a problem with HA or the Razberry rather than the switch?

Probably not. Recommend excluding/including the switch first. If you have to mess with config files, be sure to make backup copies of them first.

Is there any automation controlling that switch? If you do try disabling the automation and see if it turns back to “On”.

Yes and no. Yes, there is automation associated with it, but no, it’s not active now. The only automation associated with it (and another switch) is only active when I activate ‘Vacation Mode’ in HA.

That is odd… And the other switch in the automation is behaving normally?

Can you please post the code where you define the switch and the automation? Use code blocks and syntax highlighting when posting the code, read the blue box on top of this page.

So I excluded the switch, did a factory reset on it, then re-included it and fixed the IDs for it and it’s now working as it should - showing off when it’s off and on when it’s on.

As for my automation, it’s basically just these scenes that are called:

  - name: Livingroom_Lights_On
    entities:
        light.leviton_dz6hd1bz_decora_600w_smart_dimmer_level_57_0:
             state: on
             brightness: 70
  - name: Livingroom_Lights_Off
    entities:
        light.leviton_dz6hd1bz_decora_600w_smart_dimmer_level_57_0:
             state: off

Those scenes are called by these automatons:

    # Vacation mode for Livingroom lights
- alias: 'Vacation Mode for Livingroom Lights ON'
  trigger:
    platform: sun
    event: sunset
    offset: "00:10:00"
  condition:
    condition: state
    entity_id: input_boolean.vacation_mode
    state: 'on'
  action:
    service: scene.turn_on
    entity_id: scene.Livingroom_Lights_On
# Vacation mode for Livingroom lights
- alias: 'Vacation Mode for Livingroom Lights OFF'
  trigger:
    platform: time
    at: "21:45:00"
  condition:
    condition: state
    entity_id: input_boolean.vacation_mode
    state: 'on'
  action:
    service: scene.turn_on
    entity_id: scene.Livingroom_Lights_Off