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.
It is deffo not there I had to revert to customā¦
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.