wiserHomeAssistantPlatform
wiserHomeAssistantPlatform copied to clipboard
Migration to Wiser Hub generation 2
This is not really an issue. @msp1974 I'm looking to this migration , here is a first analysis of new device and automation.
This is great Christian thanks.
I have been updating the api and integration to use some of this v2 additional devices and information.
In your PDF file you mention that you have already made an adaptation for the shutters. Can you give me some more info on that please.
Should have something worth testing in a few days.
@msp1974 I have an issue that I don't understand... If you have an idea I install your new version of both aioWiserHeatAPI and wiserHomeAssistantPlatform. I checkout on v2hub and install it without any problem When I launch HA I get this following issue
2023-11-05 12:09:04.906 ERROR (MainThread) [custom_components.wiser.coordinator] ('SmartValve', <aioWiserHeatAPI.smartvalve._WiserSmartValveCollection object at 0x7fd9dafe77d0>) 2023-11-05 12:09:04.906 ERROR (MainThread) [custom_components.wiser.coordinator] Unexpected error fetching wiser (wiser-WiserHeat045FDD) data: ('SmartValve', <aioWiserHeatAPI.smartvalve._WiserSmartValveCollection object at 0x7fd9dafe77d0>) Traceback (most recent call last): File "/home/christian/development/core/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/christian/development/core/homeassistant/helpers/update_coordinator.py", line 246, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/christian/development/core/custom_components/wiser/coordinator.py", line 157, in async_update_data raise ex File "/home/christian/development/core/custom_components/wiser/coordinator.py", line 136, in async_update_data await self.wiserhub.read_hub_data() File "/home/christian/development/aioWiserHeatAPI/aioWiserHeatAPI/wiserhub.py", line 126, in read_hub_data await self._build_objects() File "/home/christian/development/aioWiserHeatAPI/aioWiserHeatAPI/wiserhub.py", line 199, in _build_objects self._rooms = _WiserRoomCollection( ^^^^^^^^^^^^^^^^^^^^^ File "/home/christian/development/aioWiserHeatAPI/aioWiserHeatAPI/room.py", line 647, in init self._build() File "/home/christian/development/aioWiserHeatAPI/aioWiserHeatAPI/room.py", line 657, in _build devices = self._devices.get_by_room_id(room.get("id", 0)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/christian/development/aioWiserHeatAPI/aioWiserHeatAPI/devices.py", line 266, in get_by_room_id return [device for device in self.all if device.room_id == room_id] ^^^^^^^^ File "/home/christian/development/aioWiserHeatAPI/aioWiserHeatAPI/devices.py", line 200, in all items.extend(self._device_collection[key].all) ~~~~~~~~~~~~~~~~~~~~~~~^^^^^ KeyError: ('SmartValve', <aioWiserHeatAPI.smartvalve._WiserSmartValveCollection object at 0x7fd9dafe77d0>)
@msp1974 For the shutters I added the “tilt” functionality in the API and in the Platform (to show my changes I added the tags 'added by LGO' and 'End added by LGO' in the .py files) of course I made some modification in the cover.py in the wiserPlatform. I also added
added by LGO
Tilt feature
@property
def tilt_time(self) -> int:
"""Get tilt time value"""
if self._data:
return self._data.get("TiltTime")
return None
async def set_tilt_time(self, time: int):
"""Set tilt time"""
return await self._shutter_instance._send_command(
{"TiltTime": time }
)
@property
def tilt_angle_closed(self) -> int:
"""Get tilt time value"""
if self._data:
return self._data.get("TiltAngleClosed",0)
return None
async def set_tilt_angle_closed(self, angle: int):
"""Set tilt angle closed"""
return await self._shutter_instance._send_command(
{"TiltAngleClosed": angle }
)
@property
def tilt_angle_open(self) -> int:
"""Get tilt angle open"""
if self._data:
return self._data.get("TiltAngleOpen",0)
return None
async def set_tilt_angle_open(self, angle: int):
"""Set tilt angle open"""
return await self._shutter_instance._send_command(
{"TiltAngleOpen": angle }
)
@property
def tilt_enabled(self) -> bool:
"""Get tilt enabled"""
if self._data:
return self._data.get("TiltEnabled")
return None
async def set_tilt_enabled(self, en: bool):
"""Set tilt enable"""
return await self._shutter_instance._send_command(
{"TiltEnabled": en }
)
#End Added by LGO
Its still a work in progress and not ready for testing yet. La patience est une vertue! 😁
Ok for that. As you worked quickly I do not wish to delay you and make my contribution
@msp1974 : Here is a doc to show you the results. I've identified some code optimization by using helpers/device.pi for the Zigbee type and UUID...
@msp1974 , in my repositories on github I've updated all my dev LGO44 / wiserHomeAssistantPlatform branch devhvbv2lgo and https://github.com/LGO44/aioWiserHeatAPI branch hubv2lgo.
If you have a moment to have a look it should be nice for me to have your feedback., to know if I'm on the right way. I see that you introduce today a parameter "has_v2_equipment" good idea I apologize of not being a expert in GitHub, to share more what I'm doing.
Thanks in advance
@msp1974 Mark here is a file that contain the communication between the wiser hub and the Wiser Home app. I 've add the communication to my first file Wiser hub V2 data and integration automations and summer comfort communications.pdf
Keeping this open to track progress of adding v2 hub support
Keeping this open to track progress of adding v2 hub support
I've made an error, an non wanted action on the mouse
I have an error and I don't see where does it come from. I use you files /helpers/equipment.py and devices.py
logs:
2023-11-09 18:05:39.931 ERROR (MainThread) [custom_components.wiser.coordinator] '_WiserDeviceCollection' object has no attribute '_equipment_data' 2023-11-09 18:05:39.931 ERROR (MainThread) [custom_components.wiser.coordinator] Unexpected error fetching wiser (wiser-WiserHeat045FDD) data: '_WiserDeviceCollection' object has no attribute '_equipment_data' Traceback (most recent call last): File "/home/christian/development/core/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/christian/development/core/homeassistant/helpers/update_coordinator.py", line 246, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/christian/development/core/custom_components/wiser/coordinator.py", line 157, in async_update_data raise ex File "/home/christian/development/core/custom_components/wiser/coordinator.py", line 136, in async_update_data await self.wiserhub.read_hub_data() File "/home/christian/development/aioWiserHeatAPI/aioWiserHeatAPI/wiserhub.py", line 126, in read_hub_data await self._build_objects() File "/home/christian/development/aioWiserHeatAPI/aioWiserHeatAPI/wiserhub.py", line 193, in _build_objects self._devices = _WiserDeviceCollection( ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/christian/development/aioWiserHeatAPI/aioWiserHeatAPI/devices.py", line 124, in init self._build() File "/home/christian/development/aioWiserHeatAPI/aioWiserHeatAPI/devices.py", line 193, in _build device_info[0]["EquipmentData"] = self._get_equipment_data( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/christian/development/aioWiserHeatAPI/aioWiserHeatAPI/devices.py", line 129, in _get_equipment_data for equipment_data in self._equipment_data: ^^^^^^^^^^^^^^^^^^^^ AttributeError: '_WiserDeviceCollection' object has no attribute '_equipment_data'
I haven't pushed everything to dev or the api yet. Have a big new kitchen project going on so a bit time limited this week. Will let you know when its worth testing.
I haven't pushed everything to dev or the api yet. Have a big new kitchen project going on so a bit time limited this week. Will let you know when its worth testing.
Thanks! No problem for that, I always progress ...
Ok, had some time last night and got a working beta with the following.
- PowerTagE is integrated (but no attributes yet)
- Tilt function added to shutters
I will add a some of the attributes to the PowerTag but then think this should be a release as I want to make sure we keep compatibility with V1 hubs as we go. No better way to test than release into the wild.
If you want to test it.
As a note, i think you may not have installed the v1.4.0 of the api into your HA environment which is why you were getting the errors above. Do a..
pip install -e [path to your cloned api library]
inside your HA env.
Thanks for your job , good as usual,my first tests are very encouraging and promising. I've began my test and add some attributes to the powertag ...
First I test only the hub V2 and then I will test the 2 versions together on my dev platform and I'll compare the results. I will make a report and then I agree to create a release to be tested by a lot of people.... I won't be at home this week_end. When I'll come back I'll publish all my modifications on the platform and the API.
I started with the branch hubv2 and dev from your repositories, and I copy-paste the files in my dev platform.
@msp1974 Here is a report of the tests of the wiser generation 2. Give me your feedback and what do you want more. I will update my github withe the API and the platform. Wiser hub 2nd generation Tests report V1.pdf
Great. Thanks for this. So, it's all working apart from the voltage and current on the power tag? I can see a bug there which I will fix.
The error if tilt not supported is what should happen.
fix currentvoltage sensor not updating
OK Fixed. Is there a way to get these value faster than each 30 seconds?
The error if tilt not supported is what should happen.
This behavior is normal, I noticed it not as an error.
Hello folks, I have a Gen2 as well, and I am in the process of adding the water sensors, movement sensors and powertags. Let me know if I can help ! Cheers
@msp1974 I've made a pull request on asantaga/wiserHomeAssistantPlatform.
As I'm a beginner on github I've also mase a pull request on my repository https://github.com/LGO44/aioWiserHeatAPI/pull/1 . I don't know how can I upload it in your repository.
The first tests on both hub generation 1 and generation 2 are positive.
I've a error in the initialisation of the second hub
023-11-16 17:32:26.852 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry WiserHeat045FDD for wiser Traceback (most recent call last): File "/home/christian/development/core/homeassistant/config_entries.py", line 399, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/christian/development/core/custom_components/wiser/init.py", line 69, in async_setup_entry await cards.async_register() File "/home/christian/development/core/custom_components/wiser/frontend/init.py", line 17, in async_register await self.async_register_wiser_path() File "/home/christian/development/core/custom_components/wiser/frontend/init.py", line 24, in async_register_wiser_path self.hass.http.register_static_path( File "/home/christian/development/core/homeassistant/components/http/init.py", line 435, in register_static_path self.app.router.add_route("GET", url_path, serve_file) File "/home/christian/development/core/venv/lib/python3.11/site-packages/aiohttp/web_urldispatcher.py", line 1101, in add_route return resource.add_route(method, handler, expect_handler=expect_handler) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/christian/development/core/venv/lib/python3.11/site-packages/aiohttp/web_urldispatcher.py", line 348, in add_route raise RuntimeError( RuntimeError: Added route will never be executed, method GET is already registered
I set up dev channel yesterday and so far pte integration is working for power and energy reports! (5pte total, 2x1phase, 3x 3phase; firmwares between 03.xx to 04.xx used)
will report if it is still staple next week :)
one thing I noticed +regarding power readings: they are out of sync, when combined with wiser sockets paired with zha (delay by 1-2sec) can't tell which side this is on.
iE: wiser plug (on zha) a used 120w for 5min. main pte still reads 120w for 1-2 sec after that.
this leads to a difference between main pte and the sum off all plugs and outlets (on zha) that can be negative regarding the current power consumption. (on main pte)
conclusion: I want to add wiser smart plugs and smart outlets with your integration. are there any plans of supporting those?
//
if there's anything I can provide you with (logs etc) just let me know, happy to try and help!
@LGO44, I'll have a look at that error but this is not part of the v2 changes and i dont see it when adding multiple hubs to my dev setup. Its a part of the code that installs the cards.
@senna1992, good to hear. In terms of delay, you will have a delay based on the poll interval set in your integration options. The integration only reads the hub data on this periodic basis as there is no push notifications from the hub. However, this should be ok. If you are tracking energy use with these, you should be using the total energy sensor as that will be accurate and comes from the hub.
In terms of smart plugs, they are already supported. For smart sockets, we can add this (assuming they are different from smart plugs).
In terms of help, a current diagnostic download posted here would be great to have more than just Christians to test with. Also, when you have some smart sockets, another download and the control commands would be great.
Very jealous of all the fun stuff you have on the continent!
@LGO44, I'll have a look at that error but this is not part of the v2 changes and i dont see it when adding multiple hubs to my dev setup. Its a part of the code that installs the cards.
OK but it still works but with this error.
I set up dev channel yesterday and so far pte integration is working for power and energy reports! (5pte total, 2x1phase, 3x 3phase; firmwares between 03.xx to 04.xx used)
will report if it is still staple next week :)
one thing I noticed +regarding power readings: they are out of sync, when combined with wiser sockets paired with zha (delay by 1-2sec) can't tell which side this is on.
iE: wiser plug (on zha) a used 120w for 5min. main pte still reads 120w for 1-2 sec after that.
this leads to a difference between main pte and the sum off all plugs and outlets (on zha) that can be negative regarding the current power consumption. (on main pte)
conclusion: I want to add wiser smart plugs and smart outlets with your integration. are there any plans of supporting those?
//
if there's anything I can provide you with (logs etc) just let me know, happy to try and help!
the data coming from the hub are not synchronized. Using the wiser home application we have also the capability to add programme in the Energy manager, my next step is to create a load shedding in the energy management program part ( when the threshold of the contract I stop heating actuators...).
@senna1992, good to hear. In terms of delay, you will have a delay based on the poll interval set in your integration options. The integration only reads the hub data on this periodic basis as there is no push notifications from the hub. However, this should be ok. If you are tracking energy use with these, you should be using the total energy sensor as that will be accurate and comes from the hub.
In terms of smart plugs, they are already supported. For smart sockets, we can add this (assuming they are different from smart plugs).ipment
In terms of help, a current diagnostic download posted here would be great to have more than just Christians to test with. Also, when you have some smart sockets, another download and the control commands would be great.
Very jealous of all the fun stuff you have on the continent!
Thats why I've created data equipment-power, Equipment Energy Delivered, Equipment Total Energy, some of this information are duplicate @msp1974 maybe we will undoubtedly have a little cleaning up.
If you want to play and have fun come to the continent! yes we are very lucky. Schneider "life is on" and "who make the most for your energy"
@msp1974 have you seen my work on my github, on the aioWiserHeatAPI?
I'm not sure to have updated the cover.py in my GitHub (an issue appears on the hub generation 1, adding the tilt features... I fixed it ) I won't be at home until wednesday...
@senna1992, good to hear. In terms of delay, you will have a delay based on the poll interval set in your integration options. The integration only reads the hub data on this periodic basis as there is no push notifications from the hub. However, this should be ok. If you are tracking energy use with these, you should be using the total energy sensor as that will be accurate and comes from the hub.
In terms of smart plugs, they are already supported. For smart sockets, we can add this (assuming they are different from smart plugs).
In terms of help, a current diagnostic download posted here would be great to have more than just Christians to test with. Also, when you have some smart stockets, another download and the control commands would be great.
Very jealous of all the fun stuff you have on the continent!
https://github.com/senna1992/wiserhubv2
uploaded my diagnostic infos there. 1x wiser smart socket only 1x your integration with only ptes on the hub 1x zha integration with plugs and sockets
please ignore "tageszaehler" entities I made them for daily power usage tracking my wiser integration is set to 30sec (base value). power readings are red much more often
Small update:
Confirmation, that following devices are working for me already: (i am using power, total energy, state attributes)
- MEG2380 (smart socket)
- CCTFR6501
- R9M20
- R9M40
working switches/buttons:
- MEG5161-0000 with added MEG5116-0300
partially working:
- MEG5162-0000 with added MEG5126-0300 [relais button 2 gang with zigbee addon] --> just one gang is showing
not working: MEG5001-0300 [wireless battery button 1/2 gang --> not showing up at all CCT599002 [smoke detector]--> not showing up at all
If other attributes are to be checked (current etc) i can do that as well =) TRVs are ordered, will report if they are working. Readings are valid (no issue with current power readings, no conversion needed) You can find the latest diagnostic info in my repository //
Cheers for the great work!