Automation question probably just tired

Maybe im just tired, but could anybody tell me what is wrong here, im sure im just overlooking something simple. TY

- alias: Change TV For NFL FOX
  trigger:
    platform: time
    at: "12:50:05"
  condition: 
 
  - condition: state
    entity_id: sensor.nfl_offset_reached
    state: 'True'
  - condition: state
    entity_id: sensor.browns_channel_next_game
    to: 'FOX'
  action:        
    - service: script.turn_on
      entity_id: script.fox
    - service: homeassistant.turn_on
      entity_id: automation.browns_football

You’ll need to be a little more less vague :grinning:

What’s it not doing?

What’s this for, isn’t your sensor.nfl_offset_reached the flag you want to work off of? If not, post that template again. ‘True’ doesn’t seem right. I’d think you’d want just True.

This passed the configuration validation, please double check the value of the states, the conditions, and indentation of actions:

- id: Change TV For NFL FOX
  trigger:
    platform: time
    at: "12:50:05"
  condition: 
    condition: and
    conditions:
      - condition: state
        entity_id: sensor.nfl_offset_reached
        state: 'True'
      - condition: state
        entity_id: sensor.browns_channel_next_game
        state: 'FOX'
  action:        
  - service: script.turn_on
    entity_id: script.fox
  - service: homeassistant.turn_on
    entity_id: automation.browns_football
1 Like

Yes, this was perfect! Thank You! JTPublic!

@petro, I couldn’t figure out what was preventing my automaton from starting in appdeamon. So Im also trying to use google calendar to pull attributes from.
[sensor.nfl_offset_reached] False, So im assuming True will be set when the offset is reached?

I setup 4 automation’s so depending on the channel the game is on it will change to the correct channel.

@finity, It wasn’t passing correctly.

It will work the way you wrote but you don’t have to include the “condition: and” and “conditions:” lines since by default the condtions are “and” unless otherwise specified.

I think the original problem in the OP code was that he was using no indents in conditions and two spaces in the trigger and action sections. Those have to be consistently used.

Good point, thanks to bringing that up, that is correct, condition defaults to AND for multiple conditions. I wasn’t sure OP wanted AND or OR for his automation, so I stated that explicitly.

1 Like

You may be right. I just assumed ‘and’ from the way it was written.