Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- binary_sensor:
- - platform: template
- sensors:
- asciugatrice_run:
- friendly_name: 'Asciugatrice in funzione'
- device_class: power
- delay_on:
- minutes: 10
- delay_off:
- minutes: 3
- value_template: >-
- {{ states('sensor.asciugatrice_power')|float(0) > 50 }}
- icon_template: >
- {% if is_state('binary_sensor.asciugatrice_run','on') %}
- mdi:tumble-dryer
- {% else %}
- mdi:tumble-dryer-off
- {% endif %}
- - platform: template
- sensors:
- lavatrice_run:
- friendly_name: 'Lavatrice in funzione'
- device_class: power
- delay_on:
- seconds: 30
- delay_off:
- minutes: 8
- value_template: >-
- {{ states('sensor.lavatrice_power')|float(0) > 50 }}
- icon_template: >
- {% if is_state('binary_sensor.lavatrice_run','on') %}
- mdi:washing-machine
- {% else %}
- mdi:washing-machine-off
- {% endif %}
- automation:
- # Pompa piscina consuma troppo
- - alias: Pompa piscina consuma troppo
- description: Blocca e avvisa se la pompa della piscina consuma troppo
- trigger:
- - platform: numeric_state
- entity_id: sensor.pompa_piscina_power
- above: 190
- action:
- - service: switch.turn_off
- entity_id: switch.pompa_piscina
- - service: script.multinotify
- data:
- title: Sovraccarico pompa piscina
- message: La pompa della piscina sta consumando {{trigger.to_state.state|round(default=0)}} watt, è stata disattivata per sicurezza. Verificare se necessario effettuare la pulizia del filtro a sabbia.
- notify_app: notify.all_devices
- channel: electricity
- critical: true
- alexa_target: media_player.ovunque
- # Avviso asciugatrice ha finito (aggiungo 7 minuti al tempo rilevato perchè il sensore di run ha un tempo di attivazione di 10 minuti e uno di disattivazione di 3: differenza 7 minuti in meno del reale...)
- - alias: Fine asciugatrice
- description: Avviso quando l'asciugatrice finisce
- trigger:
- - entity_id: binary_sensor.asciugatrice_run
- from: 'on'
- platform: state
- to: 'off'
- condition: []
- action:
- - service: script.multinotify
- data:
- title: Asciugatrice ha finito
- message: >
- {% set seconds = now().timestamp() - as_timestamp(trigger.from_state.last_changed) + 7*60 %}
- {% set hours = (seconds / 3600) | int(0) %}
- {% set minutes = (seconds % 3600 / 60) | int(0) %}
- {% set hours_word = "ora" if hours==1 else "ore" %}
- {% set minutes_word = "minuto" if minutes==1 else "minuti" %}
- L'asciugatrice ha terminato il ciclo dopo {{hours}} {{hours_word}} e {{ minutes}} {{minutes_word}}
- notify_app: notify.all_devices
- channel: info
- critical: true
- alexa_target: media_player.ovunque
- # Avviso lavatrice ha finito
- - alias: Fine lavatrice
- description: Avviso quando la lavatrice finisce
- trigger:
- - entity_id: binary_sensor.lavatrice_run
- from: 'on'
- platform: state
- to: 'off'
- condition: []
- action:
- - service: script.multinotify
- data:
- title: Lavatrice ha finito
- message: La lavatrice ha terminato il lavaggio!
- notify_app: notify.all_devices
- channel: info
- critical: true
- alexa_target: media_player.ovunque
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement