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

Add support for Felaqua-Connect #20

Open
blair287 opened this issue Apr 8, 2021 · 32 comments
Open

Add support for Felaqua-Connect #20

blair287 opened this issue Apr 8, 2021 · 32 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@blair287
Copy link

blair287 commented Apr 8, 2021

New product from sure pet care any chance could add to this integration please.

Probably only need battery and water remaining would probably be all info would need.

https://www.surepetcare.com/en-gb/felaqua-connect

@benleb benleb added enhancement New feature or request question Further information is requested labels Apr 8, 2021
@benleb
Copy link
Owner

benleb commented Apr 9, 2021

I currently do not know anyone who still got one and can supply the required API calls/parameters needed to implement here :/

do you own one? :D

@blair287
Copy link
Author

blair287 commented Apr 9, 2021

I currently do not know anyone who still got one and can supply the required API calls/parameters needed to implement here :/

do you own one? :D

Not yet but was thinking of getting one so it would be possible with the correct info?

I'll buy one if it will get us the required info.

@blair287
Copy link
Author

blair287 commented Apr 9, 2021

I currently do not know anyone who still got one and can supply the required API calls/parameters needed to implement here :/

do you own one? :D

I've ordered one will be here in next 5 days hopefully.

I can give you access to my account if it would help :) also happy to buy you some beers/coffees etc.

Thanks

@blair287
Copy link
Author

blair287 commented Apr 10, 2021

I currently do not know anyone who still got one and can supply the required API calls/parameters needed to implement here :/

do you own one? :D

It's turned up already let me know what you need and how many beers you'd like to get it going :) thanks

@blair287
Copy link
Author

blair287 commented Apr 10, 2021

I currently do not know anyone who still got one and can supply the required API calls/parameters needed to implement here :/

do you own one? :D

adding it as a feeder currently already gets battery life at least and i think i found a way to get water remaining it seems to show current weight mine is showing 971 at the moment and it says its can hold 1 litre so we can work out a percentage and also maybe have a ml remaining sensor too?

let me know i can give you access to my account if it will help at all? Chucked a sponsorship your way too.

@benleb
Copy link
Owner

benleb commented Apr 10, 2021

Thank you very much!

If you can create a read-only account which I can use over the weekend, I will look what I can achieve :)
(via mail to git]at[benleb.de or msg in the home assistant community forum...? if you know something cooler, also good :D)

@blair287
Copy link
Author

blair287 commented Apr 10, 2021

Thank you very much!

If you can create a read-only account which I can use over the weekend, I will look what I can achieve :)
(via mail to git]at[benleb.de or msg in the home assistant community forum...? if you know something cooler, also good :D)

I invited you to the account with that email address think I did it right let me know if you got it cheers. 👍

@benleb
Copy link
Owner

benleb commented Apr 11, 2021

Thanks! I am working on it :)

image

@blair287
Copy link
Author

blair287 commented Apr 11, 2021

Thanks! I am working on it :)

image

Great 😁 will you be able to get sensors for food remaining when in 2 or 1 bowl mode for the feeders dunno if it already does this.

And have you managed to find water remaining for the felaqua? I found something I think showing felaqua weight left when poking around in developer mode in chrome dunno if it's useful.

@benleb
Copy link
Owner

