I am new to Home Assistant and trying to get around how the wait action works within Automations.
I have a robot vacuum that I don’t want turning on when the TV is on. I have this working by adding a condition that the TV is off which works fine, however I want the automation to run up to an hour later if I turn the TV off, else if I have my TV on at 10am each day then the vacuum will never turn on.
I have played around with the wait action by moving elements within the automation around but now it won’t run at all which makes me think I have the template wrong (even though nothing is erroring and the automation is being accepted). Setting a timeout means it just waits for the time out and then just turns the vacuum on after that time period. Clearly I have misunderstood something. I have created the automation in the UI.
What I hope its doing is wait for up to an hour for the TV state to switch to off, then turn on the vacuum.
Below is the extract from my automation.yaml file so hopefully you can spot my mistake
- id: '1602364625274'
alias: Turn on Mr Sweepy
description: ''
trigger:
- platform: time
at: '10:00'
condition:
- condition: time
weekday:
- mon
- wed
- sat
action:
- wait_template: "{{ is_state('media_player.sony_bravia_tv', 'off') }}"
timeout: 01:00:00
continue_on_timeout: false
- service: vacuum.start
data: {}
entity_id: vacuum.mr_sweepy