benleb / sureha

SureHA 🐾 monitor & control your Sure Petcare devices via Home Assistant
Apache License 2.0
21 stars 12 forks source link

Feeders no longer report values #52

Open robertgetch opened 10 months ago

robertgetch commented 10 months ago

After the recent break due to Sure Petcare's API changes I no longer receive the values for remaining pet food in the two SurePet Feeders I have; the two feeders both report "unknown" and do not update. The SurePet app is correctly updating the values indicating that the feeders are still communicating and the hub is reporting to the cloud.

I have removed the integration, restarted the Sure Pet Hub, restarted the feeders and reinstalled the integration after rebooting HA. I am using the latest HA version which has resolved the issues with the Cat Flap and allowing me to lock/unlock the Cat Flap again and that all seems to work correctly (thank you!).

I cannot find anything in the logs (including after enabling debug logging and downloading the corresponding log file) that seems to indicate that its failing somewhere, it just seems like the updates are either no longer being provided. When the integration first loads it does pull a variety of attributes for the feeder that are correct, everything except the remaining food amount. After that point though it never updates again, and the remaining food value is never pulled.

Please let me know how I can assist in correcting this integration bug! Happy to help as I can.

blair287 commented 10 months ago

Same issue my felaqua is working though but nothing for feeders. @benleb was something maybe missed with the json thing or does sureha need updating too?

blair287 commented 10 months ago

Now the integration is broken completely again can sign in the but fails to initialize and finds no devices

blair287 commented 10 months ago

After the recent break due to Sure Petcare's API changes I no longer receive the values for remaining pet food in the two SurePet Feeders I have; the two feeders both report "unknown" and do not update. The SurePet app is correctly updating the values indicating that the feeders are still communicating and the hub is reporting to the cloud.

I have removed the integration, restarted the Sure Pet Hub, restarted the feeders and reinstalled the integration after rebooting HA. I am using the latest HA version which has resolved the issues with the Cat Flap and allowing me to lock/unlock the Cat Flap again and that all seems to work correctly (thank you!).

I cannot find anything in the logs (including after enabling debug logging and downloading the corresponding log file) that seems to indicate that its failing somewhere, it just seems like the updates are either no longer being provided. When the integration first loads it does pull a variety of attributes for the feeder that are correct, everything except the remaining food amount. After that point though it never updates again, and the remaining food value is never pulled.

Please let me know how I can assist in correcting this integration bug! Happy to help as I can.

Any of your stuff start working? Mine still all unknown :(

robertgetch commented 10 months ago

The locations continue to work but the feeders continue to be unknown.

chrisannen commented 10 months ago

@blair287

Now the integration is broken completely again can sign in the but fails to initialize and finds no devices

Which version of HA are you using? I'm using 2023.12.4 and haven't noticed any problems. In addition to the hub, I have 2 flaps in use and 2 pets involved. Are you using version 2024.1.x? Or are you only having problems with the feeders?

robertgetch commented 10 months ago

The problem only exists with the Feeders and apparently the Feliaqua.

chrisannen commented 10 months ago

Das Problem besteht nur bei den Feedern und offenbar auch bei der Feliaqua.

Ahh, OK, thanks. That's why i don't notice any problems.

jafrouk commented 10 months ago

I recnetly installed the integration on a fresh install of Home Assistant, and one of the things I remember being there before that isn't there now is the level of the food in the bowls ( I was also trying to follow https://github.com/home-assistant/core/issues/93003#issuecomment-1633351764 that @magicmega posted, and don't see the _bowl_0 and _bowl_1 entities I was expecting either).

Is this related?

blair287 commented 10 months ago

My felaqua suddenly started working but feeders are still unknown.

DarkPhyber-hg commented 10 months ago

I am having the same issue with the feeders.

blair287 commented 10 months ago

@benleb any ideas on what's broken tje feeders?

blair287 commented 9 months ago

