uebelack / python-maxcube-api

A python api to control the Max! Cube thermostats.
https://github.com/uebelack/python-maxcube-api
MIT License
21 stars 26 forks source link

MaxCube reset to fatory defaults #12

Closed dingusdk closed 3 years ago

dingusdk commented 6 years ago

My Maxcube is loosing the configuration (reset to factory defaults) with and interval of about 3-6 weeks. It only happens when connected to HA. Other users are having the same issue:

https://community.home-assistant.io/t/maxcube-loosing-configuration/46663

It looks like a general problem with MaxCube and not just your maxcube-api. Openhab users have had the same problem. I have tried changing the polling interval from 1 minute to 5 minutes as suggested by other users:

https://github.com/home-assistant/home-assistant/issues/12551#issuecomment-372113261

Another improvement (this was also done in openhab), was to be able to choose exclusive mode, so the maxcube-api does not close the connection.

Ener-G commented 6 years ago

It would be nice to be able to set this from the HA config, so i don't have to manually change the code each time HA is updated.

Another improvement (this was also done in openhab), was to be able to choose exclusive mode, so the maxcube-api does not close the connection.

Yes, this would be an excellent solution

cs42 commented 6 years ago

I had this problem (using FHEM FYI) too and was searching a cause for a long time. Reading many discussions I am sure now, that this is a connection handling problem of the max cube (some race condition/overflow).

The solution seems to be to use a "blocking" access (open connection once, never close it) instead of opening a new connection on every query from a home automation system, if that is possible. As there can only be one connection to the cube at a time you can't use EQ-3 cloud then or connecting with their windows software.

As EQ-3 never officially documented their protocol I'm almost sure that they see this as "non issue"...

dingusdk commented 6 years ago

Making a longer polling interval only postponed the problem. After a longer testing period of now about half a year, I am almost 100% sure the library should have a "exclusive" - keeping the connection mode, to solve the Max Cube resets.

ghost commented 5 years ago

Hello,

Is there something new about this issue? I have the same problem with my setup ( home assistant and max cube ). I have pooling interval setup to 5 minutes and once about half a year max cube gateway is reset to factory settings.

mike-k68 commented 3 years ago

Hello, The only solution is to use a keep-alive connection: Connect to the cube and never release the connection.

Doing so, i am able to poll every second without any factory reset. But I need to kill my daemon whenever I want to use the Max! Software and restart it when I’m done. (The cube only allows one connection at a time)

If interested I can post my code in a fork here, but you may need to make adaptations, since I’ve taylored my code for my own need with my MQTT daemon.

mvzut commented 3 years ago

Hi mike-k68,

It would be great if you can share how you managed to change to a keep-alive connection! This would not only solve the issue of Cubes being reset, but would also enable us to have real-time updates. Using it as an MQTT daemon is also a really nice solution. Really interested!

mike-k68 commented 3 years ago

Hi there, What is the best way to send you my code ? (email). I don’t want to create a fork and maintain it. Also I’m a python-newbie so my code is definitely not neat and taylored for my own need. But it’s ok if you guys use it, modifiy and share it.

Regards Mike

Le 11 janv. 2021 à 14:40, mvzut notifications@github.com a écrit :

 Hi mike-k68,

It would be great if you can share how you managed to change to a keep-alive connection! This would not only solve the issue of Cubes being reset, but would also enable us to have real-time updates. Using it as an MQTT daemon is also a really nice solution. Really interested!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

unaiur commented 3 years ago

The best way is forking this repository and upload your changes there. You don’t need to maintain it. Just dump your code to GitHub

El El lun, 11 ene 2021 a las 17:41, mike-k68 notifications@github.com escribió:

Hi there, What is the best way to send you my code ? (email). I don’t want to create a fork and maintain it. Also I’m a python-newbie so my code is definitely not neat and taylored for my own need. But it’s ok if you guys use it, modifiy and share it.

Regards Mike

Le 11 janv. 2021 à 14:40, mvzut notifications@github.com a écrit :

 Hi mike-k68,

It would be great if you can share how you managed to change to a keep-alive connection! This would not only solve the issue of Cubes being reset, but would also enable us to have real-time updates. Using it as an MQTT daemon is also a really nice solution. Really interested!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hackercowboy/python-maxcube-api/issues/12#issuecomment-758075460, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABM4WBZO7AJLVKXOA7RXBPDSZMS3FANCNFSM4EXZXBRQ .

mike-k68 commented 3 years ago

Ok, I did the fork. You may find my code here: https://github.com/mike-k68/python-maxcube-api Don't hesitate to ask questions if needed.

unaiur commented 3 years ago

Thank you. I have seen several improvements that are really good, like reporting failed commands (current code does not validate the status code in the response) or support for vacation mode.

On Tue, Jan 12, 2021 at 9:47 AM mike-k68 notifications@github.com wrote:

Ok, I did the fork. You may find my code here: https://github.com/mike-k68/python-maxcube-api Don't hesitate to ask questions if needed.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hackercowboy/python-maxcube-api/issues/12#issuecomment-758503615, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABM4WB7ILHWRKRPKYQIQRULSZQEDXANCNFSM4EXZXBRQ .

unaiur commented 3 years ago

Resolved in 0.4.0 version