Have been busy with this script lately. Some syntax is not up to date to current implementation.
Calling a script as a service, e.g.:
- service: script.turn_on
entity_id: script.your_script
Wait template for state sensor.time has changed, e.g.:
- wait_template: "{{ states('sensor.time') == '07:00' }}"
Using scripted logic for selecting an entity, e.g.:
- service: script.turn_on
data_template:
entity_id: >
{% if states('binary_sensor.dark_outside' , 'on') %} script.morning_mockupancy
{% else %} script.mockupancy_loop {% endif %}
Check your semantics for the above errors and correct them, and your script will run.
I’ve also added an automation that runs the mockupancy script triggerd by input state ‘Extended Away’.