Was hoping someone could let me know what is wrong with this code. I am getting a “extra keys not allowed” message when attempting to save the automation. I am fairly sure I am following the documentation, but apparently something is amiss.
What I am attempting to do is:
if the light is on
and
(it is 23:45 on a sun, mon, tues, wed, thu
or
it is 01:00 on a fri, sat)
condition:
condition: and
conditions:
- condition: template
value_template: '{{ is_state(''light.front_porch'',''on'') }}'
- condition: or
conditions:
- condition: time
at: '23:45:00'
weekday:
- sun
- mon
- tue
- wed
- thu
- condition: time
at: '01:00:00'
weekday:
- fri
- sat
Other than using a template condition where a simple state condition would do, and realising that conditions are AND by default, what you have looks ok. Try this:
condition:
- condition: state
entity_id: light.front_porch
state: 'on'
- condition: or
conditions:
- condition: time
at: '23:45:00'
weekday:
- sun
- mon
- tue
- wed
- thu
- condition: time
at: '01:00:00'
weekday:
- fri
- sat
So the light must be on and it must be one of your time conditions for subsequent actions to occur.
However your triggers must occur at exactly those times for this to pass. If this is not the case you may be better off with a range of times, e.g.
- condition: time
after: '00:55:00'
before: '01:05:00'
weekday:
- fri
- sat
A double DUH for me, cos I actually did look it up, but missed it. Guess I need to put a time limit on how late I fiddle around with Home Assistant. I made the changes and now everything is working as expected. Thanks to you both!