I wanted this feature too and added a sensor to the maxcube component. An early version is available here:
The configuration works just the same as the official maxcube component. For each thermostat, a new sensor is added with entity id sensor.<name_of_thermostat>_valve_position.
Wonderful job! I want to try it.
Anyway, i’m still worried about a problem that is coming using Max Cube integration.
After some time (randomly) the cube loose the configuration.
You can also read here about this known problem:
Unfortunately, yes… For debugging purposes I decreased the polling interval to 30 seconds and within a few days the cube lost its configuration. Before I moved to Home Assistant I controlled the cube with Pimatic which worked for years without any problems. Pimatic indeed seems to keep the connection open instead of reconnecting every few minutes.
Thanks for mentioning this issue, at least now I know where my problems came from . Will take a look at the suggested solution soon.
I’ve tryed your code and it’s perfect. I’m using it and have valve position in Home Assistant. Great job and thank for your time.
I’ve also tryed deleting disconnection in order to keep connection always on but seem that it’s not working. It’s still disconnecting. I check it trought official App.
While using Max! Home Automation software, the app is not working.
With Home Assistant it’s still working. Have you tryed this solution also?
I’ve not tried this solution (assuming “this solution” means modifying the maxcube-api library by deleting line 83 in cube.py). However, I just took a look at the code and I don’t think removing this line is enough to solve the problem. Just take a look at connection.py:
On every connection, the MaxCubeConnection object will set the socket property. On every new connection, it will check for this property being set (line 17). If this is the case, it will still call the disconnect method (line 18). This means that calling the connect method of the MaxCubeConnection object (as is done in cube.py, line 81) will still cause HA to disconnect from the cube.
To solve this, you should probably remove line 16 - 20 in connection.py. In the ideal situation, the maxcube-api library should be modified so that MaxCubeConnection also includes an option to keep the connection open.
After integrating my MAX! cube with HA, I played around with the suggested changes to not have the problem of configuration loss in the future.
I deleted line 83 from cube.py - not sure if the other code in the update method should also be deleted though.
I also deleted lines 16-20 from the connection.py.
Unfortunately, the HA still seems to disconnect from the cube as I can access the cube data from an Android …
yes i’ve tryed too but no way to avoid disconnection.
so i’ve decided to change max cube firmware
and it’s working, no more problems with loosing configuration. and i’ve battery level, valve position and more parameter.
i think that the official home assistant integration for max cube should be deleted cause it’s not working correctly.
Hm, that’s a pity… And it seems like the python-maxcube-api repository hasn’t been updated for a long time, so there’s no reason to expect this issue being solved in the short term. (Of course I could try doing that myself, and I actually did, but for now I didn’t succeed .) So thanks @steno for pointing to the CUL/CUN topic, I will try going that way. Having other sensors as well sounds great!
I just read the breaking changes in the beta release notes for HA Core 0.109.0. In 0.109.0, the official maxcube component will also expose the valve position.
Important update: MAX! products are no more on the market. You can still find something but they are not producing it anymore. By the way with a-culfw firmware you have then products of “HomeMatic family”. So you can still add HomeMatic products if you need
I think this says enough. Please use the official integration, my custom integration is unsupported and has not been maintained for about 1.5 years. My integration only included a quick fix to expose the valve position, because at that time the official integration did not expose it. Nowadays, the official integration does support this feature, and many more.
Also, I think this feature request has been implemented and can be closed.
According to the code, the valve position should be an attribute of the climate devices provided by the Max! Cube integration. Unfortunately, I don’t have access to any Max! Cube devices anymore, so I can’t check this for you in my own HA instance.
Got strange issue perhaps you know how to resolve?
Logger: homeassistant.setup
Source: setup.py:320
First occurred: 17:02:50 (1 occurrences)
Last logged: 17:02:50
Unable to prepare setup for platform maxcube.binary_sensor: Platform not found (cannot import name ‘BinarySensorDevice’ from ‘homeassistant.components.binary_sensor’ (/usr/src/homeassistant/homeassistant/components/binary_sensor/init.py)).
If that issue arises when using the custom integration, it is probably caused by the deprecation of the BinarySensorDevice class. You could try to change it to the BinarySensorEntity class. Other than that, I can’t help you with this. The custom integration is unmaintained and unsupported, and it is better to use the official integration instead. If that integration doesn’t work as expected, file an issue and you’re likely to get more help than I can offer you.
There probably is, but I don’t know how to fix it. I’m afraid you’ll have to sort that out yourself. I strongly recommend you to follow the advice in my previous post: use the official integration.