I’m preparing something like a home-reset script, just to be able to reset “on the go” all my configuration switches/booleans/inputs to “default” values. why? long story short: I’ve got few light scenes automations based on for example: day of the week, hour, people presence etc. but also I can override them manually - and after that, my home-reset can bring everything back to order [well, in theory at least]. ok, now you know the background.
to manage that, my home-reset script will contain few “manual” triggers - let’s say something like this:
script:
reset_home:
sequence:
- service: automation.trigger
entity_id: automation.weekend_mode
- delay:
seconds: 2
- service: automation.trigger
entity_id: automation.morning
... (and so on)
automation.weekend_mode normally is triggered on midnight, and without the conditions part, I jump to service_template, where input_boolean.weekend is set on or off according to few ifs that use now().isoweekday(). all works fine, even if triggered manually.
now the fun part. automation.morning triggers at two morning hours (one for weekend, one for other days) and checks time conditions combined with weekend_mode, to set an input_select field to some option [the very same thing is made with other automations: evening, night etc.]. here’s the code:
automation:
morning:
trigger:
- platform: time
at: "6:30"
- platform: time
at: "9:00"
condition:
condition: or
conditions:
- condition: and
conditions:
- condition: time
after: "6:30"
before: "9:30"
- condition: state
entity_id: input_boolean.weekend_mode
state: "off"
- condition: and
conditions:
- condition: time
after: "9:00"
before: "11:00"
- condition: state
entity_id: input_boolean.weekend_mode
state: "on"
action:
- service: input_select.select_option
data:
entity_id: input_select.part_of_the_day
option: "morning"
(...) and so on, other automations with other parts of the day
everything seems to be working fine when triggerred naturally, during the day. but when I trigger the automation via script, actions are executed no matter if conditions are met or not. and that’s wrong, right? or maybe I did some mistake and that’s the reason hassio bypasses the conditons? or I did not understood the way triggering and conditioning works?
can you throw me some hints?