sHedC / homeassistant-mastertherm

Home Assistant Mastertherm Component, to communicate and control heat pumps from Mastertherm
MIT License
6 stars 2 forks source link

Getting invalid credentials, MasterThermAuthenticationError. Wrong system? #4

Closed SeBsZ closed 1 year ago

SeBsZ commented 2 years ago

Hey. First of all thanks for working on this HomeAssistant integration. I just got my MasterTherm heatpump so I'm excited to try and help out as much as I can. I'm a developer myself, so if you ever need someone testing things just let me know. I might be able to contribute myself as well.

The first issue I'm running in to is that I currently log into using an email and password. The WebUI is at https://mastertherm.online/. It seems you are logging into https://mastertherm.vip-it.cz/ which uses a username and password. When I try to sign in using my email+password I get a MasterThermAuthenticationError.

Are these 2 separate systems?

Many thanks in advance.

sHedC commented 2 years ago

Hi SeBsZ,

Thank you, interesting my security tool flagged mastertherm.online as a malware site, but I am sure it is not. the vip-it-cz is the site that the android app connects to when I login it is possible that the .online is a new one as my web UI is mastertherm.co.uk.

I reversed engineered the app to find out what it was doing and to where. So this is interesting.

Can you try logging into the vip-it-cz site in a web browser? this lets me log in. Also if you are using an Android app is it MasterTherm by Neoware s.r.o.

Finally I am working on the hass integration at homeassistant-mastertherm but I have set this to deliberately authenticate fail as I was testing what home assistant would do if I got an authentication error during an update. I am just trying to get it to connect and read the outside temperature for now.

I can't log into the online one so its also possible they have new servers that we have to take into account and find the back end server for the new systems if the same app.

Python and home assistant is new to me so learning on the job. I have developed in a lot of things in the past but never python I quite like the language.

One last thing without telling me your username does it have a space or special characters in it? I noticed I had to replace spaces with + can't remember if I fixed this.

Would be very happy to work with you on it.

SeBsZ commented 2 years ago

Hey, thanks for your reply. Some quick answers:

Can you try logging into the vip-it-cz site in a web browser? this lets me log in. Also if you are using an Android app is it MasterTherm by Neoware s.r.o.

The app I am using is cz.neoware.mastertherm.pgdx , it's called 'MasterTherm Touch'. I can not log into your vip-it-cz site. What I am wondering is are you using an email or a username? I only have an email address. It does not contain spaces or special characters (except for @gmail.com).

Python and home assistant is new to me so learning on the job. I have developed in a lot of things in the past but never python I quite like the language.

Same here. Unfortunately Python is also not my language, so hopefully I will learn like you.

EDIT: I tried downloading the normal MasterTherm app (cz.neoware.mastertherm) and it does not let me log in. It seems they are using a different server. Maybe it's as easy as decompiling and changing the URL?

sHedC commented 2 years ago

Ok so quick answer your app and setup is different, I have an older Mastertherm system that uses the older app. The new app looks similar and fingers crossed the back end is still using registers to get the data so we don't have to start again.

First step is to get the app connected through a proxy to see what it is trying to connect to and how, and probably what returns. Have you ever done this?

I want to get my first step done to get the Home Assistant working with a single sensor, hopefully this weekend. After this I can strip that app and see what it is doing and fingers crossed its similar to the old one I use.

Have you experience with Discord? I was on it a while ago but gave up maybe we can connect on there. Also what timezone are you?

SeBsZ commented 2 years ago

We can connect on Discord, I don't use it much . My username seems to be SeBsZ#0605 I'm in Europe, UTC+1.

I have another idea as well that might work

SeBsZ commented 2 years ago

What is your username and timezone?

NorbertColon commented 2 years ago

A little feedback which could be useful: I have a 2017 Mastertherm GSHP (with Neobox). I cannot log into https://mastertherm.online/ but I can connect to https://mastertherm.vip-it.cz/ and control my GSHP.

The latest version connects and retrieves the outside temp correctly. Great job so far, my Mastertherm username is my first name and my last name with a space in the middle. I suspect I may be an early adopter of their systems!

sHedC commented 2 years ago

Hi NorbertColon,

Thank you for trying yes mine is a 2018 and Sebsz is a 2022 I think so the servers changed. It should also give some device info, DO NOT SHARE THE MODULE ID.

I advise deleting the device for now whilst it connects and gets the outside temp it subsequently fails as I am having issues with session caching and COOKIES, so need to find out and re-think how I handle it. I am not sure how HASS is handling sessions and could be re-setting them so I have to re-login. Ill figure that out then release a beter HACS and in parallel work on this issue for the new heatpumps.

NorbertColon commented 2 years ago

Thanks for the advice. I too am getting quite a few "Unavailable" sprinkled throughout the data, I'll disable it for now and watch with interest,

sHedC commented 2 years ago

Having Problems with the old API invalidating the tokens even after re-connect and re-try need to follow up with teesting.

sHedC commented 1 year ago

@NorbertColon - If you want to test please now do it is READONLY and only the main circuit and HC1 and HC2 are enabled.

Any feedback please create an issue so we can track ideas and different usages :)

Thanks Rich