Advertisement
calas

Gestione riscaldamento acceso

Dec 30th, 2021
1,119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 6.26 KB | None | 0 0
  1. homeassistant:
  2.   customize:
  3.     package.node_anchors:
  4.       customize: &customize
  5.         package: 'Alert Riscaldamento Acceso'
  6.         version: 'v1.1'
  7.         author: 'Calas'
  8.  
  9.       expose: &expose
  10.         <<: *customize
  11.         haaska_hidden: false
  12.         homebridge_hidden: false
  13.  
  14.   ################################################
  15.   ## Customize
  16.   ################################################
  17.     input_boolean.riscaldamenti_accesi:
  18.       <<: *customize
  19.     alert.riscaldamento_acceso:
  20.       <<: *customize
  21.  
  22.  
  23. #******************************************************************************#
  24. #                                   C O R P O                                  #
  25. #******************************************************************************#
  26.  
  27. ################################################################################
  28. ##                  Input Boolean
  29. ###################################################
  30. input_boolean:
  31.  riscaldamenti_accesi:
  32.   name: riscaldamenti accesi
  33.  avviso_riscaldamenti_accesi:
  34.    name: avviso riscaldamenti accesi
  35.  
  36. ################################################################################
  37. ##                  ALERT
  38. ###################################################
  39. alert:
  40.   riscaldamento_acceso:
  41.     name: Riscaldamento Acceso
  42.     entity_id: input_boolean.riscaldamenti_accesi
  43.     state: 'on'
  44.     repeat: 5
  45.     can_acknowledge: true
  46. #    skip_first: false
  47.     notifiers:
  48.      - riscaldamenti_accesi_francesco
  49.       - riscaldamenti_accesi_simona
  50.  
  51. ################################################################################
  52. ##                  NOTIFY
  53. ###################################################
  54. notify:
  55.   - name: riscaldamenti accesi Francesco
  56.     platform: group
  57.     services:
  58.       - service: !secret notify_francesco
  59.         data:
  60.           title: "Avviso Riscaldamento"
  61.           message: "Nessuno è in casa ma i termosifoni sono accesi, li lascio in funzione?"
  62.           data:
  63.             tag: spegni_termosifoni
  64.             group: riscaldamenti
  65.             actions:
  66.               - action: "ACTION_SPEGNI_TERMOSIFONI_SI"
  67.                 title: "Si"
  68.               - action: "ACTION_SPEGNI_TERMOSIFONI_NO"
  69.                 title: "No, spegni ora."
  70.                 destructive: yes
  71.  
  72.   - name: riscaldamenti accesi Simona
  73.     platform: group
  74.     services:
  75.       - service: !secret notify_simona
  76.         data:
  77.           title: "Avviso Riscaldamento"
  78.           message: "Nessuno è in casa ma i termosifoni sono accesi, li lascio in funzione?"
  79.           data:
  80.             tag: spegni_termosifoni
  81.             group: riscaldamenti
  82.             actions:
  83.               - action: "ACTION_SPEGNI_TERMOSIFONI_SI"
  84.                 title: "Si"
  85.               - action: "ACTION_SPEGNI_TERMOSIFONI_NO"
  86.                 title: "No, spegni ora."
  87.                 destructive: yes
  88.  
  89. ################################################################################
  90. ##                  AUTOMATION
  91. ###################################################
  92. automation:
  93. - alias: PUSH Termosifoni Accessi
  94.   id: a00eb12e5f3844d8b86bd5075bcdb2a8
  95.   initial_state: true
  96.   trigger:
  97.     - entity_id: group.famiglia
  98.       from: 'home'
  99.       platform: state
  100.       to: 'not_home'
  101.   condition:
  102.     - condition: numeric_state
  103.       entity_id: sensor.netatmo_stato
  104.       above: 17
  105.     - condition: state
  106.       entity_id: input_boolean.avviso_riscaldamenti_accesi
  107.       state: 'on'
  108.     - condition: template
  109.       value_template: "{{ states('sensor.stagioni') != 'Estate' }}"
  110.     - condition: or
  111.       conditions:
  112.         - condition: state
  113.           entity_id: sensor.netatmo_stato_away
  114.           state: 'Schedule'
  115.         - condition: state
  116.           entity_id: sensor.netatmo_stato_away
  117.           state: 'manual'
  118.   action:
  119.     - choose:
  120.         - alias: "Modalita ospite"
  121.           conditions:
  122.             - condition: state
  123.               entity_id: input_boolean.modo_ospite
  124.               state: 'on'
  125.           sequence:
  126.             - service: !secret notifiche_francesco
  127.               data:
  128.                 title: 'Attenzione'
  129.                 message: Il riscaldamento rimarrà acceso perchè la modalità ospite è attiva.
  130.       default:
  131.         - service: input_boolean.turn_on
  132.           data:
  133.             entity_id: input_boolean.riscaldamenti_accesi
  134.  
  135.  
  136.  
  137. ################################################################################
  138. ##                  ACTIONS
  139. ###################################################
  140.  
  141. - alias: iOS Action Spegni - Termosifoni Accesi
  142.   id: feedbaaa765546d1ba8d97a5942ee447
  143.   initial_state: true
  144.   trigger:
  145.     - platform: event
  146.       event_type: mobile_app_notification_action
  147.       event_data:
  148.         action: "ACTION_SPEGNI_TERMOSIFONI_SI"
  149.     - platform: event
  150.       event_type: mobile_app_notification_action
  151.       event_data:
  152.         action: "ACTION_SPEGNI_TERMOSIFONI_NO"
  153.   action:
  154.     - choose:
  155.         - alias: "SI"
  156.           conditions:
  157.             - condition: template
  158.               value_template: "{{ trigger.event.data.action == 'ACTION_SPEGNI_TERMOSIFONI_SI' }}"
  159.           sequence:
  160.             - service: climate.set_preset_mode
  161.               data:
  162.                 entity_id: climate.netatmo_casa
  163.                 preset_mode: 'away'
  164.  
  165.             - service: notify.famiglia
  166.               data:
  167.                 message: "ok, spegno"
  168.                 data:
  169.                   group: riscaldamenti
  170.  
  171.             - service: input_boolean.turn_off
  172.               data:
  173.                 entity_id: input_boolean.riscaldamenti_accesi
  174.  
  175.             - service: !secret notifiche_francesco
  176.               data:
  177.                 message: clear_notification
  178.                 data:
  179.                   tag: spegni_termosifoni
  180.             - service: !secret notifiche_simona
  181.               data:
  182.                 message: clear_notification
  183.                 data:
  184.                   tag: spegni_termosifoni
  185.  
  186.         - alias: "NO"
  187.           conditions:
  188.             - condition: template
  189.               value_template: "{{ trigger.event.data.action == 'ACTION_SPEGNI_TERMOSIFONI_NO' }}"
  190.           sequence:
  191.             - service: notify.famiglia
  192.               data:
  193.                 message: "ok, lascio stare"
  194.                 data:
  195.                   group: riscaldamenti
  196.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement