Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Change grain amount for manual Feed #33

Closed
1 task done
AlexMohanMD opened this issue Nov 21, 2024 · 23 comments · Fixed by #63
Closed
1 task done

[Feature Request]: Change grain amount for manual Feed #33

AlexMohanMD opened this issue Nov 21, 2024 · 23 comments · Fixed by #63
Assignees
Labels
Completed Completed tasks Enhancement New feature or request

Comments

@AlexMohanMD
Copy link

Device model name

Air Wifi

Device model number

PLAF108

Device type

Feeder

Feature name

Allow customising the grainNum variable for manual feeding

Describe the feature

I have very large grains for their feeding as they need to be on a dental diet. As such, in the app I have to set it to 8/24 per serving. This means that if I was automating via Home Assistant, I would need to send 16 requests to my two feeders, something I have reliability quetions about. A number entry field that is referenced on the manual feed call would help this.

In api.py - the variable I would like to be able to change from HA is:

"grainNum": 1, # Number of grains dispensed

What problem does this feature solve?

Allow varying serving size in 1 call of manual feed.

Available to help with the feature development

  • I agree to help with testing or providing relevant information for this feature request
@jjjonesjr33 jjjonesjr33 added the Enhancement New feature or request label Nov 21, 2024
@github-project-automation github-project-automation bot moved this to To triage in Petlibro Nov 21, 2024
@Nistp
Copy link
Contributor

Nistp commented Nov 23, 2024

@jjjonesjr33 I'll be happy to poke at this.

@Nistp
Copy link
Contributor

Nistp commented Dec 2, 2024

@jjjonesjr33 I have been looking into this over the weekend and I don't think there is an easy way to combine entities, but I think there is a way to make a number entity for the "grainNum" and then combine the button and the number in a UI card for the user. Do you think that's a reasonable approach or would you give me a tip in a different direction?

@rhenschen
Copy link

rhenschen commented Dec 19, 2024

has anyone been able to find a way to modify this? right now I have both an rfid and a vibration sensor that triggers this. I have the automation that triggers this just push the button 4 times every 15 seconds and then it has a 1 min cool down to where if the dog is still digging at it or standing very close that it auto triggers it till the leave the feeing zone of stop digging at the bowl.

@Nistp
Copy link
Contributor

Nistp commented Dec 20, 2024

@rhenschen I'm planning on taking a look at this over the next two weeks. Past few weeks have been very busy for me due to work and finishing things up for the year :)

@jjjonesjr33
Copy link
Owner

Sorry I've been in the same boat @rhenschen as @Nistp. Busy with the holidays and everything lately thats been going on since Nov. @Nistp if you can take a look first and let me know if you need anything. I'll be a bit more focused after the New Year to take a deeper dive into the issue.

@jjjonesjr33 jjjonesjr33 added the Pending Pending label Dec 21, 2024
@jjjonesjr33 jjjonesjr33 moved this from To triage to Pending in Petlibro Dec 21, 2024
@MarlinFF
Copy link

Would love this feature as well for my PLAF103. Thank you guys for all your hard work!

@rhenschen
Copy link

any updates on this?

@Nistp
Copy link
Contributor

Nistp commented Jan 7, 2025

@rhenschen I didn't get as much time to work on this as I've wanted to due to some family issues over the holidays, but I am actively poking at it.

@jjjonesjr33 jjjonesjr33 added In progress In progress and removed Pending Pending labels Jan 7, 2025
@jjjonesjr33 jjjonesjr33 moved this from Pending to In progress in Petlibro Jan 7, 2025
@jjjonesjr33
Copy link
Owner

Random thought .... @Nistp,

I was looking at what you’ve got going on in your fork for this issue, and it got me thinking. Instead of removing the button completely, what if we just change it to say "Snack/Treats"? That way, it could always default to the lowest amount for the cats. Legit treat it like a give treats button. Then we could add the "manual_feed" option you’re working on for manual control in the number.py. What do you think about that?

@Nistp
Copy link
Contributor

Nistp commented Jan 8, 2025

@jjjonesjr33 that would be fair. My end goal was to imitate the Petlibro app where you can decide how much to dispense either as planned or per push. Those commits are a bit old, I've ended up putting the button back in regardless because, even though likely do my implementation, changing the number as a slider didn't work and do you really want to dispense when you're just changing the amount to say, 2/24 cups?

The one issue I'm struggling with, and I probably just need to dive deeper into the API docs, is to be able to pass a "grainNum" value into the set_maunal_feed function. I've declared a "manual_feed_quantity" property and a setter for air feeders and attempted to imitate the sound level implementation for the RFID feeder, but sound level is an actual property of the RFID feeder device, while my feed quantity is not. I've tried declaring is statically as we've done with the conversion factor, but that also isn't working at the moment.

@jjjonesjr33
Copy link
Owner

@Nistp

@jjjonesjr33 that would be fair. My end goal was to imitate the Petlibro app where you can decide how much to dispense either as planned or per push. Those commits are a bit old, I've ended up putting the button back in regardless because, even though likely do my implementation, changing the number as a slider didn't work and do you really want to dispense when you're just changing the amount to say, 2/24 cups?

  • "dispense when you're just changing the amount to say, 2/24 cups" - this would be a no as to "just changing the slider" and it dispenses each time you do that.

I'm not sure what I was thinking the other night, maybe I it was a combo-button-slider thingy that I was running with ... 😆 but yeah now, that totally doesn't make any sense ...

  • leaving the button as a manual feed works for me still.

The one issue I'm struggling with, and I probably just need to dive deeper into the API docs, is to be able to pass a "grainNum" value into the set_maunal_feed function. I've declared a "manual_feed_quantity" property and a setter for air feeders and attempted to imitate the sound level implementation for the RFID feeder, but sound level is an actual property of the RFID feeder device, while my feed quantity is not. I've tried declaring is statically as we've done with the conversion factor, but that also isn't working at the moment.

Just throwing this out there, cause I am not sure about using a slider since that would be a % based slider on how much it dispenses. I don't think the API would allow for that without a precise setting that's already listed as an option in its API.

What about something like this? I've seen the Litter-Robot sensors for its feeder implementation that we might be able to pull from Litter Robot to help with this.

image

@Nistp
Copy link
Contributor

Nistp commented Jan 9, 2025

I'm not sure what I was thinking the other night, maybe I it was a combo-button-slider thingy that I was running with ... 😆 but yeah now, that totally doesn't make any sense ...

That is what Petlibro app does though! A combo-button-slider thingy describes it pretty accurately :D

Just throwing this out there, cause I am not sure about using a slider since that would be a % based slider on how much it dispenses. I don't think the API would allow for that without a precise setting that's already listed as an option in its API.

Oh, with the number I was going to do it as an integer based slider, since the "grainNum" parameter that's passed in the web request seems to me an integer as well! The unit is assumed to be "1/24 cup".

I'll take a look at that Litter Robot implementation on the weekend, thanks for sharing, it seems to be a good reference!

@Nistp
Copy link
Contributor

Nistp commented Jan 13, 2025

@jjjonesjr33 I got some good news - seems I was able to dispense an amount of food that I have set and that's different from the default value (1/24 cups). I'll just have to flesh out the code a bit, but feel free to check out my latest commit.

@jjjonesjr33
Copy link
Owner

Awesome @Nistp !

@rhenschen
Copy link

Thanks for all the hard work. Let me know if this is close?

@Nistp
Copy link
Contributor

Nistp commented Jan 17, 2025

@rhenschen I'm hoping to put out a pull request to start integrating what I've got over the weekend. Definitely getting close. Thanks for your patience!

@Nistp
Copy link
Contributor

Nistp commented Jan 20, 2025

@rhenschen @jjjonesjr33 I'd also like to update to the latest HAOS and test my changes one more time; otherwise, I've cleaned up the code a bit and I'll work on submitting the PR tomorrow.

@jjjonesjr33
Copy link
Owner

Sounds like a plan @Nistp

Hey also before I forget, check out discussions #56 if you have any links you want me to add for you just let me know 😄

@rhenschen
Copy link

rhenschen commented Jan 25, 2025

Still confused is this patched if so I cant see the option to change the amount? If it isn’t any updates on when this will be released?

@jjjonesjr33
Copy link
Owner

@rhenschen I've been seeing if I can apply this to all the feeders so we can do a release for it and not just this device.

@jjjonesjr33
Copy link
Owner

@AlexMohanMD and @rhenschen

I've got all the devices loaded in after @Nistp did the pull and updated their code to fix the "unknown bug" when the slider loads. Should be good to go after some testing. I've sent a message to @Nistp to have them load it on their side and give it a run.

Image

By default it sets it to 1 as its listed as None on first load in Home Assistant. This would have to be one of those to where you set the dispense rate each time Home Assistant starts (an automation could do this for you-just give it a delay of 5-10mins so it can do a fresh pull from the api). As to what I can tell for now there's not a proper way to store the value to save it upon reboot. That might be a @C4-Dimitri question if he can answer it.

@jjjonesjr33 jjjonesjr33 added In review Pending review and removed In progress In progress labels Jan 25, 2025
@jjjonesjr33 jjjonesjr33 moved this from In progress to In review in Petlibro Jan 25, 2025
@C4-Dimitri
Copy link
Contributor

I can try and look into how we can store the state from last session.

This is also a good opportunity to give someone a gentle nudge to have the integration work for different measurement units. We could potentially just do it ourselves in HA rather than pulling the uom from petlibro? Could be a selector entity to select the uom maybe? Not sure how that works with HA entities as they probably arent very friendly to have their uom change dynamically.

@Nistp
Copy link
Contributor

Nistp commented Jan 27, 2025

@jjjonesjr33 @C4-Dimitri I'd be interested in poking the different units feature - I'm definitely interested in tracking the dispensed amounts in different units and then maybe adding a manual conversion factor for the calories, based on the food.

@github-project-automation github-project-automation bot moved this from In review to Done in Petlibro Jan 27, 2025
@jjjonesjr33 jjjonesjr33 added Completed Completed tasks and removed In review Pending review labels Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Completed Completed tasks Enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants