Having problems adding Heatmiser thermostat to configuration.yaml

Hi both, sorry I didn’t post back on this thread myself earlier. I gave up on getting this to work. In short, I don’t believe the component supports the wifi PRT thermostats I have. I note the bit here from the component page:

Blockquote

The module itself is currently setup to work over a RS232 → RS485 converter, therefore it connects over IP.

Further work would be required to get this setup to connect over Wifi, but the HeatmiserV3 python module being used is a full implementation of the V3 protocol

Blockquote

I understand it should be possible to get this to work, but would require some work. I planned on having a look into that but unfortunately work has me very busy right now. Hope that helps!

This code works for me too, or at least doesn’t show any config error. But now the log shows errors and the heatmiser component is not loading properly.

Does anyone have any idea what is up here

$
2018-02-26 22:56:36 INFO (MainThread) [homeassistant.components.climate] Setting up climate.heatmiser
2018-02-26 22:56:37 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform heatmiser
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py”, line 84, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.5/asyncio/tasks.py”, line 400, in wait_for
return fut.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/climate/heatmiser.py”, line 52, in setup_p$
heatmiser, tstat.get(CONF_ID), tstat.get(CONF_NAME), serport)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/climate/heatmiser.py”, line 69, in init
self.update()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/climate/heatmiser.py”, line 119, in update
self.dcb = self.heatmiser.hmReadAddress(self._id, ‘prt’, self.serport)
File “/srv/homeassistant/lib/python3.5/site-packages/heatmiserV3/heatmiser.py”, line 221, in hmReadAddress
datal = hmSendAddress(destination,0,0,0,serport)
File “/srv/homeassistant/lib/python3.5/site-packages/heatmiserV3/heatmiser.py”, line 203, in hmSendAddress
msg = hmFormMsgCRC(destination, protocol, constants.MY_MASTER_ADDR, rw, address, payload)
File “/srv/homeassistant/lib/python3.5/site-packages/heatmiserV3/heatmiser.py”, line 87, in hmFormMsgCRC
data = data + crc.run(data)
File “/srv/homeassistant/lib/python3.5/site-packages/heatmiserV3/heatmiser.py”, line 58, in run
self.CRC16_Update©
File “/srv/homeassistant/lib/python3.5/site-packages/heatmiserV3/heatmiser.py”, line 52, in CRC16_Update
self.Update4Bits(val>>4) # High nibble first
TypeError: unsupported operand type(s) for >>: ‘str’ and ‘int’

Sorry for the slow response JCTucker1. I’m not totally sure what that means but I think the last line is saying it’s getting a string for something when it’s expecting an int.

I’ve been messing about with this in odd spare moments and have just managed to bodge together enough that my thermostat now shows up in Home Assistant with the correct temperature. I have absolutely no idea what I’m doing but I think I should be able to get at least basic functionality working. I’m going away for the weekend now but when I get back I’ll upload my progress for anyone else that wants to tinker.

1 Like

Hi Dave, interested in seeing your code. Also, which model of the heatmiser are you all using? Is it the PRT-TS with WiFi, or the earlier none wifi PRT models?

Thanks

I have the PRT-ETS WiFi.

It’s pretty much untested so use at your own risk but I think I might have it working. It only supports reading and setting the temperature on one thermostat right now. The files are at https://github.com/daveNewcastle/HassIO-config/tree/master/custom_components/climate
They’re a mash up of the built in heatmiser component and the wifi code I found at https://github.com/midstar/heatmiser_wifi so they get the real credit.

I’ve got them in config/custom_components/climate/ and in my config yaml I’ve got

climate:
  - platform: heatmiserWIFI
    ipaddress: 192.168.0.12
    port: 8068
    pin: !secret thermostat_pin

8068 is the default port and I think the default pin is 0000. If you try it let me know how you get on.

Hi Dave,

apologies for the slow reply, but just managed to get some time to look at this. Sounds great, but I’m getting a component not found error when I check config, after adding the config to my .yaml and saving the two .py files into custom_components\climate.

Exact error is " Platform not found: climate.heatmiserWIFI"

Any ideas?

thanks

Strange, I’m no expert but I think it should work. I’ve had it running since my last post and the only issue I’ve had is the label for the target temperature is “unknown”. Are the files named exactly the same I had them?

Hi Dave,

Yes exactly as per the instructions on the readme. Files are stored in the custom_components folder in a climate sub folder., and named exactly as per the source. Where are you storing them?

There isn’t really much that could be causing this I guess but clearly something is awry in my setup!

Any chance you could host the files you are using in case there’s some syntax issue?

Thank you!

Good idea. I’ve uploaded my files to https://drive.google.com/file/d/184UHmm0XCHoGrzSERFHbRnhTEzwFpEkl/view?usp=sharing

I put my entire configuration.yaml in just in case there’s something else in there that’s relevant (seems unlikely but you never know). The heatmiser entry is on line 319. Hope it works for you!

1 Like

Hi Dave,

That did the job. Using your files, and adding the configuration to my config.yaml did the job. I can now track the temperature of all three of my Heatmiser thermostats. I can view current temp, set a new temp, as well as track historic temp.

Couple of minor points, the component doesn’t seem to support the ‘name’ attribute, so I cannot label the three thermostats, they all appear as ‘Heatmiser WIFI’. Any simple way to change this? Also, one of the the heatmisers’ I have also supports the hot water function, which isn’t currently available. Not a big deal really. Any plans to add this?

Thank you so much.

That’s great news! I didn’t think it would work with multiple thermostats.

The name attribute should be easy enough to add. I’m happy to have a go at adding the hot water function but as mine doesn’t support it I won’t be able to test so it might take us a bit of back and forth to get it right. I’ll update it next chance I get and let you know.

1 Like

Hi Dave,

Thanks for the reply. So very kind of you to add the updates. So very appreciated. If there is anything I can do to help, please do let me know. I did start to look at the name piece over the weekend, but didn’t get too far, though I’m not particularly proficient with Python.

Also, not a problem with testing etc, I’ll dm you my email address if you want to email instead of using the forums for that.

One other question, if I may. I noticed in your configuration.yaml that you have a graph of Living room temperature. Is that using data from a dedicated temperature sensor, or are you somehow cleverly pulling that from the heatmiser? Here’s the excerpt I’m thinking off:

history_graph:
  gr1:
    name: Living Room Temperature
    entities:
      - sensor.temperature_1
    hours_to_show: 240
    refresh: 480

Once again, thanks for all your help.

No problem at all. I’m happy stuff I’ve made is useful for other people too, though I’m a bit jealous of your three smart thermostats! I’ve added the name attribute and moved the component to a separate repo so hopefully it will work straight from there for you. https://github.com/daveNewcastle/Heatmiser-WIFI

Email sounds good. I haven’t looked into adding hot water support yet but it’s probably too much to ask for that it goes completely smoothly.

My living room graph is from a Xaiomi temperature sensor. I imagine you could create one from the thermostat data if you wanted though. You’d maybe have to create a virtual sensor in home assistant with https://www.home-assistant.io/components/sensor.template/ that pulled data from the thermostat and then graph that.

1 Like

Dave,

Thank you for the updated files, just put this into place, and works a treat :slight_smile: I now have all three stats listed and named correctly. One point, which I didn’t mention before, you may want to update the readme to add a possible update that may be required. My stats don’t have external temperature sensors, I believe they’re built in. I had to change the value ‘floor_temp’ to ‘air_temp’ for the temperatures to be read correctly. Others may have to make that change.

Also, I wonder, do you have the status of the climate device showing as unknown on your thermostat? All three of mine show as ‘Unknown’ for the value which should be an indicator of whether the climate device is ‘heating’ ‘cooling’, ‘off’, etc, as I understand it. Is that related to the change I made to the thermostat temp sensor?

climate

Thanks so much for all the help, I will drop you my email address separately, please do let me know if you need anything at all.

Many Thanks!

Hope you don’t mind me jumping into this thread. I am confused with the Heatmiser config for normal nonWIFI PRTs so am hoping you can help me. I have added the suggested code as per the Components page to configuration.yaml for heatmiser but get errors. I am running Hassio on a Pi 3 and am trying to work out if I have to add other files to the setup other than updating the configuration.yaml file?

