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 qbasic (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
 
| Sklep z artykułami dla dzieci | | Foteliki samochodowe | | Opony zimowe | | Opony specjalne | | Sklep z artykułami RTV/AGD | | Programista Trójmiasto | | Darmowe Blogi | | Gdzie przenieść blog za darmo? | | Załóż za darmo bloga | | Opisy na Facebooka |