kairostech-sw / kairoshub

0 stars 0 forks source link

CdU 8-9 - Automazione Api / Chiudi tapparelle #30

Closed mfinotti closed 1 year ago

mfinotti commented 1 year ago

Aggiungere due nuove automazioni che gestiscano l'apertura e la chiusura delle tapparelle nella posizione specificata dall'utente. Le automazioni vengono triggerate attraverso rispettivi eventi e rispondono con una notifica.

Apri tapparelle

trigger event: HA_ROLLERS_ATHOME_POSITION action:

  1. service call: cover.set_position (input_number.rollershutter_athome_position)
  2. wait (1 minuto)
  3. condition: se group cover è nella posizione input_number.rollershutter_athome_position
  4. dispatch evento AD_KAIROSHUB_NOTIFICATION ncode: ROLLERS_OPENED sender: *

Chiudi tapparelle

trigger event: HA_ROLLERS_NOTATHOME_POSITION action:

  1. service call: cover.set_position (input_number.rollershutter_notathome_position)
  2. wait (1 minuto)
  3. condition: se group cover è nella posizione input_number.rollershutter_athome_position
  4. dispatch evento AD_KAIROSHUB_NOTIFICATION ncode: ROLLERS_CLOSED sender: *

Refactoring HOME TO_OFF , TO_ON

Sostituire dalle automazioni sopra citate le action service sui gruppi di tapparelle con l'invocazione degli eventi HA_ROLLERS_ATHOME_POSITION e HA_ROLLERS_NOTATHOME_POSITION

christianorsini commented 1 year ago

Messaggi HA

Producing message on broker: quattrostagioni.linkedsolutions.it:9093 topic: HASSIO message: {'eventType': 'NOTICE', 'systemCode': 'UNAVAILABLE', 'sender': '*', 'message': 'Le tapparelle sono state aperte correttamente.'}

Producing message: [b'{"eventType": "NOTICE", "systemCode": "UNAVAILABLE", "sender": "*", "message": "Le tapparelle sono state aperte correttamente.", "timestamp": "2022-11-22T09:35:38+01:00"}'] on broker: [quattrostagioni.linkedsolutions.it:9093] and topic: [HASSIO]