benleb commented Apr 11, 2021

      {
        "id": xxxxxx,
        "parent_device_id": yyyyy,
        "product_id": 8,
        "household_id": 47....,
        "name": "Water Bowl",
        "serial_number": "P001-00.....",
        "mac_address": "7416.....",
        "index": 1,
        "version": "Nw==",
        "created_at": "2020-12-22T13:40:45+00:00",
        "updated_at": "2021-04-11T09:51:53+00:00",
        "pairing_at": "2021-04-10T09:17:24+00:00",
        "control": {
          "fast_polling": false,
          "learn_mode": 1,
          "tare": 0
        },
        "parent": {
          "id": 248xxxx
          "product_id": 1,
          "household_id": 4xxxx,
          "name": "Hub",
          "serial_number": "H008-02xxx",
          "mac_address": "00005410xxxx",
          "version": "MTA1MQ==",
          "created_at": "2019-03-14T14:08:18+00:00",
          "updated_at": "2021-04-09T00:44:25+00:00"
        },
        "status": {
          "version": {
            "device": {
              "hardware": 1,
              "firmware": 213
            }
          },
          "battery": 6.421,
          "learn_mode": null,
          "online": true,
          "signal": {
            "device_rssi": -82.6,
            "hub_rssi": -58.2
          }
        },
        "tags": [
          {
            "id": 585.....,
            "index": 1,
            "profile": 2,
            "version": "MA==",
            "created_at": "2021-04-10T09:18:16+00:00",
            "updated_at": "2021-04-10T09:18:16+00:00"
          },
          {
            "id": 84....,
            "index": 0,
            "profile": 2,
            "version": "MQ==",
            "created_at": "2021-04-10T09:17:47+00:00",
            "updated_at": "2021-04-10T09:18:02+00:00"
          },
          {
            "id": 26...,
            "index": 2,
            "profile": 2,
            "version": "MA==",
            "created_at": "2021-04-10T15:54:02+00:00",
            "updated_at": "2021-04-10T15:54:02+00:00"
          }
        ]
      }

seems this is the only device-specific data I can get. I think it's due to my restricted access as I cannot access the "device" page. Maybe you want to try it yourself? Did you ever use the google chrome/firefox developer tools? or curl? :D

@blair287
Copy link
Author

blair287 commented Apr 11, 2021

      {
        "id": xxxxxx,
        "parent_device_id": yyyyy,
        "product_id": 8,
        "household_id": 47....,
        "name": "Water Bowl",
        "serial_number": "P001-00.....",
        "mac_address": "7416.....",
        "index": 1,
        "version": "Nw==",
        "created_at": "2020-12-22T13:40:45+00:00",
        "updated_at": "2021-04-11T09:51:53+00:00",
        "pairing_at": "2021-04-10T09:17:24+00:00",
        "control": {
          "fast_polling": false,
          "learn_mode": 1,
          "tare": 0
        },
        "parent": {
          "id": 248xxxx
          "product_id": 1,
          "household_id": 4xxxx,
          "name": "Hub",
          "serial_number": "H008-02xxx",
          "mac_address": "00005410xxxx",
          "version": "MTA1MQ==",
          "created_at": "2019-03-14T14:08:18+00:00",
          "updated_at": "2021-04-09T00:44:25+00:00"
        },
        "status": {
          "version": {
            "device": {
              "hardware": 1,
              "firmware": 213
            }
          },
          "battery": 6.421,
          "learn_mode": null,
          "online": true,
          "signal": {
            "device_rssi": -82.6,
            "hub_rssi": -58.2
          }
        },
        "tags": [
          {
            "id": 585.....,
            "index": 1,
            "profile": 2,
            "version": "MA==",
            "created_at": "2021-04-10T09:18:16+00:00",
            "updated_at": "2021-04-10T09:18:16+00:00"
          },
          {
            "id": 84....,
            "index": 0,
            "profile": 2,
            "version": "MQ==",
            "created_at": "2021-04-10T09:17:47+00:00",
            "updated_at": "2021-04-10T09:18:02+00:00"
          },
          {
            "id": 26...,
            "index": 2,
            "profile": 2,
            "version": "MA==",
            "created_at": "2021-04-10T15:54:02+00:00",
            "updated_at": "2021-04-10T15:54:02+00:00"
          }
        ]
      }

seems this is the only device-specific data I can get. I think it's due to my restricted access as I cannot access the "device" page. Maybe you want to try it yourself? Did you ever use the google chrome/firefox developer tools? or curl? :D

Which page are you trying to access if its the start then devices i cant see current weight either there is a page 47***?page=1&page_size=1 but it seems to only show weight for last notification maybe :(

I was really hoping to be able to see water remaining in the bowl inside HA to be able to make my own notifications. how come their API doesnt show remaining amounts for food or water?

@blair287
Copy link
Author

blair287 commented Apr 11, 2021

4: {id: 10******, type: 29, data: "null", created_at: "2021-04-11T16:26:02+00:00",…}
created_at: "2021-04-11T16:26:02+00:00"
data: "null"
devices: [{id: 73****, parent_device_id: 24****, product_id: 8, household_id: 47***, name: "Water Bowl",…}]
id: 10********
pets: [{id: 20****, name: "Tilly Tilly", gender: 0, weight: "3.5", comments: "", household_id: 47***,…}]
tags: [{id: 267, tag: "95.", version: "MQ==", created_at: "2021-04-10T09:27:58+00:00",…}]
type: 29
updated_at: "2021-04-11T16:26:03+00:00"
weights: [{id: 10
, device_id: 73
**, tag_id: 26*****, duration: 73, context: 1,…}]
0: {id: 10*******, device_id: 73*****, tag_id: 26*****, duration: 73, context: 1,…}
context: 1
created_at: "2021-04-11T16:26:02+00:00"
device_id: 73****
duration: 73
frames: [{id: 211114667, index: 0, current_weight: 611.63, change: -18.59,…}]
id: 10*******
tag_id: 26****
updated_at: "2021-04-11T16:26:02+00:00"

This info seems to show current weight but i think this shows recent notification info would it be possible to look in here and pull the most recent weight remaining for each device?

Or send the current weight for each device ID to home assistant so if you had 3 devices each time a new notification which most recent seems to be 0 it will send current weight. Bit like a ZigBee temp sensor updating? If that makes any sense.

it also shows if half or full bowl is present in food bowls too. https://app.api.surehub.io/api/timeline/household/47***

have you got discord?

@benleb
Copy link
Owner

benleb commented Apr 11, 2021

ah perfect! thanks! Need a little sleep now, will have a closer look tomorrow 😅
and yes, I am around in the AppDaemon discord "server" sometimes but also in the HA one.

@blair287
Copy link
Author

ah perfect! thanks! Need a little sleep now, will have a closer look tomorrow 😅
and yes, I am around in the AppDaemon discord "server" sometimes but also in the HA one.

Let me know if you can't see the above info I can try setting your account to control mode maybe 👍

@blair287
Copy link
Author

ah perfect! thanks! Need a little sleep now, will have a closer look tomorrow 😅
and yes, I am around in the AppDaemon discord "server" sometimes but also in the HA one.

Any luck with getting remaining weight info?

@plambrechtsen
Copy link

Hey @blair287 I would love to add support for the felaqua into https://github.com/plambrechtsen/pethublocal as they don't sell them in NZ. Ideally if you had a CC2531 you could trace the traffic when it is connected to the cloud service and I can decrypt that and see what command messages get sent, or spin up my local docker stack and then just capture the status messages.

@benleb
Copy link
Owner

benleb commented Apr 24, 2021

ah perfect! thanks! Need a little sleep now, will have a closer look tomorrow 😅
and yes, I am around in the AppDaemon discord "server" sometimes but also in the HA one.

Any luck with getting remaining weight info?

I think yes ;) planned to implement for this weekend! 👍

@blair287
Copy link
Author

ah perfect! thanks! Need a little sleep now, will have a closer look tomorrow 😅
and yes, I am around in the AppDaemon discord "server" sometimes but also in the HA one.

Any luck with getting remaining weight info?

I think yes ;) planned to implement for this weekend! 👍

That would be awesome 😁 excited to try it out.

The surepet care notifications are super unreliable so only way I'd keep the bowl is if HA can get weight remaining and use it for notifications.

Are you just exposing weight remaining or converting it to ml remaining? Would be 1:1 conversation just need to change units.

@blair287
Copy link
Author

Hey @blair287 I would love to add support for the felaqua into https://github.com/plambrechtsen/pethublocal as they don't sell them in NZ. Ideally if you had a CC2531 you could trace the traffic when it is connected to the cloud service and I can decrypt that and see what command messages get sent, or spin up my local docker stack and then just capture the status messages.

I don't down a cc2531 unfortunately.

I also have no idea about docker outside of HA add-ons got any documentation?

@plambrechtsen
Copy link

I don't down a cc2531 unfortunately.

I also have no idea about docker outside of HA add-ons got any documentation?

It's pretty straightforward if you read the readme in the docker folder.