Wish I knew how to code for this :( so could create a pull request or fork it not sure this will get fixed anytime soon sorry guys.

magicmega commented 9 months ago

All working for me now; I have put in a workaround that joins the data where it shows up as unknown (uses last known value). I can find and post it if others want it

MechEng70 commented 9 months ago

Please post it. TIA

blair287 commented 9 months ago

All working for me now; I have put in a workaround that joins the data where it shows up as unknown (uses last known value). I can find and post it if others want itSent from my iPhoneOn 27 Jan 2024, at 2:10 pm, blair287 @.> wrote: Wish I knew how to code for this :( so could create a pull request or fork it not sure this will get fixed anytime soon sorry guys. —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.>

Yes please post

magicmega commented 9 months ago

Coping with the feeder state going to unknown at random times:

I've set up a proxy variable (var) for each bowl state, that only updates when there is a real value in the actual bowl state (i.e. skips changes to 'unknown'.

I have two feeders for two cats, each with two bowls (1 dry, 1 wet) in the feeder. I've set up the following for each bowl (i.e. 4x the below code)

- id: '[yours here]'
  alias: Luna dry food update
  description: ''
  trigger:
  - platform: state
    entity_id:
    - sensor.feeder_lunas_bowl_bowl_0
  condition:
  - condition: template
    value_template: '{{ trigger.from_state.state not in [''unknown'', ''unavailable'']
      }}'
  - condition: template
    value_template: '{{ trigger.to_state.state not in [''unknown'', ''unavailable'']
      }}'
  - condition: template
    value_template: '{{ trigger.from_state.state != trigger.to_state.state}}'
  action:
  - service: var.update
    data:
      entity_id: var.luna_dry_bowl_sans_unknown
  mode: single

The variables are set up as follows

(in var: file)

luna_dry_bowl_sans_unknown:
  friendly_name: 'Luna dry food bowl weight (cope with unknowns)'
  initial_value: 0
  unique_id: 'lunadryfoodsansunknown'
  value_template: "{{states('sensor.feeder_lunas_bowl_bowl_0')}}"
  icon: mdi:cat
  unit_of_measurement: g
magicmega commented 9 months ago

I recnetly installed the integration on a fresh install of Home Assistant, and one of the things I remember being there before that isn't there now is the level of the food in the bowls ( I was also trying to follow home-assistant/core#93003 (comment) that @magicmega posted, and don't see the _bowl_0 and _bowl_1 entities I was expecting either).

Is this related?

Are you using the SureHA custom integration (needs to be installed through HACS) or the Sure Petcare one?

magicmega commented 9 months ago

I recnetly installed the integration on a fresh install of Home Assistant, and one of the things I remember being there before that isn't there now is the level of the food in the bowls ( I was also trying to follow home-assistant/core#93003 (comment) that @magicmega posted, and don't see the _bowl_0 and _bowl_1 entities I was expecting either). Is this related?

Are you using the SureHA custom integration (needs to be installed through HACS) or the Sure Petcare one?

omg I didn't realise this hasn't been working for me for some time either! Will investigate

magicmega commented 9 months ago

@benleb it looks to me that the report/household/[id] GET call no longer works on its own for the API - report/household/[id]/pet/[id] does though. Any ideas?

MechEng70 commented 9 months ago

Not sure if this helps but I am using this to get the dry food weight.

{{ state_attr('binary_sensor.pet_ezra','status')['feeding']['change'][0] | abs }}

blair287 commented 9 months ago

@benleb are you around?

badnetmask commented 8 months ago

sureha depends on surepy, so this is related: https://github.com/benleb/surepy/issues/208

blair287 commented 8 months ago

Guessing dev is not maintaining this anymore think it's going to be up to us to fork it and try to fix the issues anyone got any idea where to start to get the feeders working again?

mtg138 commented 1 month ago

Recently added 2 Surefeeds into my HA and have the unknown value from the get go. has anyone worked out a way to get it working? happy to be a tester :)

magicmega commented 3 weeks ago

I emailed surepet last week. Here is their disappointing response

——-

Hi,

We never offered an open API, and all external integration has been done by 3rd parties, which caused issues.

Should we decide to offer integrations in the future, then this will be communicated via our community and website.

Replying to

Will Surepet be reopening its API to users e.g. how previously users were able to connect their feeders with HomeAssistant to allow advanced monitoring of pet activity? I previously was able to monitor exact calorie intake for my cats by this method.