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

No Audodiscovery and no Play/Stop #2

Open
ValiEne opened this issue Apr 26, 2024 · 16 comments
Open

No Audodiscovery and no Play/Stop #2

ValiEne opened this issue Apr 26, 2024 · 16 comments

Comments

@ValiEne
Copy link

ValiEne commented Apr 26, 2024

Hi,
First I want to thank you for sharing your work with us.
I've tried to add my cats' Petoneer Dot but unfortunately I didn't succeed.
I'm running HAOS on an Intel NUC machine which has a buildin BT adapter that works fine.
When adding the Integration I'm unable to auto-discover the Dot so I'm adding it by manually entering MAC address, which works, or at least it looks like it's working.
When clicking the Play button I can see in the logs something like this:
2024-04-26 15:48:49.254 DEBUG (MainThread) [custom_components.petoneer_smartdot.button] Current game mode: medium 2024-04-26 15:48:49.254 DEBUG (MainThread) [custom_components.petoneer_smartdot.button] Connecting 2024-04-26 15:48:49.870 DEBUG (MainThread) [custom_components.petoneer_smartdot.button] Sending command 2024-04-26 15:48:49.871 ERROR (MainThread) [custom_components.petoneer_smartdot.button] Connection: BleakError: Characteristic {char_specifier} was not found! 2024-04-26 15:48:49.964 DEBUG (MainThread) [custom_components.petoneer_smartdot.button] Disconnected

I'm doing something wrong or what else should I try?

Thanks

@verdel
Copy link
Owner

verdel commented Apr 26, 2024

Hello. The fact that your Petoneer SmartDot is not discovered through discover and the subsequent error in sending the command most likely indicates that there are several different firmware modifications for the SmartDot at Petoneer.

I was basing this on data from Marco Colombo from the hass-addon-petoneer-smartdot.

I actually just had my toy break and I've ordered a new one. I'll pick it up today and check if its firmware is different. If so, I will make changes to the code and at the same time ask you to provide additional data for debugging. I will show you how to scan Bluetooth devices so that you can see the SmartDot identifier and the service it provides.

@ValiEne
Copy link
Author

ValiEne commented Apr 26, 2024

Thanks Vadim, no hurry :)
Let me know if you need any info from my side

@verdel
Copy link
Owner

verdel commented Apr 26, 2024

I received the new Petoneer Smart Dot and unfortunately, the manufacturer has significantly changed the protocol in the new firmware. The previous Petoneer SmartDot was model PTY010, the new one is TY011.

The previous model had firmware version 1.09, while the new one has 1.2.

Old

v1.09

New

v1.2

The controller board has also visually changed:

Old

old
old

New

new
new

I attempted to debug the new protocol, but unlike the previous version, the packets that the phone app sends to initiate various types of games are no longer static. Each time, the app sends new data when accessing the Smart Dot. When I tried to send a packet with the same content through a Python script, nothing happened.

I wrote to Petoneer support, but I'm afraid they won't provide me with the protocol documentation.

In my case, I simply swapped the controller board from the old model to the new one. Everything worked, except that the eye's centering was slightly off. It looks a bit to the side from the center in its default position, but I'm willing to live with that.

I'll leave the issue open, perhaps Petoneer will respond. For now, I'll add a note in the README about the supported firmware type.

I'm very sorry that the manufacturer changed the firmware of the device, thereby complicating the integration of the Smart Dot into Home Assistant. However, they did not add any functionality to their app.

@ValiEne
Copy link
Author

ValiEne commented Apr 27, 2024

Thanks a lot Vadim for your time.
My board looks similar with the new one you got - I've opened the case few months ago to swap the BT module with an ESP one running Tasmota but unfortunately it didn't worked and I had to roll back to default module.
Later edit: this is what I've tried and failed: https://templates.blakadder.com/petoneer_TY011.html

@ValiEne
Copy link
Author

ValiEne commented Apr 27, 2024

4D64BD8D-3BA3-434C-B33C-6ED730C6EFA3_1_105_c
D7A48F2E-98B4-439E-98D5-BA5CDADBCE81_1_105_c
2BD62168-37D3-42D5-9C9C-FD8ED22CDB71_1_105_c

@verdel
Copy link
Owner

verdel commented Apr 27, 2024

Looking at the components on the board, it resembles my board from the new version of the Smart Dot, but it still differs. Your board has a marking with version v0.20. It seems that Petoneer has changed the controller board more than once.

I also looked into replacing the Bluetooth chip with an ESP32 and the project at blakadder, but I was lucky with my board. Now that I have a new controller in hand, I might try to replace the chip. If I manage to do it, I will write additional information about it.

I will also post in this issue if Petoneer support responds.

@fate8383
Copy link

2025-01-11 00:18:02.541 ERROR (MainThread) [custom_components.petoneer_smartdot.button] Connection: BleakError: Characteristic 0000fff3-0000-1000-8000-00805f9b34fb was not
found!

getting the same error, I was very excited but I guess I am also on the new version of firmware problem, correct?

@verdel
Copy link
Owner

verdel commented Jan 11, 2025

I think you also have the new version of the model, where the manufacturer changed the interaction protocol by adding encryption.

A little earlier in the issue, it's described how to distinguish the old version from the new one.

@fate8383
Copy link

Bummer. I will try a way with Bluetooth gateway works with Tuya. Hopefully I can get it working with that on HA. It is important for me to be able to operate it outside network. I exhausted my tries with direct Bluetooth...thanks

@verdel
Copy link
Owner

verdel commented Jan 11, 2025

I was lucky that I got an old model, and when the previous toy broke, I just transferred the controller to the new version. The center of the eye shifts slightly, but it's not significant.

Unfortunately, I still haven’t found a way to work directly with the new version of the controller and firmware.

@fate8383
Copy link

I wonder if Bluetooth gateway will help...they are not expensive but they are used mostly for temp humidity sensors with blue...not sure if this will work with it...waiting for delivery.

@verdel
Copy link
Owner

verdel commented Jan 11, 2025

I use ESP32 board like this with ESPHome firmware as a Bluetooth Proxy for HA. However, the Bluetooth Proxy will not solve the problem if the Petoneer itself uses a controller with a new firmware version. In that case, my plugin still won't be able to control the toy.

@fate8383
Copy link

hey ble gateway for Tuya, size of a box of a match, worked perfectly. I am able to operate it remotely now with full functions with Tuya app. I will explore more possibilities to go local via HA but that's complicated already. I see DPs but not recognized with any existing integrations yet. Even official Tuya integration finds it but says unsupported...

@fate8383
Copy link

success. with local tuya fork integration it works by adding sub device and its DPs. Now fully local homeassistant controlling and HomeKit as well.

@verdel
Copy link
Owner

verdel commented Jan 15, 2025

@fate8383, great! I’m very glad that you were able to connect the Smart Dot to HomeAssistant and HomeKit.
Could I kindly ask you to check which model is indicated on the bottom of the Smart Dot (TY011 or PTY010)?
Also, could you describe in a bit more detail how the Smart Dot appears in the Tuya App and in HomeAssistant?

@fate8383
Copy link

Gladly.

  • device is PTY but does not matter all versions will work
  • smart dot added to tuya or smart life assuming so leave it there
  • get cheapest ble gateway tuya, I got the gosund Bluetooth gateway, size of an AirPod and range is over 10m plus very good - $20
  • add that to tuya or smart life then immediately tuya will ask that do you want to associate smart dot to this gateway and you say yes
  • go to iot tuya and collect your local keys (optional step but definitely useful)
  • get the fork of that local tuya, link is in above post
  • integration asks for client id and secret and uid (it is not your email, it is the app uid you will find on iot tuya project application page)
  • connect integration and find devices from cloud and find the smart dot in the list
  • add as a sub device (it should find all details itself like ip of the gateway local keys and sub device id etc...
  • do not add dps automatically use manual way
  • use 105 switch as switch for turn on and off the smart dot
  • use 104 as button (this is the trick that if you left last used as small area that is number 1 and it persist until you change so ready to use anytime with this button for me) you can use 1 small, 2 medium , 3 large area in tuya and use that or tweak some integration settings as you please
  • add them to HomeKit bridge and enjoy.

Obviously you need to switch on first and then use button (which is another switch for HomeKit but it does not stay on like the power switch, it just flips back to off as how it should be, I guess you can use switch for this as well didn't try). Actual power switch stays on until 5 minutes when the standard play time is over, it actually checks the smart dot power is on or off basically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants