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 sql (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 | | Foteliki samochodowe | | Opony motocyklowe | | Kamery IP sklep | | Programista PHP | | Skróć link | | Blog o książkach | | Przenieś bloga z onetu | | Kody programów | | Pionowe opisy |