Automation - Until condition doesn't trigger

There is a trigger in my original automation.

``trigger:

  • platform: state
    entity_id: sensor.wallswitch_attic_action
    to: button_1_hold`

So why did you not post that?

Uuhhhmmm… It’s in the original code… Look at the start of this thread.

Oh ukro did that.

I’ve seen other posts with weird ‘until’ condition behaviour. In one case it worked with one step value but not another.

Correct… But if you do have some insight in why my ‘until’ condition doesn’t trigger : I’m open to suggestions.

I don’t have a clue why this doesn’t work. Simple automation, I see the condition fireing in the logs and still the until clause doesn’t trigger.

Clueless…

It appears to have a bug:

Freck… just my luck… a bug…

This is the only issue I could find and it appears to have been fixed on July 23 but the post I linked to above is after that (in August).

So a new issue wasn’t opened and thus no one is aware it needs to be fixed.

Once the automation has been triggered, does it start to correctly increase the brightness and then never stops increasing or does it increase once and then it stops?

I think even if you manage to get this to work, it’ll still not work as intended, because the brightness_step_pct part needs to read the current brightness before it adjusts the brightness and the next increase comes before the first increase has been finished, therefore HA is not able to read the correct current brightness. There’s an appdaemon app called Controller X that has a workaround for this issue.

2 Likes

The automation work fine when it starts. It increases the brightness and keeps going. It just never stops. It does throw of all my other automations, no automation works once this one is triggered.

I’ll have a quick look at the appdaemon app. I tried to stay away from appdaemon but if that’s what it takes… so be it.

Next to that : The mqtt topic ‘button_1_release’ is in the logfiles…

hehe got it :>

If you go to developers and look the entity sensor.wallswitch_attic_action
what did it now show in state column?

it’s momentary. So the moment I release the switch it’s ‘button_1_release’. Both in the action attribute as well as the state. Dev_tools ( see below ) gives me a correct true and false so it should work…

{{ is_state('sensor.wallswitch_attic_action', 'button_1_release' )}}
{{ is_state('sensor.wallswitch_attic_action', 'button_1_hold' )}}

{{ is_state_attr('sensor.wallswitch_attic_action','action','button_1_release') }}```

Try to look here, for me this is working and is stopping on until event:

- id: '1601810050556'
  alias: rolety_number_increase_test_4
  description: ''
  trigger: []
  condition: []
  action:
  - choose:
    - conditions:
      - condition: template
        value_template: '{{states.input_number.slider1.state!=states.input_number.slider2.state}}'
      sequence:
      - service: switch.turn_on
        data: {}
        entity_id: switch.rolety_channel_change
      - delay: 00:00:01
      - service: switch.turn_off
        data: {}
        entity_id: switch.rolety_channel_change
      - delay: 00:00:01
      - repeat:
          until:
          - condition: template
            value_template: '{{states.input_number.slider1.state==states.input_number.slider2.state}}'
          sequence:
          - service: switch.turn_on
            data: {}
            entity_id: switch.rolety_channel_change
          - delay: 00:00:01
          - service: switch.turn_off
            data: {}
            entity_id: switch.rolety_channel_change
          - service: input_number.increment
            data: {}
            entity_id: input_number.slider1
          - delay: 00:00:01
    default: []
  mode: single

Nice code…

I’ll try to adapt it to my situation and give it a go. Not mqtt is it? Keep thinking there is something there that doesn’t work.

1 Like

Put it inside the

choose:

Does the state stay at "button_1_release until you press the next button or does it change to “idle” or sonething similar after a few seconds?

And while you hold the button, is there any attribute thant changes during the time you hold the button? I could imagine that somehow an attribute changes state during the time you hold the button and triggers your automation again even though the state didn’t change. Do you get any warnings in the logs?

1 Like

No mqtt but try to use the

choose

and let me know.

Why do you think this? You say that the entity in HA correctly reflects the current button press, so everything should be fine on MQTT side.