Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Esempio (da provare) di automazione che parte ogni ora, tiene un
- # device acceso per un certo tempo e poi lo spegne, a mo' di timer luce scale.
- # Il device si chiama light.lampadina, l'automazione utilizza due helper:
- # un timer timer.lampadina e un input numerico
- # input_number.tempo_lampadina per modificare la durata di accensione
- - id: LuceOnPeriodica
- alias: Attiva luce ogni ora
- description: ''
- trigger:
- - platform: time_pattern
- hours: "/1"
- condition: []
- action:
- - service: light.turn_on
- entity:
- - light.lampadina
- - service: timer.start
- target:
- entity_id: timer.lampadina
- data:
- # Se si vuole usare un helper numerico per definire il tempo di accensione
- duration: '{{ states(''input_number.tempo_lampadina'') }}'
- # Se non si vuole usare un helper e mettere un valore fisso
- # duration: 00:01:00
- - id: LuceOff
- alias: Disattiva luce a scadenza timer
- description: ''
- trigger:
- - platform: state
- entity_id:
- - timer.timeout_luce
- to: idle
- from: active
- condition: []
- action:
- - service: light.turn_off
- entity:
- - light.lampadina
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement