Node-RED - Recevoir une notification après le passage du facteur!

Vous attendez impatiemment votre colis qui a traversé les océans avec la dernière nouveauté geek? votre derniers avis d’impôts ? ou simplement vous n’avez pas envie d’allez à votre boite à lettre alors qu’elle est vide?

image

avec un capteur aqara ou Xiaomi ou autre et sans Gateway vous saurez si vous avez recu du courrier :

pré requis:

  • une clef zigbee (conbee II ou équivalent)
  • node red
  • un capteur d’ouverture / fermeture type Xiaomi (sensor binary)
  • un compte gratuit pushbullet pour les notifications sur votre telephone par exemple

1/ déclarer votre capteur, évidemment ! il devra apparaitre dans les entités que gère votre clé et/ou dans les entités HA :

image

2/ observateur d’évènement :
vous remarquerez que dans les outils de développements > évènement, en surveillant l’évènement state_changed le changement du statut du capteur quand vous l’ouvrez/fermez.

On souhaite recevoir une notifcation lorsque le capteur sera ouvert, donc, qui passera d’un état fermé à ouvert (en fonction de la marque de vos capteurs ca peut etre de ON à OFF ou de OFF à ON)

3/ Node Red:
Déposer sur un flow un events : state puis le paramétrer :

image

bien entendue remplacer l’entity ID par le votre :wink:
dans mon cas, lorsque le capteur est fermer il est à ON d’où le ‹ if State is off › dans mon exemple.

Déposer maintenant un nœud Call Service paramétré ainsi :

image

Cliquez sur les " petits points de Data et coller ou personnaliser le code JSON :
{
« message »: « Il y a du courrier dans la boîte ! »,
« title »: « Attention ! Attention ! »
}

c’est ce mesage que vous recevrez en notification.

relier les deux nœuds :

image

et cliquer sur le bouton Deploy !

voili voilou !

Je préfère maintenant les notifications Telegram…………… à vous de voir

Je ne fais la promotion de ce groupe en particulier mais je site un homie qui m’a passé l’information :
https://m.facebook.com/groups/312290382876675?view=permalink&id=560113201427724

le courrier s’illumine ou le colis ou les deux en fonction de ce que vous avez recu, j’aime beaucoup ! merci Aurelien !

glop !

2 « J'aime »

Je venais justement de le mettre en place avec discord apres des recherches et la je tombe sur ce topic :smiley:

oui c’est glop :slight_smile: tu rajoutes une notif TTS sur GH et ca fait la classe à Dallas :wink:

C’est ce que j’ai fais … couplé a un wemos ponté sur ma sonnette et cam qui prend une photo et rulezz

1 « J'aime »

Je partage mon flow pour ceux qu’ils veulent une notif pour le courrier,un colis ou la relève du courrier. Cela envoi une notification classique et une notif tts sur ma google home.

Il faut trois capteurs d’ouverture de porte. 1 pour la fente et 1 pour la porte de la boite aux lettres. Le dernier est installé sur ma porte d’entrée. Si la porte d’entrée et celle de la boite aux lettres a été ouverte dans les 3 minutes alors c’est la relève du courrier sinon c’est un colis. Cela fonctionne très bien chez moi depuis quelque mois maintenant.

