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

Trigger "on" for a specific time, than trigger "off" for the rest of the day

$
0
0

I’m running an automation like this:

alias: UVB - Lampe Stall
description: 11 Hours of Daylight in the Coop
triggers:
  - alias: Trigger 11:00hr before sunset
    value_template: |
      {% set sunset = states('sensor.home_sun_setting')|as_datetime%}
      {{ now() >= sunset - timedelta(hours=11, minutes=00) }}
    id: "on"
    trigger: template
  - event: sunrise
    offset: "00:30:00"
    id: "off"
    trigger: sun
conditions:
  - alias: "Test: Don't run if today is already going to be more than 11 hours"
    condition: template
    value_template: "{{ states('sensor.home_sun_daylight') | float < 11 }}"
actions:
  - type: toggle
    device_id: ebf555b8f79539499f5865b086c02cc6
    entity_id: caad71fe3892a9cab3999d89a5853821
    domain: switch

This usually works just fine. However “sometimes” the electric plug that is controlled by this, misses the trigger (maybe once a month) to switch on. I assume that the Zigbee connection is at its limits here.

This then makes my chickens all confused :slight_smile: :chicken:

My idea would be, to specifically use an “on” trigger (rather than the toggle), for the whole time the light should be on. And then trigger “off” for the whole time the light should be off. Do this every 5 minutes or so. That way it would be a bit more resilliant against these “one off misses”.

But now I’m stuck on implementing this. Can someone help me out?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 105841

Trending Articles



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