Thanks

Richard

Hi Richard,

By the sounds of it you are using the non-wifi thermostats so you will be using the functionality already available in home assistant. As long as you are using one of the devices specified on this page you won’t need any other files, just add the declaration into your configuration.yaml and you should be good to go.

If like myself and Dave, you are using the later devices with Wifi, you will need to use Dave’s updated custom heatmiser files for now.

Having said that, I think there maybe some issue with the syntax for declaring your heatmiser, if you look at the earlier post in this post you should be able to see what syntax has worked for others. What error message are you actually getting?

Thanks

1 Like

Hi nmparmar

Many thanks for the reply. I have tried different syntaxes but always get an error - see below.

My set up in configuration is:-

climate:

  • platform: heatmiser
    ipaddress: 192.168.1.201
    port: 20101
    tstats:
    1:
    id: 1
    name: Thermostat

Error without - adjacent to the ‘1’ underneath tstats

Error while setting up platform heatmiser
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 82, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/lib/python3.6/site-packages/homeassistant/components/climate/heatmiser.py”, line 52, in setup_platform
heatmiser, tstat.get(CONF_ID), tstat.get(CONF_NAME), serport)
File “/usr/lib/python3.6/site-packages/homeassistant/components/climate/heatmiser.py”, line 69, in init
self.update()
File “/usr/lib/python3.6/site-packages/homeassistant/components/climate/heatmiser.py”, line 119, in update
self.dcb = self.heatmiser.hmReadAddress(self._id, ‘prt’, self.serport)
File “/usr/lib/python3.6/site-packages/heatmiserV3/heatmiser.py”, line 221, in hmReadAddress
datal = hmSendAddress(destination,0,0,0,serport)
File “/usr/lib/python3.6/site-packages/heatmiserV3/heatmiser.py”, line 203, in hmSendAddress
msg = hmFormMsgCRC(destination, protocol, constants.MY_MASTER_ADDR, rw, address, payload)
File “/usr/lib/python3.6/site-packages/heatmiserV3/heatmiser.py”, line 87, in hmFormMsgCRC
data = data + crc.run(data)
File “/usr/lib/python3.6/site-packages/heatmiserV3/heatmiser.py”, line 58, in run
self.CRC16_Update©
File “/usr/lib/python3.6/site-packages/heatmiserV3/heatmiser.py”, line 52, in CRC16_Update
self.Update4Bits(val>>4) # High nibble first
TypeError: unsupported operand type(s) for >>: ‘str’ and ‘int’

Error with - adjacent to the ‘1’ underneath tstats

starting version 3.2.4
Testing configuration at /config
Failed config
climate.heatmiser:
- Invalid config for [climate.heatmiser]: expected a dictionary for dictionary value @ data[‘tstats’]. Got [OrderedDict([(1, OrderedDict([(‘id’, 1), (‘name’, ‘Thermostat’)]))])]. (See ?, line ?). Please check the docs at https://home-assistant.io/components/climate.heatmiser/
- platform: heatmiser
ipaddress: 192.168.1.201
port: 20101
tstats: [source /config/configuration.yaml:93]
- 1: [source /config/configuration.yaml:94]
id: 1
name: Thermostat
Successful config (partial)
climate.heatmiser:

Any help is appreciated.

Many thanks

Richard

Hey Richard,

That sounds like the same sort of errors others were seeing. I saw the same sort of error when I started this thread, and never really got to the bottom of it because it quickly became apparent that the platform wasn’t going to support my Wifi heatmisers. But others were having the same syntax errors and Dave was able to get this config to at the least not error using the syntax as above. But it was not taken any further as our devices are different. If the config as per Dave’s post isn’t working (including the correct spacing for yaml. Please check this!) I think this may merit a separate post to see if you can get the attention of others who will be more able to help you.

Sorry I can’t help much more, perhaps someone else may be able to help.

Good luck!

Thanks again for the reply - It looks like one of those type of issues where it may be unlikely to fix due to not many person using them. Maybe back to OpenHAB then!

I do have a Netmonitor which I use with the IOS app, I may look to see if I can get at the data using a HTTP call instead.

Thanks
Richard