Help with Automations

Hello,

I have created this automation (see below) and cant get it working. :frowning: I think there is something wrong with the conditions part but not 100% sure. I’ve made automatons this before and they all still work but not this one. I hope someone knows what is wrong and can help me.

  - alias: Riley At PC Night ON
trigger:
  platform: state
  entity_id: input_select.riley_status
  to: "At Computer"
condition:
  - condition: sun
    after: sunset
    after_offset: "-00:30:00"
action:    
  service: scene.turn_on
  entity_id: scene.at_pc_night
- alias: Riley Already At PC Night ON
trigger:
  platform: numeric_state
  entity_id: sensor.monitor_wattage
  above: 20
condition:
  condition: and
  conditions:
  - condition: sun
    after: sunset
    after_offset: "-00:30:00"
  - condition: state
    entity_id: input_select.riley_status
    to: "At Computer"  

Riley.

Hello,

Do you have these 2 automation in 1 file? Because as i can understand, you are doing two “scene” depending on two different triggers.

So, as you have a problem with this automation, maybe i will separate in 2 files to check if separate one of them works.

Then, analyzing the code of each one, i would like to ask:

 - alias: Riley At PC Night ON
trigger:
  platform: state
  entity_id: input_select.riley_status
  to: "At Computer"
condition:
  - condition: sun
    after: sunset
    after_offset: "-00:30:00"
action:    
  service: scene.turn_on
  entity_id: scene.at_pc_night

In this one, the status “At Computer”, maybe i will put with only one (’). I have and automation and i defined like:

alias: Mama llega a Casa
trigger:
  platform: state
  entity_id: device_tracker.b85xxxxxxxx
  from: 'not_home'
  to: 'home'

About condition of sunset, what exacly do you want? Because i’m looking my sun state in my HA and inly i see this:

Can you explain the idea of your automation?

Just had a closer look at the automation i posted and it is missing the action part. I think i may have it sorted though.

Solved it just had a state wrong. :slight_smile: