Distributeur de nourriture pour chat ESPHOME

Bonjour à tous,

Pour les geek qui aime tout domotiser, j’ai trouvé un tuto pour domotiser le distributeur à chat Petoneer Nutri.

Il faut flasher la puce TYEW3S. J’ai réalisé la modification aujourd’hui, cela reste assez simple. Pour le flash j’ai utilisé le programme ESPHOME sous windows donc j’ai ajouté la configuration sous esphome pour générer le firmware et ensuite flasher le distributeur sous windows.

Le distributeur permet donc avec des automatisations de distribuer automatiquement les croquettes et également recevoir les notifications en fonction du status du distributeur quand il manque des croquettes, quand il y a une erreur du distributeur ou si l’appareil est vide.

Tuto russe

Achat en France livraison en 48h.

macway

esphome:
  name: petoneer_nutri
  platform: ESP8266
  board: esp01_1m
  on_boot:
    priority: -10
    then:
      - script.execute: detection 

wifi:
  ssid: !secret ssid
  password: !secret wpa2
  fast_connect: true

captive_portal:

logger:

api:

ota:

status_led:
  pin: 
    number: 4

Commutateur de broche de distribution d’ alimentation

switch:
  - platform: gpio
    pin: 
      number: 5
      inverted: true
    id: petoneer_nutri_feed_button

Lorsqu’il est déclenché, attendez 5 secondes, et si pendant 5 secondes, gpio14 est éteint. state, puis définissez le statut « Alimentation réussie »

on_turn_on:
  then:
  - delay: 5s
  - if:
      condition:
        for:
          time: 5s
          condition:
            binary_sensor.is_off: petoneer_nutri_feed_status
      then:
          - logger.log: "Alimentation réussie"
          - text_sensor.template.publish:
              id: petoneer_nutri_status
              state: "Alimentation réussie"

Nous attendons 10 secondes, et si l’état est « Niveau d’alimentation faible », mettez à jour le statut sur « Alimentation réussie »

  - delay: 10s
  - if:
      condition:
          - text_sensor.state:
              id: petoneer_nutri_status
              state: "Niveau d'alimentation faible"
      then:
        - logger.log: "Alimentation réussie avec un niveau d'alimentation faible"
        - text_sensor.template.publish:
            id: petoneer_nutri_status
            state: "Alimentation réussie"

Bouton de distribution d’alimentation de l’interface utilisateur, allume la broche gpio5 pendant 150 ms puis s’éteint

  - platform: template
    name: "petoneer_nutri_feed"
    icon: "mdi:cat"
    turn_on_action:
    - switch.turn_on: petoneer_nutri_feed_button
    - delay: 150ms
    - switch.turn_off: petoneer_nutri_feed_button

Buzzer relay

  - platform: gpio
    pin: 
      number: 16
      inverted: true
    id: petoneer_nutri_buzzer
    name: petoneer_nutri_buzzer
    icon: "mdi:volume-high"

Suivi de l’état

binary_sensor:
  - platform: gpio
    pin: 
      number: 14
      inverted: true
    id: petoneer_nutri_feed_status

Lorsqu’il est déclenché dans la plage de 990-1100ms, le statut « Niveau d’alimentation faible »

on_click:
- min_length: 990ms
  max_length: 1100ms
  then:
    - if:
        condition:
          not:
             - text_sensor.state:
                 id: petoneer_nutri_status
                 state: "Niveau d'alimentation faible"

        then:
          - logger.log: "Niveau d'alimentation faible"
          - text_sensor.template.publish:
              id: petoneer_nutri_status
              state: "Niveau d'alimentation faible"

Lorsqu’il est déclenché dans la plage 1400-3100ms, l’état" Erreur de livraison d’alimentation "

- min_length: 1400ms
  max_length: 3100ms
  then:
    - logger.log: "Erreur de livraison d'alimentation"
    - text_sensor.template.publish:
        id: petoneer_nutri_status
        state: "Erreur de livraison d'alimentation"

Exécuter un script de détection pour suivre l’état

on_state:
  then:
    - delay: 5s
    - script.execute: detection    

Text status sensor for UI HA

text_sensor:
  - platform: template
    name: "petoneer_nutri_status"
    icon: "mdi:information-outline"
    id: petoneer_nutri_status

Script de suivi de l’état basé sur le script gpio14

script:
  - id: detection
    then:
    - if:
        condition:
          for:
            time: 5s
            condition:
              binary_sensor.is_off: petoneer_nutri_feed_status
        then:
            - logger.log: "Status OK"
            - text_sensor.template.publish:
                id: petoneer_nutri_status
                state: "OK"
    - if:
        condition:
          for:
            time: 5s
            condition:
              binary_sensor.is_on: petoneer_nutri_feed_status
        then:
            - logger.log: "Alimentation, erreur"
            - text_sensor.template.publish:
                id: petoneer_nutri_status
                state: "Alimentation, erreur"
2 J'aime

Merci pour le partage.

Très intéressant.

Belle config ESPhome … avec automatisation, remontée d’alerte etc :slight_smile: … Manque plus les petits messages envoyés sur le tel :). Bon j’ai pas de chat :slight_smile: mais ca donne envie :slight_smile:

Slt,

Je fini les test. J ai reçu l appareil hier matin. Je vous posterais mon noeud rouge déjà fonctionnel mais que je souhaite faire évoluer.:wink:

Quite à parler de chat. Des expériences pour une chatière connecté? L’objectif premier étant de laisser passer uniquement les chats de la maison.
Je suis ouvert aux solutions du commerce et du DIY.

si tu as des enfants ca marche aussi !

1 J'aime

tag nfc RFID lol ca peut le faire :slight_smile: ou unes esp cam avec reconnaissance de visage MDR je dis ca je dis rien, je sors -> [ ]

Et pourquoi pas :

Avec l’intégration :

A voir sur la communauté si c’est bien la référence…

Et sinon le site directement :

1 J'aime

Voici mon automatisation sous Node Red, il faut créer un input boolean (input_boolean.petoneer_nutri_distribution_automatique)

Nourrir le chat à 10h00 chaque jour = Tous les jours à 10h00 je distribue 8 portions

Rappel distribution automatique si Off = Si le input boolean de la distribution auto est sur off alors pas de distribution. Ceci est un rappel journalier au cas ou vous avez oublié.

Nottification Cat Feeder = les notifications au cas ou il reste que 20% de croquettes, si le distributeur est vide ou si le bol est plein.

Erreur Cat Feeder passage automatique en off = Si le bol est plein je désactive la distribution automatique.

