@@ -611,13 +611,7 @@ actions:
611611 - hold-dots1-z2m-e2213
612612 sequence :
613613 - repeat :
614- while :
615- - condition : trigger
616- id :
617- - hold-on-zha-e1743-e2201
618- - hold-on-z2m-e1743-e2201
619- - hold-dots1-zha-e2213
620- - hold-dots1-z2m-e2213
614+ count : !input helper_max_loops
621615 sequence :
622616 - parallel :
623617 - action : light.turn_on
@@ -626,7 +620,52 @@ actions:
626620 data :
627621 brightness_step_pct : " {{ helper_hold_dim_step }}"
628622 transition : " {{ helper_hold_delay }}"
629- - delay : " {{ helper_hold_delay }}"
623+ - sequence :
624+ - choose :
625+ - conditions :
626+ - condition : trigger
627+ id :
628+ - hold-on-zha-e1743-e2201
629+ - hold-dots1-zha-e2213
630+ sequence :
631+ - wait_for_trigger :
632+ - trigger : event
633+ event_type : zha_event
634+ event_data :
635+ device_id : " {{ zha_device_id }}"
636+ command : " stop_with_on_off"
637+ cluster_id : 8
638+ endpoint_id : 1
639+ timeout :
640+ milliseconds : !input helper_hold_delay
641+ continue_on_timeout : true
642+ - if :
643+ - condition : template
644+ value_template : " {{ wait.trigger.idx is defined }}"
645+ then :
646+ - stop : button released
647+ - conditions :
648+ - condition : trigger
649+ id :
650+ - hold-on-z2m-e1743-e2201
651+ - hold-dots1-z2m-e2213
652+ sequence :
653+ - wait_for_trigger :
654+ - trigger : mqtt
655+ topic : " {{ mqtt_topic }}"
656+ payload : " brightness_stop"
657+ - trigger : mqtt
658+ topic : " {{ mqtt_topic }}"
659+ payload : " 1_long_release"
660+ timeout :
661+ milliseconds : !input helper_hold_delay
662+ continue_on_timeout : true
663+ - if :
664+ - condition : template
665+ value_template : " {{ wait.trigger.idx is defined }}"
666+ then :
667+ - stop : button released
668+
630669 - conditions :
631670 - condition : trigger
632671 id :
@@ -648,7 +687,51 @@ actions:
648687 data :
649688 brightness_step_pct : " {{ helper_hold_dim_step | int * -1 }}"
650689 transition : " {{ helper_hold_delay }}"
651- - delay : " {{ helper_hold_delay }}"
690+ - sequence :
691+ - choose :
692+ - conditions :
693+ - condition : trigger
694+ id :
695+ - hold-off-zha-e1743-e2201
696+ - hold-dots2-zha-e2213
697+ sequence :
698+ - wait_for_trigger :
699+ - trigger : event
700+ event_type : zha_event
701+ event_data :
702+ device_id : " {{ zha_device_id }}"
703+ command : " stop_with_on_off"
704+ cluster_id : 8
705+ endpoint_id : 1
706+ timeout :
707+ milliseconds : !input helper_hold_delay
708+ continue_on_timeout : true
709+ - if :
710+ - condition : template
711+ value_template : " {{ wait.trigger.idx is defined }}"
712+ then :
713+ - stop : button released
714+ - conditions :
715+ - condition : trigger
716+ id :
717+ - hold-off-z2m-e1743-e2201
718+ - hold-dots2-z2m-e2213
719+ sequence :
720+ - wait_for_trigger :
721+ - trigger : mqtt
722+ topic : " {{ mqtt_topic }}"
723+ payload : " brightness_stop"
724+ - trigger : mqtt
725+ topic : " {{ mqtt_topic }}"
726+ payload : " 2_long_release"
727+ timeout :
728+ milliseconds : !input helper_hold_delay
729+ continue_on_timeout : true
730+ - if :
731+ - condition : template
732+ value_template : " {{ wait.trigger.idx is defined }}"
733+ then :
734+ - stop : button released
652735 - action : light.turn_on
653736 target :
654737 entity_id : !input light
0 commit comments