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 plsql (dodał(a) kashub @ 2024-12-05 15:26:29)

Twoja wyszukiwarka
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 | | Opony letnie | | Opony zimowe | | Dyskretny sexshop internetowy | | Sklep z artykułami dla zwierząt | | Skracacz linków | | Blogi za darmo | | Jak przenieść bloga | | Załóż za darmo bloga | | Skracacz linków |