https://github.com/plambrechtsen/pethublocal/tree/main/docker

The main thing is how much control you have over your internal DNS since if you are using an ISP supplied basic router you probably can't change what DNS is returned. But if you have a more advanced router you should be able to add local dns entries.

Then it's a case of modifying the config.ini for your settings to point to the main MQTT instance and as long as your docker host has 443 and 8883 free then as long as you installed docker-compose which is included with docker then you can use "docker-compose up" and it should work.

The readme covers the steps required, feel free to email me as my address is in the docker/source/pethubpacket.py and various other places.

@plambrechtsen
Copy link

plambrechtsen commented Apr 25, 2021

This morning I was emailed a Zigbee sniff of the Felaqua connecting to the hub and sending the weight. Seems like it has no real configuration options and just sends the total unit weight using some spring loaded feet underneath and is extremely similar to the feeder. So I hope to have support once I get a second trace with a few more things. So should get that in the next few days.
It's quite annoying that you don't get the current weight in the start message even though the weight seems to be sent every time.

@plambrechtsen
Copy link

Added support in pethublocal for the Felaqua too. https://github.com/plambrechtsen/pethublocal/blob/main/docker/source/pethubpacket.py#L388
The messages are very similar to the Feeder but a data type of 1B, but all the other message types such as tag provisioning and status are the same as the Feeder and Cat Flap.
{ "OP": "Drink", "Action": "01", "Time": "48", "WeightFrom": "330.89", "WeightTo": "316.89", "Animal": "xxx", }

@blair287
Copy link
Author

Any chance this could be in next HA update at all?

@benleb
Copy link
Owner

benleb commented Apr 29, 2021

can you confirm that this is the current state of your felaqua? 😅
image

From my experience, I don't think it will make it in 2021.5.0 :/ But I plan to provide an own repo (which you can use by placing it into your custom_components) with this integration as I also do not like to wait on the HA release cycle to serve updates for it :)

@plambrechtsen
Copy link

I think that is the upper level as it is a single set of scales similar to the feeder and hits that number when it gets picked up.
Can send you through some of the messages from the trace.

'DrinkFrom': '-1093.43', 'DrinkTo': '-1095.06'

That happens when it gets picked up and refilled.

@richardshaylor
Copy link

Great work :) I've got one on the way and can't wait to start playing with it.

@benleb
Copy link
Owner

benleb commented Apr 29, 2021

hm peter you mean one of the values (remaining/change) is the max. and one the current one?

-- obsolete comment part removed, see below 😄👍 --

@benleb benleb self-assigned this Apr 29, 2021
@benleb
Copy link
Owner

benleb commented Apr 29, 2021

ah wait, I got it! ignore the last comment, not needed anymore 😅

update tomorrow! good night 💤

@benleb
Copy link
Owner

benleb commented Apr 30, 2021

These are the latest data points regarding "drinking" from the cats of @blair287 - so I suspect the following:

Felaqua has 484.5ml water left (value from middle cat, the last one that had a drink according to the datetime)
When they drunk last, the middle cat drunk 11.33ml, the first one 28.51ml and the last one 25.91ml

Do you agree? Can someone confirm this? :D

image

@plambrechtsen
Copy link

This sounds exactly like the feeder. Probably because the messages I have seen from the pcaps were exactly like the feeder. So taking the last time stamp will show the current weight. But I also assume that a number higher than 0 is where it runs out of water.

@blair287
Copy link
Author

blair287 commented Apr 30, 2021

These are the latest data points regarding "drinking" from the cats of @blair287 - so I suspect the following:

Felaqua has 484.5ml water left (value from middle cat, the last one that had a drink according to the datetime)
When they drunk last, the middle cat drunk 11.33ml, the first one 28.51ml and the last one 25.91ml

Do you agree? Can someone confirm this? :D

image

Think this is correct from what I can see great work.

Is it possible to install this as a custom component now at all to test for you?

Is actual weight the weight now? As it's the same on all three but matches the most recent one in your screenshot.

@blair287
Copy link
Author

blair287 commented May 5, 2021

@benleb is it possible to install as custom component to test it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants