Skip to content

Instantly share code, notes, and snippets.

@webartoli
Last active April 21, 2025 08:30
Show Gist options
  • Save webartoli/8451dd2ce2ddb7218947bebf22959136 to your computer and use it in GitHub Desktop.
Save webartoli/8451dd2ce2ddb7218947bebf22959136 to your computer and use it in GitHub Desktop.
Rotate Input
blueprint:
name: Rotazione Circolare Input Select con Reset
description: Esegue una rotazione circolare di un input_select utilizzando multipli trigger definiti dall'utente per le azioni "up" e "down", e reimposta il valore di default dopo un tempo specificato.
domain: automation
input:
input_select:
name: Input Select
description: L'input_select da ruotare.
selector:
entity:
domain: input_select
triggers_up:
name: Trigger Up
description: Trigger che attivano l'azione "up".
selector:
trigger: {}
triggers_down:
name: Trigger Down
description: Trigger che attivano l'azione "down".
selector:
trigger: {}
default_value:
name: Valore di Default
description: Il valore di default a cui reimpostare l'input_select. Inserire uno dei valori validi dell'input_select.
selector:
text: {}
reset_delay:
name: Tempo di Attesa per il Reset
description: Il tempo di attesa prima di reimpostare l'input_select al valore di default.
selector:
duration: {}
trigger:
- platform: template
value_template: "{{ triggers_up }}"
id: up
- platform: template
value_template: "{{ triggers_down }}"
id: down
action:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.id == 'up' }}"
sequence:
- service: input_select.select_next
target:
entity_id: !input input_select
- conditions:
- condition: template
value_template: "{{ trigger.id == 'down' }}"
sequence:
- service: input_select.select_previous
target:
entity_id: !input input_select
default: []
- delay: !input reset_delay
- service: input_select.select_option
target:
entity_id: !input input_select
data:
option: !input default_value
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment