I was able edit the script file and change the ID to a friendly name and now can call it from the automation. The syntax of my script file is not exactly how it is described in the docs as referenced by Tinkerer.
As for the condition it is to accomplish the following:
- Check and see if the script is not running
- Check that the time is after 3:45am and before sunrise.
My trigger is just for testing but will be replaced with a motion sensor once I get the automation working correctly.
My automation is:
alias: Motion in Morning
trigger:
- at: '07:17:00'
platform: time
condition:
condition: and
conditions:
- condition: state
entity_id: script.morning_motion
state: 'off'
- condition: or
conditions:
- condition: time
after: '03:45:00'
- condition: sun
before: sunrise
action:
- service: script.turn_on
entity_id: script.morning_motion
My script is:
alias: Morning Motion
description: Turn on Fireplace and TV Light
sequence:
- service: switch.turn_on
data:
entity_id: switch.smart_switch_switch
- delay: 00:00:15
- service: switch.turn_on
data:
entity_id: switch.zooz_zen26_s2_on_off_wall_switch_switch
Looks like I am getting close.