#How would I determine whether the wait
1 messages · Page 1 of 1 (latest)
Thankyou
Hmm
Double click gets previous track, Single click gets nothing
id: '1706182946129'
alias: Wiimprevious
description: ''
trigger:
- platform: device
domain: mqtt
device_id: ad7c41666949b0c7cce5407345b8f200
type: action
subtype: brightness_move_to_level
discovery_id: 0x84ba20fffe34c508 action_brightness_move_to_level
id: trigger1
condition: []
action:
- wait_for_trigger:
- platform: device
domain: mqtt
device_id: ad7c41666949b0c7cce5407345b8f200
type: action
subtype: brightness_move_to_level
discovery_id: 0x84ba20fffe34c508 action_brightness_move_to_level
timeout:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
continue_on_timeout: false
- if:
- condition: template
value_template: '"{{ wait.completed }}"'
then:
- service: media_player.media_next_track
data: {}
target:
entity_id: media_player.willsoffice
else:
- service: media_player.media_previous_track
data: {}
target:
entity_id: media_player.willsoffice
mode: single
To test an automation there's three stages you can follow. Testing the action, the condition and action, and the whole automation:
- Use Configuration -> Automations to find the automation and then select Run in the three dots menu. If this fails your problem is in the
action:section, and details should be found in your log file - Use Developer tools -> Services and call
automation.triggeron the automation withskip_condition: false. If the first passes but this fails then the problem is in yourcondition:block - Use Developer tools -> States to find the trigger entity, click the name, then change the state (at the top) to something that'll trigger the automation before pushing Set State. If this fails then the problem is with your
trigger:section, or the automation is turned off (you can check that in Automations, automations that are turned off will show Disabled)
You can also see this section in the docs about testing and automation traces.
So try changing continue_on_timeout: false to true so the automation does not stop on time out.
condition: []
action:
- wait_for_trigger:
- platform: device
domain: mqtt
device_id: ad7c41666949b0c7cce5407345b8f200
type: action
subtype: brightness_move_to_level
discovery_id: 0x84ba20fffe34c508 action_brightness_move_to_level
timeout:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
continue_on_timeout: true
- if:
- condition: template
value_template: '"{{ wait.trigger == none}}"'
then:
- service: media_player.media_next_track
data: {}
target:
entity_id: media_player.willsoffice
else:
- service: media_player.media_previous_track
data: {}
target:
entity_id: media_player.willsoffice
mode: single
Still not working - should there be a choose condition in here?
Thankyou so much
so the template is very very wrong
Well, broken because you included quotes
Remove " and try again
The docs sugggest
- if:
- "{{ not wait.completed }}"
``` as your test though
hmm. It still isn't differentiating betweem the single and double click
it jumps forward on both of them.
changing not wait completed to wait completed makes it execute the previous track command.
id: '1706182946129'
alias: Wiimprevious
description: ''
trigger:
- platform: device
domain: mqtt
device_id: ad7c41666949b0c7cce5407345b8f200
type: action
subtype: brightness_move_to_level
discovery_id: 0x84ba20fffe34c508 action_brightness_move_to_level
id: trigger1
condition: []
action:
- wait_for_trigger:
- platform: device
domain: mqtt
device_id: ad7c41666949b0c7cce5407345b8f200
type: action
subtype: brightness_move_to_level
discovery_id: 0x84ba20fffe34c508 action_brightness_move_to_level
timeout:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
continue_on_timeout: true
- if:
- condition: template
value_template: '{{ wait.completed }}'
then:
- service: media_player.media_next_track
data: {}
target:
entity_id: media_player.willsoffice
else:
- service: media_player.media_previous_track
data: {}
target:
entity_id: media_player.willsoffice
mode: single
What does the trace show?
Stopped because only a single execution is allowed at 25 January 2024 at 16:13:29
single click shows a path
double click results in a problem
Check the trace for a double click, and look at the previous run
the 'wait for trigger' node was not executed and no further information i available
Not the one that had the stopped message, the one before that
Triggered by the mqtt topic zigbee2mqtt/Kitchen/Living Room Music Remote/action at 25 January 2024 at 16:17:58
Hmm, is the mode wrong?
No
I'm going to play around in the Jinga template tool