benov84 / homebridge-tesy-heater

Tesy heater plugin for homebridge: https://github.com/homebridge/homebridge
MIT License
4 stars 2 forks source link

Cant get Device ID with the provided link #5

Closed mpopof closed 10 months ago

mpopof commented 11 months ago

Hi there,

I got a couple of tesy devices and im trying to add them to home bridge, but when i open the provided link https://www.mytesy.com/v3/api.php?do=get_dev I get the followin error { "login":{"user":"","msg":"Invalid credentials","error":"1"}} I noticed that when I login the web address starts with v4 so I replaced it with https://www.mytesy.com/v4/api.php?do=get_dev - but then i get the following and Im redirected to the dashboard

The contents you are looking for have moved. You will be redirected to the new location automatically in 5 seconds. Please bookmark the correct page at here.

Any chance you can point to how to get the device id

Thanks for all the hard work you have put into this!

benov84 commented 10 months ago

Hi, you can find the device id this way. Login at mytesy.com and open your device. Then open browser's Developer Tools. Go to Network tab and you will see requests named "old-app-devices". Click on them one by one and look at the Response tab on right. You will find the device id inside Json response in field named "id". The device id is 40-symbol long combination of numbers and letters.

benov84 commented 10 months ago

If you have trouble finding the device id, please reply. I'm closing this issue for now

mpopof commented 10 months ago

Ive been looking at the Dev tools in the browser since your reply, but there is no old-app-devices, and I could swear there was a old-app-devices request before your reply,maybe what I saw was old-app-login,I can see multiple requests. I wonder if Im doing something wrong.

mpopof commented 10 months ago

weird enough, I finally managed to get the old-app-devices, on Windows, it never showed up on my Linux machine, but when I went to Response this is what I get { "login":{"user":"mladen@popov.mp","msg":"Invalid credentials","error":"1"}}

benov84 commented 10 months ago

This is really weird. Have you checked all the old-app-devices requests? I don't know if newer devices will show as response at old-app-devices, because I have one pretty old heater only. Check all the requests made after you open the device page and inspect them, if you have troubles I can assist you with AnyDesk or something, but I cannot promise when I will be available.

mpopof commented 10 months ago

It is pretty weird indeed, if I had to guess I would bet the newer devices do not show up on the old-app-devices, even though it doesnt make much sense. I was looking around in all the requests/responses in the dev tools, but I dont see anything that might looks like an device id. Ill be glad if you can do a screen share with teamviewer or anydesk so you can take a look when you have a chance. At least you have an Idea what you're looking for.

outlawe commented 10 months ago

Same here: no old-app-devices communication in the v4 Tesy platform. My heater is CN06AS. However, I get a 6 figure device ID with tokens and MAC addresses in communication with get-my devices. But this 6 figure device ID doesn't seem to work with the plugin. See screenshot.

I also tried to add my CN06 devices to the old v3 Tesy platform, but it is not possible, as the setup routine is different.

My assumption, which might be totally wrong here, is that device MAC is used for device identification

Screenshot 2023-12-26 082113

mpopof commented 10 months ago

I was also wondering if I can catch that device ID with wire-shark or if I can make a local call to the rest api maybe?

mpopof commented 10 months ago

Could the device_id be a combination of token, id, mac,model and ap_pass, attributes from get-my-devices?

mpopof commented 9 months ago

After digging some more, found out that there is no way, in my opinion to acquire the device id with the current setup. Found this v3 website https://www.mytesy.com/v3/#login which turned out its a completely different from the current one. My account didnt work when i tried to login, after registered there was no devices there, and the way you can add them is way different as outlawe pointed out. After I registered and logged in old-app-device appeared in my web console of the v4 platform, but its empty since there is no devices in the v3 platform. I was looking for a way to contact mytesy app developers to ask if there is a way they can help me out with this, since there are a bunch of App store IoT apps developers are having official homebridge plugins I was hoping this might get their attention.

outlawe commented 9 months ago

What I have discovered is that new tesy devices use different URLs to communicate with the cloud and different authentication approach is used. Did some modifications to benov's original script, but yet without success. What I also discovered that my devices do respond to http POST and GET requests by local IP the same way as described here https://github.com/william-sy/TesyLocal but the commands are different than for the boiler. For instance i can get a device status report and list of a commands by sending /usr/bin/curl -X GET http://192.168.x.xxx/getStatus . So for now I believe I will try to take decloud route. mpopov, if you get any response from Tesy about their API, please let us know, that would really ease the life of development cloud/decloud solutions for homebridge/homeassistant

mpopof commented 5 months ago

I just saw there was an update to the plugin, but I cant seem to figure out what was updated and if there is a way get the "new" heaters to finally work with homebridge.

benov84 commented 5 months ago

This update includes small fix. I can't make update for the new heaters, because I don't have one, so I can catch the network traffic and see the API functions used with the new firmware.

mpopof commented 5 months ago

If you let me know how can I collect some network traffic for you, I would love to do that. The tesy heaters are the last piece of my smart home puzzle of the homebridge implementation.