Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 101899

Automation Trigger Switch

$
0
0

@MDLefevere wrote:

Hello,

I’ve made an automation to trigger a switch between a time period when one of us gets home, or if we are home when the sun sets.

Strangely it doesn’t get triggered when I get home after sunset.

# Lichten aan bij zonsondergang of wanneer iemand thuis tussen 16.00-23.00
- alias: 'Keukenverlichting aan bij thuis of thuiskomst'
  trigger:
    - platform: sun
      event: sunset
      offset: '-00:00:00'
    - platform: state
      entity_id: device_tracker.iphonemaurice
      to: 'home'
    - platform: state
      entity_id: device_tracker.iphone_van_yvette_2
      to: 'home'        
  condition:
    - condition: state
      entity_id: device_tracker.iphonemaurice
      state: 'home'
    - condition: state
      entity_id: device_tracker.iphone_van_yvette_2
      state: 'home'
    - condition: time
      after: '16:00:00'
      before: '23:00:00'
  action:
    service: switch.turn_on
    entity_id: switch.sonoff_voortuin

I just copied and edited a full written example from the Hassio website:

Automation Examples

Any suggestions?. I can’t figure out what’s wrong with it.

Posts: 15

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 101899

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>