Problems with trigger based on a value change on a z-wave js value (works intermittenly)

I have an automation triggered by the value change on a z-wave js value. The logic is that if a dim level of a dimmer changes, then the automation is triggered.
The problem is that it works for some period of time, then stops. If I look into the trace section I see that it is ignoring the trigger.
If I go to the trigger, change any value (i.e. delete endpoint number and put it back) and save, it works again for some time, then stops.
There is other awkward thing, as the whole automation has two triggers like that, both are stopping at the same time, and you need to “refresh” (edit and save without making any changes) only one to make both work again.

I’ve set the configuration in GUI, in YAML it look like that:

> platform: device
> device_id: [my ID]
> domain: zwave_js
> type: zwave_js.value_updated.value
> id: Lewe_Zmiana
> property: currentValue
> command_class: 38
> enabled: true
> alias: Lewe - zmiana CurrentValue
> endpoint: "0"

Any Idea how I can fix it?

Paste in the automation YAML, properly formatted; and a history graph of the sensor where you think it should have triggered.

If it is ignoring the trigger, there won’t be a trace. Please post a screenshot of what you mean.

The problem is that it is NOT ignoring it for some time, then starts ignoring it until I go to the automation, edit it, and save (without making any real changes)

Below sample with trigger properly registered. After a few hours, the same action (like changing the dim level by physical switch, or via dashboard) will be ignored.

And here is the full automation YAML (including some disabled triggers and automations, I also removed device ID’s):

alias: Salon|Światło Synchro - test
description: ""
trigger:
  - platform: device
    device_id: 
    domain: zwave_js
    type: zwave_js.value_updated.value
    command_class: 38
    property: currentValue
    id: Prawe_Zmiana
    alias: Prawe - zmiana CurrentValue
  - platform: device
    device_id: 
    domain: zwave_js
    type: zwave_js.value_updated.value
    command_class: 38
    property: targetValue
    id: Prawe_Zmiana
    alias: Prawe - zmiana TargetValue
    enabled: false
  - platform: device
    device_id: 
    domain: zwave_js
    type: zwave_js.value_updated.value
    id: Lewe_Zmiana
    property: currentValue
    command_class: 38
    enabled: true
    alias: Lewe - zmiana CurrentValue
    endpoint: "0"
  - platform: device
    device_id: 
    domain: zwave_js
    type: zwave_js.value_updated.value
    id: Lewe_Zmiana
    property: targetValue
    command_class: 38
    enabled: false
    alias: Lewe - zmiana TargetValue
  - platform: device
    type: turned_on
    device_id: 
    entity_id: light.gorne_lewe
    domain: light
    id: Lewe ON
  - platform: device
    type: turned_on
    device_id: 
    entity_id: light.gorneprawe_2
    domain: light
    id: Prawe ON
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: Prawe_Zmiana
          - condition: device
            type: is_on
            device_id: 
            entity_id: light.gorne_lewe
            domain: light
          - condition: device
            type: is_on
            device_id: 
            entity_id: light.gorneprawe_2
            domain: light
            for:
              hours: 0
              minutes: 0
              seconds: 2
        sequence:
          - service: light.turn_on
            entity_id: light.gorne_lewe
            data_template:
              brightness: |
                {{ state_attr('light.gorneprawe_2', 'brightness') }}
          - wait_for_trigger:
              - platform: device
                device_id: 
                domain: zwave_js
                type: zwave_js.value_updated.value
                property: currentValue
                command_class: 38
            timeout:
              hours: 0
              minutes: 0
              seconds: 2
              milliseconds: 0
            enabled: false
          - delay:
              hours: 0
              minutes: 0
              seconds: 2
              milliseconds: 0
      - conditions:
          - condition: trigger
            id: Lewe_Zmiana
          - condition: device
            type: is_on
            device_id: 
            entity_id: light.gorneprawe_2
            domain: light
          - condition: device
            type: is_on
            device_id: 
            entity_id: light.gorne_lewe
            domain: light
            for:
              hours: 0
              minutes: 0
              seconds: 2
        sequence:
          - service: light.turn_on
            entity_id: light.gorneprawe_2
            data_template:
              brightness: |
                {{ state_attr('light.gorne_lewe', 'brightness') }}
          - wait_for_trigger:
              - platform: device
                device_id: 
                domain: zwave_js
                type: zwave_js.value_updated.value
                command_class: 38
                property: currentValue
            timeout:
              hours: 0
              minutes: 0
              seconds: 2
              milliseconds: 0
            enabled: false
          - delay:
              hours: 0
              minutes: 0
              seconds: 2
              milliseconds: 0
      - conditions:
          - condition: trigger
            id: Lewe ON
        sequence:
          - service: light.turn_on
            entity_id: light.gorne_lewe
            data_template:
              brightness: |
                {{ state_attr('light.gorneprawe_2', 'brightness') }}
          - wait_for_trigger:
              - platform: device
                device_id: 
                domain: zwave_js
                type: zwave_js.value_updated.value
                command_class: 38
                property: currentValue
            timeout:
              hours: 0
              minutes: 0
              seconds: 2
              milliseconds: 0
            enabled: false
          - delay:
              hours: 0
              minutes: 0
              seconds: 2
              milliseconds: 0
      - conditions:
          - condition: trigger
            id: Prawe ON
            enabled: true
        sequence:
          - service: light.turn_on
            entity_id: light.gorneprawe_2
            data:
              brightness: |
                {{ state_attr('light.gorne_lewe', 'brightness') }}
          - wait_for_trigger:
              - platform: device
                device_id: 
                domain: zwave_js
                type: zwave_js.value_updated.value
                property: currentValue
                command_class: 38
            timeout:
              hours: 0
              minutes: 0
              seconds: 2
              milliseconds: 0
            enabled: false
          - delay:
              hours: 0
              minutes: 0
              seconds: 2
              milliseconds: 0
    enabled: false
  - choose:
      - conditions:
          - condition: trigger
            id: Prawe_Zmiana
          - condition: template
            value_template: >-
              {{ not state_attr('light.gorneprawe_2', 'brightness') ==
              state_attr('light.gorne_lewe', 'brightness') }}
          - condition: device
            type: is_on
            device_id: 
            entity_id: light.gorne_lewe
            domain: light
          - condition: device
            type: is_on
            device_id: 
            entity_id: light.gorneprawe_2
            domain: light
        sequence:
          - service: light.turn_on
            entity_id: light.gorne_lewe
            data_template:
              brightness: |
                {{ state_attr('light.gorneprawe_2', 'brightness') }}
      - conditions:
          - condition: trigger
            id: Lewe_Zmiana
          - condition: template
            value_template: >-
              {{ not state_attr('light.gorneprawe_2', 'brightness') ==
              state_attr('light.gorne_lewe', 'brightness') }}
          - condition: device
            type: is_on
            device_id: 
            entity_id: light.gorne_lewe
            domain: light
          - condition: device
            type: is_on
            device_id:
            entity_id: light.gorneprawe_2
            domain: light
        sequence:
          - service: light.turn_on
            entity_id: light.gorneprawe_2
            data_template:
              brightness: |
                {{ state_attr('light.gorne_lewe', 'brightness') }}
      - conditions:
          - condition: trigger
            id: Lewe ON
        sequence:
          - service: light.turn_on
            entity_id: light.gorne_lewe
            data_template:
              brightness: |
                {{ state_attr('light.gorneprawe_2', 'brightness') }}
      - conditions:
          - condition: trigger
            id: Prawe ON
        sequence:
          - service: light.turn_on
            entity_id: light.gorneprawe_2
            data:
              brightness: |
                {{ state_attr('light.gorne_lewe', 'brightness') }}
mode: restart

And here it is the log from z-wave js UI from the triggering device (and as I said before it is triggering the automation for some period of time, then, for unknown reason, stops):

2023-06-09T08:51:03.655Z - VALUE UPDATED 
Arg 0:
└─commandClassName: Multilevel Switch
└─commandClass: 38
└─property: currentValue
└─endpoint: 0
└─newValue: 17
└─prevValue: 34
└─propertyName: currentValue

Could it be this bug?

Seems to be similar, though I’m not sure if in my case it is related to the z-wave js addon restart.
In my case it stops working every couple of hours, I don’t recall restarting addon in between, but maybe it is doing that automatically (have to look into logs to see).
And in my case it is enough to go into edit mode in the automation and save to make it work again, but it might be that the author of the issue didn’t get to such workaround.

Update:

It seems to be addressed (and recently solved) in this issue:

It worked for last 2 days without issues, I keep monitoring

I just saw that too! Excellent.

Unfortunately it seems to be not addressed fully yet.
Today it stopped working again (it might something to do with the HA Core update which I did today) :frowning: