RobertD502 / home-assistant-petkit

Home Assistant integration for PetKit devices
MIT License
156 stars 24 forks source link

[Feature request] PRESS Button for Feeders #41

Closed Devstored closed 9 months ago

Devstored commented 9 months ago

Hi @RobertD502
Your integration works perfectly and I thank you for all the work provided. I have the “Fresh Element Mini Pro” kibble dispenser.

I use Home Assistant to make up for the lack of integration of my Homey box (https://homey.app/). Everything works, however one thing is preventing me from using the Fresh Element Mini Pro integration. One feature that is not supported is the custom drop-down list: CleanShot 2023-09-24 at 09 48 28

Is there a way to use a button or switch to dispense a fixed quantity of kibble? Indeed, custom drop-down lists are not supported by my Homey plugin (https://homey.app/fr-fr/app/io.home-assistant.community/Home-Assistant-Community/).

If you have a workaround or if you could add a "Press" button that would be really great and would perfectly complete my integration.

I thank you in advance !

RobertD502 commented 9 months ago

Hi, a single button entity won't be created for feeders since not every user has the same preference - the select entity was created so users can know exactly what amounts are considered valid by PetKit as well as not being bound to a single feeding amount per entity.

If you have a certain amount that you manually feed all the time, look into creating a custom template button in Home Assistant. A custom template button can be created which, when pressed, calls the select.select_option service on the manual feeding select entity with your desired feeding amount.

Home Assistant template documentation

RobertD502 commented 9 months ago

Example template button:

template:
  - button:
    - name: "Dispense cat food"
      press:
        service: select.select_option
        data:
          option: 1/20th Cup (5g)
        target:
          entity_id: select.left_feeder_manual_feed

Replace name with the name you want to give the button, option with the amount you want to dispense when the button is pressed, and the entity_id with the entity_id of your feeder's manual feed entity.