Open kodebach opened 1 year ago
Very cool, thanks a lot. Will try beta 0.5.0 beta2 as soon as possible. I am away till end of the week, so will take a while. However very good work, thanks a lot.
Testing the code right now, everything seems to correctly work. Thank you very much for this improvement, I think you did a great improvement that will be helpful for a lot of people.
As a suggestion, a good think will be to create a little guide to correctly setup everything (aliases, script and automation), at the moment all the useful information is splitted between 2 different issues
I will try to improve the README a bit to include some basics about the sensors and services the integration provides.
However the "correct" configuration very much depends on what you're trying to achieve and the devices you're using. I cannot describe every possible scenario. For questions about correctly configuring the integration for your setup, please use the now enabled Discussions tab or the Home Assistant Community Forum to get help from others.
Things like the difference between 0.0
and {{ 0.0 }}
in Home Assistant templates are not specific to this integration, I'll defer to the general Home Assistant documentation for that. But I will include the expected data types in the service documentation, so users are aware.
Note: I'll hide these two comments to keep the issue chain clean, since they aren't directly related to the issue topic (requests for new writable sensors).
Writing works perfectly, I think we can close this issue.
From #69:
Done in v0.7.0
:
Still open (units unknown):
From #93
Hello, thanks for the integration. I would love to get write support for
@buster3 I released v0.9.0-beta.1
(see #128) please test, if writing works for the sensors you needed.
I played a little bit. I think you forgot to add supported_features for the RoomMode in the sensor_address.py.
I think you need to add following line in the 0.9.0 beta 6:
around line 540 in the file sensor_address.py: enum=RoomMode, address=ZONE_OFFSETS[self.index] + ROOMOFFSETS[room] + 5, name=f"zone{self.index+1}room{room+1}_mode", force_single=True,
it should be:
enum=RoomMode,
address=ZONE_OFFSETS[self.index] + ROOM_OFFSETS[room] + 5,
name=f"zone_{self.index+1}_room_{room+1}_mode",
supported_features=SensorFeatures.SET_ROOM_MODE,
force_single=True,
Without that change, you can't select any entity in the service write room mode...
Further correction needed, otherwise no selection possible: change to: enum=RoomMode, address=ZONE_OFFSETS[self.index] + ROOMOFFSETS[room] + 5, name=f"zone{self.index+1}room{room+1}_mode", device_class=SensorDeviceClass.ENUM, supported_features=SensorFeatures.SET_ROOM_MODE, force_single=True,
After that roommode entities could be selected, however a write still not works. The issue is now the enum definitioin itself. Here is my Python knowledge at the end. I have no idea to define proper an enum. It seems it could not resolve the Enum values in text to the number. However I do not see a defnition for the strings either. In C or C++ you would solve that completely differently but I know Python has some self-refelction tricks, but I suffer the syntax. Could you please have a look. I got following error message, when I try now to write this ZoneModule RoomModes:
2024-09-10 09:03:00.244 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'eco' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/idm_heatpump/sensor.py", line 236, in handle_set_room_mode value = RoomMode[raw_value]
File "/usr/local/lib/python3.12/enum.py", line 814, in __getitem__
return cls._member_map_[name]
~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'eco'
Found that fault as well. It is just a lower upper case issue. The enum is defined in all upper case. So it is not "eco" but "ECO". That was easy to change and the write works. What I do not understand: I tried to get now everything aligned, but can't really:
Maybe you could help me to understand that better....
sorry all the comments from today should relate to issue #93. Just move the comments. The final comment in issue #93 holds a zip file with all the fixes.
From https://github.com/kodebach/hacs-idm-heatpump/issues/142
set_circuit_mode
in addition to set_room_mode
more registers to add to service set_temperature
1401 Raumsolltemperatur Heizen Normal HK A 1403 Raumsolltemperatur Heizen Normal HK B 1405 Raumsolltemperatur Heizen Normal HK C 1407 Raumsolltemperatur Heizen Normal HK D 1409 Raumsolltemperatur Heizen Normal HK E 1411 Raumsolltemperatur Heizen Normal HK F 1413 Raumsolltemperatur Heizen Normal HK G 1415 Raumsolltemperatur Heizen Eco HK A 1417 Raumsolltemperatur Heizen Eco HK B 1419 Raumsolltemperatur Heizen Eco HK C 1421 Raumsolltemperatur Heizen Eco HK D 1423 Raumsolltemperatur Heizen Eco HK E 1425 Raumsolltemperatur Heizen Eco HK F 1427 Raumsolltemperatur Heizen Eco HK G
Please use this issue to report any additional sensors you'd like to have write support for.
Currently supported sensors:
power_solar_surplus
: Aktueller PV-Überschusspower_solar_production
: Aktuelle PV ProduktionCurrently supported sensors for zone module (
Z
= 0..9, index of zone module) rooms (R
= 0..7, index of room):2000 + 65 * Z + 2 + 7 * R
: Zonenmodul (Z+1) Raum (R+1) Raumtemperatur2000 + 65 * Z + 2 + 7 * R + 2
: Zonenmodul (Z+1) Raum (R+1) Raumsolltemperatur2000 + 65 * Z + 2 + 7 * R + 4
: Zonenmodul (Z+1) Raum (R+1) Raumfeuchte2000 + 65 * Z + 2 + 7 * R + 5
: Zonenmodul (Z+1) Raum (R+1) Betriebsart