[{"id":"5acc8cf9.27a254","type":"tab","label":"Boîte aux lettres","disabled":false,"info":""},{"id":"2b7f2fdf.bbb38","type":"comment","z":"5acc8cf9.27a254","name":"[Boîte aux lettres] RAZ","info":"","x":120,"y":40,"wires":[]},{"id":"a0ee1db2.0920a","type":"inject","z":"5acc8cf9.27a254","name":"0h00","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"01 00 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":70,"y":140,"wires":[["f566d93b.3434e8","70dd6105.76e9b","14f464e.6cbd49b"]]},{"id":"f566d93b.3434e8","type":"api-call-service","z":"5acc8cf9.27a254","name":"RAZ Boîte aux Lettres","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.boite_aux_lettres","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":280,"y":80,"wires":[["dae1b157.0c7be"]]},{"id":"14f464e.6cbd49b","type":"api-call-service","z":"5acc8cf9.27a254","name":"RAZ Courrier","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.courier_bal","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":250,"y":200,"wires":[["dae1b157.0c7be"]]},{"id":"70dd6105.76e9b","type":"api-call-service","z":"5acc8cf9.27a254","name":"RAZ Colis","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.colis_bal","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":240,"y":140,"wires":[["dae1b157.0c7be"]]},{"id":"dae1b157.0c7be","type":"debug","z":"5acc8cf9.27a254","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":490,"y":140,"wires":[]},{"id":"7ed8eaa9.970974","type":"comment","z":"5acc8cf9.27a254","name":"[Boîte aux lettres] Courrier reçu","info":"","x":150,"y":260,"wires":[]},{"id":"a85e4be9.794e18","type":"server-state-changed","z":"5acc8cf9.27a254","name":"Fente Boîte aux Lettres","server":"a8c279c8.be8be8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.detecteur_fente_b_lettres","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":120,"y":320,"wires":[["b9a14059.22aac"],[]]},{"id":"b9a14059.22aac","type":"api-current-state","z":"5acc8cf9.27a254","name":"Pas de Courrier","server":"a8c279c8.be8be8","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.courier_bal","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":340,"y":320,"wires":[["d47afc6.7480c","adfdad74.4f94d"],[]]},{"id":"d47afc6.7480c","type":"api-call-service","z":"5acc8cf9.27a254","name":"Active Courrier","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.courier_bal","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":540,"y":280,"wires":[["569a0125.4ef9e"]]},{"id":"adfdad74.4f94d","type":"api-call-service","z":"5acc8cf9.27a254","name":"Active Boîte aux Lettres","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.boite_aux_lettres","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":570,"y":340,"wires":[["dd21ca3.9bd7c38"]]},{"id":"569a0125.4ef9e","type":"api-call-service","z":"5acc8cf9.27a254","name":"Notication Aurélien","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_aurelien","entityId":"","data":"{\"message\":\"Le facteur a déposé du courrier\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":810,"y":280,"wires":[["3722907.258337"]]},{"id":"dd21ca3.9bd7c38","type":"api-call-service","z":"5acc8cf9.27a254","name":"Notication Siham","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_siham","entityId":"","data":"{\"message\":\"Le facteur a déposé du courrier\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":810,"y":340,"wires":[["3722907.258337"]]},{"id":"2c2866ef.94852a","type":"debug","z":"5acc8cf9.27a254","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1270,"y":320,"wires":[]},{"id":"3722907.258337","type":"api-call-service","z":"5acc8cf9.27a254","name":"Annonce Google Home","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"tts","service":"google_translate_say","entityId":"media_player.salon","data":"{\"language\":\"fr\",\"message\":\"Le facteur a déposé du courrier\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1050,"y":320,"wires":[["2c2866ef.94852a"]]},{"id":"4f994d10.461664","type":"server-state-changed","z":"5acc8cf9.27a254","name":"Porte Boîte aux Lettres","server":"a8c279c8.be8be8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.detecteur_porte_b_lettres","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":120,"y":600,"wires":[["9cc7c0d.568b34"],[]]},{"id":"522c584c.98fef8","type":"api-call-service","z":"5acc8cf9.27a254","name":"Active Colis","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.colis_bal","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":850,"y":660,"wires":[["8ad14ee9.ed423"]]},{"id":"ac41607c.b9b47","type":"api-call-service","z":"5acc8cf9.27a254","name":"Active Boîte aux Lettres","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.boite_aux_lettres","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":890,"y":720,"wires":[["557118e8.6cd918"]]},{"id":"8ad14ee9.ed423","type":"api-call-service","z":"5acc8cf9.27a254","name":"Notication Aurélien","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_aurelien","entityId":"","data":"{\"message\":\"Le facteur a déposé un colis\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1130,"y":660,"wires":[["a6e604f2.e59468"]]},{"id":"557118e8.6cd918","type":"api-call-service","z":"5acc8cf9.27a254","name":"Notication Siham","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_siham","entityId":"","data":"{\"message\":\"Le facteur a déposé un colis\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1130,"y":720,"wires":[["a6e604f2.e59468"]]},{"id":"a6e604f2.e59468","type":"api-call-service","z":"5acc8cf9.27a254","name":"Annonce Google Home","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"tts","service":"google_translate_say","entityId":"media_player.salon","data":"{\"language\":\"fr\",\"message\":\"Le facteur a déposé un colis\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1370,"y":700,"wires":[["bf358099.86955"]]},{"id":"bf358099.86955","type":"debug","z":"5acc8cf9.27a254","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1590,"y":700,"wires":[]},{"id":"14754c3c.620004","type":"comment","z":"5acc8cf9.27a254","name":"[Boîte aux lettres] Colis reçu / Releve Courrier","info":"","x":190,"y":420,"wires":[]},{"id":"1eedf94.ef97e07","type":"api-call-service","z":"5acc8cf9.27a254","name":"RAZ Boîte aux Lettres","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.boite_aux_lettres","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":880,"y":420,"wires":[["a4e792ac.10b9b"]]},{"id":"60533a69.8f0924","type":"api-call-service","z":"5acc8cf9.27a254","name":"RAZ Colis","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.colis_bal","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":840,"y":480,"wires":[[]]},{"id":"4d9f5058.f76b7","type":"api-call-service","z":"5acc8cf9.27a254","name":"RAZ Courrier","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.courier_bal","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":850,"y":540,"wires":[["df4b8a06.ffc438"]]},{"id":"a4e792ac.10b9b","type":"api-call-service","z":"5acc8cf9.27a254","name":"Notication Aurélien","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_aurelien","entityId":"","data":"{\"message\":\"Courrier relevé\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1110,"y":460,"wires":[["49085065.ffe2"]]},{"id":"df4b8a06.ffc438","type":"api-call-service","z":"5acc8cf9.27a254","name":"Notication Siham","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_siham","entityId":"","data":"{\"message\":\"Courrier relevé\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1110,"y":520,"wires":[["49085065.ffe2"]]},{"id":"49085065.ffe2","type":"api-call-service","z":"5acc8cf9.27a254","name":"Annonce Google Home","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"tts","service":"google_translate_say","entityId":"media_player.salon","data":"{\"language\":\"fr\",\"message\":\"Courrier relevé\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1350,"y":500,"wires":[["5ea23d92.64b744"]]},{"id":"5ea23d92.64b744","type":"debug","z":"5acc8cf9.27a254","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1570,"y":500,"wires":[]},{"id":"5a032c4d.a22854","type":"api-render-template","z":"5acc8cf9.27a254","name":"Colis ou Reléve","server":"a8c279c8.be8be8","template":" {% set mailbox_last_changed = as_timestamp(states.binary_sensor.detecteur_porte_b_lettres.last_changed) %}\n {% set front_door_last_changed = as_timestamp(states.binary_sensor.detecteur_porte_entree.last_changed) %}\n {% if (mailbox_last_changed - front_door_last_changed)|abs < 180 %}\nreleve_courrier\n {% else %}\ncolis_recu\n {% endif %}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":520,"y":600,"wires":[["973eae8d.03711"]]},{"id":"973eae8d.03711","type":"switch","z":"5acc8cf9.27a254","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"releve_courrier","vt":"str"},{"t":"eq","v":"colis_recu","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":690,"y":600,"wires":[["1eedf94.ef97e07","60533a69.8f0924","4d9f5058.f76b7"],["522c584c.98fef8","ac41607c.b9b47"]]},{"id":"9cc7c0d.568b34","type":"delay","z":"5acc8cf9.27a254","name":"","pauseType":"delay","timeout":"120","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":330,"y":600,"wires":[["5a032c4d.a22854"]]},{"id":"a8c279c8.be8be8","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
3 « J'aime »