Many thanks to above: my thermostats are now being recorded. My next task is to try and integrate the sensor values into a climate entity (even if it doesn’t fully work, it looks prettier!)
For anyone who finds it useful, the configurations above create text strings for the temp and humidity, which means they can’t be tracked in a chart etc. An amendment as below brings them into Home Assistant as Degreec C and Percentages, with a “Unit of Measurement” entry:
I’m struggling with a problem where after some time (sometimes a few days, sometimes less) the hub starts behaving very strangely and simple requests that normally work just hang. When it gets into that state even the official app doesn’t behave properly and I have to restart the hub. If anyone has any ideas what might be causing that I’d love to know.
I found that it’s possible to get all device information and state using the syncvalues.cgi endpoint, without having to use cmd.cgi or getdevices.cgi. The app only uses syncvalues.cgi and I’ve removed the other calls from my fork. I’m hoping that the issues I was seeing with the hub behaving strangely were due to cmd.cgi being called too much and using only syncvalues.cgi lets it work more normally (since that’s the same was what the app does).
I’ve done a bit more on this over the weekend and now there are sensor entities for getting temperature, humidity and battery levels for the room thermostats and TRVs, as well as the climate entities. As well as now being able to get the battery levels it’s a bit more convenient for dashboards etc instead of having to pull the attributes off the climate entity or create template sensors.
The unique ids had to be changed as previously they were not unique. I added a second smart hubswitch and that generated a load of duplicate ids. I also collected all the entities under one device per hubswitch which is much neater than having a device per entity.
After you get the latest version you’ll need to delete the previously created entities and devices, or hack your core.entity_registry and device regisitry files.
Hi,
Thanks for the library which I’m using ok except none of the entities update other than after first adding to a dashboard or restarting HA. Any pointers please?
Thanks
J
Which version/fork of the code are you using? I had the same problem with the original repo, but it should be fixed in my fork (GitHub - tonyroberts/hawundasmart). I raised a PR to the original repo but it doesn’t seem like that’s active anymore. If you’re using my fork, make sure you have the latest version of the code.
Another thing you can do is enable debug logging for the integration by setting the following in your configuration file (in addition to any other log settings you already have)
logger:
logs:
custom_components.wundasmart: debug
You will need to restart HA after this change, then check your log file. You should see it logs when the integration polls the wundasmart hub every minute.
Hi Tony,
Thanks for the suggestion. I was using the original code but having read this thread binned it and replaced with your fork. The entities are pre-pended with “climate.” which I believe indicates it is using the fork.
I also enabled debugging and have entries every minute in the log
2023-11-09 17:02:59.566 DEBUG (MainThread) [custom_components.hawundasmart] Finished fetching hawundasmart data in 0.263 seconds (success: True)
2023-11-09 17:04:00.372 DEBUG (MainThread) [custom_components.hawundasmart] Finished fetching hawundasmart data in 1.070 seconds (success: True)
2023-11-09 17:05:00.520 DEBUG (MainThread) [custom_components.hawundasmart] Finished fetching hawundasmart data in 0.217 seconds (success: True)
2023-11-09 17:06:01.252 DEBUG (MainThread) [custom_components.hawundasmart] Finished fetching hawundasmart data in 0.949 seconds (success: True)
2023-11-09 17:07:03.243 DEBUG (MainThread) [custom_components.hawundasmart] Finished fetching hawundasmart data in 1.939 seconds (success: True)
I’m new to HA so not sure where next to look and could easily believe I’ve made a basic error somewhere.
@tonyroberts Amazing stuff thank you. I’ve been playing around with a fork for a while and managed to get varous things working, but your’s is much more full featured. I have forked your repo and added in preset_modes, so you can set temp to the Reduced, Eco, Comfort settings provided within the wunda app. Okay if I PR?
Thanks! Yes PRs gratefully received (even more so if you could update the tests when adding new features as well )
(edit) I just took a quick look at your repo, and just a comment before you raise a PR to save you some time. Please can you separate any formatting changes and only raise a PR with the functional changes you want to make? I’m happy to take formatting changes as a PR when it makes sense (e.g. to fix some style that’s inconsistent with the rest of the project), but not as part of a functional change as that makes reviewing more difficult than it needs to be. Thanks!
Try power cycling your wundasmart hub too. I had problems where earlier versions of the code repeatedly called cmd.cgi and devices.cgi which seems to lead to problems where the hub became unreliable/unresponsive. The latest version only uses syncvalues.cgi, but if you’ve not rebooted it since upgrading you could be still seeing the same issue that I observed.
This maybe the most stupid question known to man/woman/beyond the binary (so nobody gets offended). I have the integration up and running and it’s great that I can control things, just amazing work which is way beyond my understanding. But all the entities get logged to the same HA Area. Is there a way to change this or should the Hub be allocated to a Zone and then all the entities can be allocated to Areas along with lights and other entities in the same area. Sorry for the daft question.
@tonyroberts is it worth starting a new thread for your fork and linking it here? That way people searching for a Wunda integration can find it easier without sifting through 100s of messages + easier to track which integration people are talking about…
Good idea. I think with your testing and feedback it’s almost ready for a v1 release, so I’ll create a new thread at the same time as that and post a link here. Might not be today but maybe later this week.