Catlink scooper smart litter box

Hi there

I try to automatize as much as possible in my home and recently discovered a nice self-cleaning litter box from Catlink https://www.catlinkus.com/ I wondered if there is an integration and just found this one GitHub - hasscc/catlink: šŸˆļø Catlink scooper component for HomeAssistant

It hasnt been updated since a year and I wonder if it still working. Is anybody using a Catlink scooper and can confirm the integration is still working? I would like to buy if I can integrate it via HA.

I wonder if it would also be possible to control the scooper via Xiaomi-Miot (GitHub - al-one/hass-xiaomi-miot: Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. 小ē±³ē±³å®¶ę™ŗčƒ½å®¶å±…č®¾å¤‡ęŽ„å…„Hass集ꈐ) It seems that the Catlink is a sub-brand from Xiaomi.

all the best

Andrew

moved from Hardware to config as it my question is more related to the software-part rather than the hardware.

Itā€™s working at my place.
I installed and got it working via HACS.

Iā€™ll post the configuration.yaml and a screenshot.

catlink:
  # Single account
  phone:     32843028439020943243243 # Username of Catlink APP
  password:  AAAAAAAAAAAA # Password
  phone_iac: 81   # Optional, International access code, default is 86 (China)
  api_base:  https://app-sgp.catlinks.cn/api/     # Optional, default is China server: https://app.catlinks.cn/api/
  scan_interval: 00:05:00 # Optional, default is 00:01:00
  language: ja_JP

1 Like

thats great, many thanks for the information

I decided to use this because I sometimes forget to set it to auto mode when I clean, so if I havenā€™t switched it for an hour, I switch it back on. The other reason I use it is to automatically disengage from the anti-snag function when it is enabled, or from the weight detection protection when it is enabled.

The method is not listed anywhere, but I was able to find it by looking through the source code of this extension.

There is a ā€œCatLink: request_apiā€ in the service call of the development tool, and you first get the deviceID with this. Specifically, do the following

service: catlink.request_api
target:
  entity_id: sensor.scooper_XXXXX_state # Any sensor entity in the account
data:
  api: /token/device/union/list/sorted
  params:
    'type': 'NONE'
  method: GET
  throw: true

If successful, a json will be returned in the notification, and the id part of devices will be ā€œdeviceIDā€.

Using this deviceID, the following is done to change the mode.

service: catlink.request_api
target:
  entity_id: sensor.scooper_XXXXX_state
data:
  api: /token/device/changeMode
  method: POST
  throw: true
  params:
    workModel: "00"
    deviceId: "XXXXXX"

The meaning used for mode is as follows

    def modes(self):
        return {
            '00': 'auto',
            '01': 'manual',
            '02': 'time',
            '03': 'empty',
        }

Also, to instruct CATLINK to clean up, the following service call is made

service: catlink.request_api
target:
  entity_id: sensor.scooper_XXXXX_state
data:
  api: /token/device/actionCmd
  params:
    cmd: "01"
    deviceId: "XXXXX"
  method: POST_GET

MOD: It works with POST, but callback is an error, so I changed it to POST_GET.

The mode used here is as follows

    def actions(self):
        return {
            '00': 'pause',
            '01': 'start',
        }

I am not the developer of this extension, but this is my most useful ā€œcustom_componentsā€ :grin:.

many thanks, thats quiet smart.

another question: does your Catlink app inform you when the litter box is full? I can see the message inside the app, but I would expect to also get a notification from my iPhone.

I have enabled notifications for the Catlink app on the iPhone but I dont get any messages. Do you experience the same behaviour?

I use CATLINK Lite on Android and have never received a decent notificationā€¦

It was only after using hasscc/catlink that I learned that there are notifications such as ā€œanti-snagging feature enabledā€ or ā€œweight detection protection enabledā€!

CATLINK Lite has a great role to play in the use of firmware updatesā€¦:joy_cat:

me too, the app is horrible, I always have to open the app to see if the litter box is full, thats kind of pointlessā€¦ at least I am not the only one :wink:

I edited the configuration.yaml and reload it sometimes with fixing some typo unitl no any error message
And I think Iā€™ll check and found a sensor or some deviece in list but no anything happen .

So someone can help me?

ok I thik the restarting necessary stepsā€¦

another question: from time to time the app posts a message: trashbox is full. do you also get this type of message in home-assistant through the catlink-integration?

I donā€™t remember much, but I think it was out. The measure I took to keep the message out was to pull the cat litter that accumulates in the tray to the right once a dayā€¦

I donā€™t remember reloading the settings for extensions installed via HACS or manually installed under custome_components.

thanks, actually I found out which messages from the scooper indicate a full waste box or insufficent cat litter.

the sensor where the values come from is called: sensor.scooper_a7de_error

ēŒ«ē ‚余量äøč¶³ means Insufficient Cat Litter
集ä¾æä»“å·²ę»” means trash box is full

I built a flow in Node-RED where I get a message when either the trash box is full or the cat litter is insufficient.

ēŒ«ē ‚余量äøč¶³ means Insufficient Cat Litter
集ä¾æä»“å·²ę»” means trash box is full

Are you a Chinese speaker?
If not, set ā€œlanguageā€ to ā€œen_USā€ in the settings of the sample above, and the message will be output in English.

The following is a sample of the ā€œlanguageā€ setting

thats a good point, no actually I speak German, swiss-german. just modified the language to en_US, thanks.

do you know perhaps the state value when the trashbox is full or the cat litter is insufficient in english? I would like adjust my Node-RED flow accordingly.

I do not know the message output in English.
The only thing I can do is wait until ā€œtrashbox is fullā€ and look at the ā€œsensor.scooper_a7de_errorā€ logā€¦ thatā€™s how I found the message I needed.

Normally I would be able to find it by looking at the CATLINK application, but I canā€™t find it.

hi, i canā€™t use the integration above. thereā€™s an error at login step in home-assistantā€™s log.

2023-09-17 19:17:02.355 ERROR (MainThread) [custom_components.catlink] Login 875567581 failed: [{'returnCode': 1001, 'toast': False, 'msg': 'Invalid parameter[Null input buffer]', 'data': {}, 'timestamp': 1694953022318, 'success': False}, {'platform': 'ANDROID', 'internationalCode': '<redact>', 'mobile': '<redact>', 'password': '<redact>', 'noncestr':<redact>, 'sign': '<redact>'}]

Does this integration still work? Any ideas to get this fix?

Edited: It was solved. My password is too long (20 characters), after i changed the password to about 8 chars, it finally works!

1 Like

Not sure if this is the place to ask, but where are you getting any documentation on the catlink API? I cannot find anything except this forum.

I have no plan either :S maybe the creator of GitHub - hasscc/catlink: šŸˆļø Catlink scooper component for HomeAssistant could help.

Has anybody got a Baymax scooper? The API returns type as Litter_Box_599 instead of scooper. Ir uses a different key in the API as under scooper, it returns device not found.

There is a fork that also supports the feeder and purepro/pure3 fountain. It is pretty rough but useable. Feeders is under the feeder key. purepro and pure3 is under the purepro key but i cant workout the api key dor baymax scooper is. very frusttsting.