Kashub's Code Barn - "Home assistant automation to turn christmas lights on half hour before sunset and turn off half hour after sunrise"

podświetlone jako freebasic (dodał(a) kashub @ 2024-12-05 15:26:29)

Twoja wyszukiwarka
Parcel ABC
Podświetl ten kod w:
Ostatnio dodane:
Losowe wpisy:
alias: Outdoor Xmas lights based on sunset and sunrise
description: "Turns on lights before sunset and off after sunrise"
mode: single
trigger:
  - platform: template
    value_template: >
      {{ now().timestamp() >= (as_timestamp(state_attr('sun.sun', 'next_setting')) - 1800) }}
    id: sunset-on
  - platform: template
    value_template: >
      {{ now().timestamp() >= (as_timestamp(state_attr('sun.sun', 'next_rising')) + 1800) }}
    id: sunrise-off
action:
  - choose:
      - conditions:
          - condition: trigger
            id: sunset-on
        sequence:
          - service: homeassistant.turn_on
            target:
              entity_id:
                - switch.your_first_switch_with_lights
                - switch.your_second_switch_with_lights
      - conditions:
          - condition: trigger
            id: sunrise-off
        sequence:
          - service: homeassistant.turn_off
            target:
              entity_id:
                - switch.your_first_switch_with_lights
                - switch.your_second_switch_with_lights
 
| Sklepy internetowe | | Wózki dla dzieci | | Opony całoroczne | | Opony letnie | | Kamery IP sklep | | Skracacz linków | | Darmowe Blogi | | Kody programów | | Gnieżdżewo | | Opisy na Facebooka |