[{"id":"df6d8b98.f90fb8","type":"tab","label":"Chat","disabled":false,"info":""},{"id":"889d2cf1.d6a3d","type":"inject","z":"df6d8b98.f90fb8","name":"10h00","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 10 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":100,"wires":[["8dcf8c00.a9906"]]},{"id":"d50b2c87.04a4f","type":"api-call-service","z":"df6d8b98.f90fb8","name":"Press On Cat Feeder","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.petoneer_nutri_feed","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":760,"y":100,"wires":[[]]},{"id":"7fb86836.c96658","type":"looptimer","z":"df6d8b98.f90fb8","duration":"5","units":"Second","maxloops":"8","maxtimeout":"5","maxtimeoutunits":"Minute","name":"","x":540,"y":100,"wires":[["d50b2c87.04a4f"],[]]},{"id":"6abfb264.58732c","type":"comment","z":"df6d8b98.f90fb8","name":"Nourrir le chat à 10h00 chaque jour","info":"","x":160,"y":40,"wires":[]},{"id":"8dcf8c00.a9906","type":"api-current-state","z":"df6d8b98.f90fb8","name":"Distribution Auto On/Off ?","server":"a8c279c8.be8be8","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.petoneer_nutri_distribution_automatique","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":310,"y":100,"wires":[["7fb86836.c96658"],[]]},{"id":"417dae4b.e2761","type":"comment","z":"df6d8b98.f90fb8","name":"Nottification Cat Feeder","info":"","x":120,"y":320,"wires":[]},{"id":"36beebe3.b84984","type":"server-state-changed","z":"df6d8b98.f90fb8","name":"Status Cat Feeder","server":"a8c279c8.be8be8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.petoneer_nutri_status","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":110,"y":400,"wires":[["bbb53d39.cb6a8"]]},{"id":"bbb53d39.cb6a8","type":"switch","z":"df6d8b98.f90fb8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Niveau d'alimentation faible","vt":"str"},{"t":"eq","v":"Erreur de livraison d'alimentation","vt":"str"},{"t":"eq","v":"Alimentation, erreur","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":290,"y":400,"wires":[["257dfe83.181f82","959e4e09.eccc7"],["257dfe83.181f82","959e4e09.eccc7","565c4614.939e98"],["257dfe83.181f82","959e4e09.eccc7","565c4614.939e98"]]},{"id":"257dfe83.181f82","type":"api-call-service","z":"df6d8b98.f90fb8","name":"Notication Aurélien","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_aurelien","entityId":"","data":"{\"title\":\"Cat Feeder\",\"message\": \"{{ payload }}\" }","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":490,"y":360,"wires":[[]]},{"id":"959e4e09.eccc7","type":"api-call-service","z":"df6d8b98.f90fb8","name":"Notication Siham","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_siham","entityId":"","data":"{\"title\":\"Cat Feeder\",\"message\": \"{{ payload }}\" }","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":490,"y":440,"wires":[[]]},{"id":"9eae97ef.48f1f8","type":"comment","z":"df6d8b98.f90fb8","name":"Rappel distribution automatique si Off","info":"","x":170,"y":160,"wires":[]},{"id":"193fcf9a.ed126","type":"inject","z":"df6d8b98.f90fb8","name":"10h00","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 10 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":220,"wires":[["e5e48c6e.317dd"]]},{"id":"e5e48c6e.317dd","type":"api-current-state","z":"df6d8b98.f90fb8","name":"Distribution Auto On/Off ?","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.petoneer_nutri_distribution_automatique","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":310,"y":220,"wires":[["c4c6549c.a02018","82425ac6.c44838"],[]]},{"id":"c4c6549c.a02018","type":"api-call-service","z":"df6d8b98.f90fb8","name":"Notication Aurélien","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_aurelien","entityId":"","data":"{\"title\":\"Cat Feeder\",\"message\":\"Attention la distribution automatique est sur Off\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":550,"y":180,"wires":[[]]},{"id":"82425ac6.c44838","type":"api-call-service","z":"df6d8b98.f90fb8","name":"Notication Siham","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_siham","entityId":"","data":"{\"title\":\"Cat Feeder\",\"message\":\"Attention la distribution automatique est sur Off\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":550,"y":260,"wires":[[]]},{"id":"565c4614.939e98","type":"api-current-state","z":"df6d8b98.f90fb8","name":"Distribution Auto On/Off ?","server":"a8c279c8.be8be8","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.petoneer_nutri_distribution_automatique","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":510,"y":560,"wires":[["2a74bceb.f908a4"],[]]},{"id":"5bfe69f1.fffa58","type":"comment","z":"df6d8b98.f90fb8","name":"Erreur Cat Feeder passage automatique en off","info":"","x":190,"y":500,"wires":[]},{"id":"2a74bceb.f908a4","type":"api-call-service","z":"df6d8b98.f90fb8","name":"Distibution auto Off","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"input_boolean.petoneer_nutri_distribution_automatique","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":750,"y":560,"wires":[["84f3e60d.e1b308","3a9d9c34.028254"]]},{"id":"84f3e60d.e1b308","type":"api-call-service","z":"df6d8b98.f90fb8","name":"Notication Aurélien","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_aurelien","entityId":"","data":"{\"title\":\"Cat Feeder\",\"message\":\"Suite erreur, la distribution automatique passe sur Off\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":970,"y":520,"wires":[[]]},{"id":"3a9d9c34.028254","type":"api-call-service","z":"df6d8b98.f90fb8","name":"Notication Siham","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_siham","entityId":"","data":"{\"title\":\"Cat Feeder\",\"message\":\"Suite erreur, la distribution automatique passe sur Off\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":970,"y":600,"wires":[[]]},{"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}]

Merci pour le partage!
Encore un projet dans ma todo list :wink:

1 J'aime

Merci pour le partage.
Je me suis lancé sur un projet similaire, mais avec du matériel DIY (carton, tube de pringles, servomoteur MG90).
Côté automatisation, je suis parti comme toi, avec un ESP8266, piloté avec ESPHome.
J’ai arrêté le projet car j’ai eu des contraintes physique dues au fait que le distributeur était ton mon (gros) chien et que les croquettes était beaucoup plus grosses et lourdes que ceux des chats. Je n’arrivais pas à gérer avec précision le flux de croquettes versées.