Getting heatmiser binding working with wifi thermostats

Has anyone managed to get the heatmiser binding working with the heatmiser wifi thermostats?

My config reads:

heatmiser:dining.address=192.168.1.101
heatmiser:dining.type=WIFI
heatmiser:dining.port=8068
heatmiser:dining.pin=xxxx

My items reads:

Switch  DiningTherm_Enable   "Dining Heating Enable  [%s]"         (heat)    { heatmiser="dining:ONOFF" }
Number  DiningTherm_RoomTemp "Dining Heating Temperature [%.1f C]"     (heat)    { heatmiser="dining:ROOMTEMP" }
Number  DiningTherm_SetTemp  "Dining Heating Setpoint    [%.1f C]"     (heat)    { heatmiser="dining:SETTEMP" }
String  DiningTherm_HeatState    "Dining Heating State [%s]"         (heat)    { heatmiser="dining:HEATSTATE" }

If I use the latest 1.7 version of the binding I get a succession of errors in the logs:

2015-08-28 10:50:56.199 [ERROR] [i.internal.GenericItemProvider] - Binding configuration of type ‘heatmiser’ of item \u2018DiningTherm_Enable\u2018 could not be parsed correctly.

thinking perhaps this version doesn’t support the wifi thermostats I used the version at the bottom of the thread here, but then get connection errors

2015-08-28 11:28:23.801 [ERROR] [.h.internal.HeatmiserConnector] - Reading from network failed
java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:209) ~[na:1.8.0_60]
	at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_60]
	at java.net.SocketInputStream.read(SocketInputStream.java:127) ~[na:1.8.0_60]
	at org.openhab.binding.heatmiser.internal.HeatmiserConnector$InputReader.run(HeatmiserConnector.java:183) ~[na:na]
2015-08-28 11:28:25.584 [ERROR] [.h.internal.HeatmiserConnector] - HEATMISER: Error sending message Broken pipe

I’d be really grateful if anyone can point me in the right direction!

Dan

I have not integrated mine yet.
One thing that I know however is that last year there was a device update to disable web access for security reason.
So if the binding relies on that I guess we are toasted.

Pretty sure that’s not the problem, as the Vera plugin (which has the same code base, I believe works fine). I haven’t updated mine with the new version because I don’t expose the devices to the internet (and in any event, didn’t they remove the mini web server but not the iphone app access)

So am I doing something wrong? Or is the latest openhab incompatible with the rather old 1.4 heatmiser binding?

I’m not sure that you could say the Vera plugin has the same codebase as the OH binding - I wrote both of them, but they were both written from scratch…

The OH binding was not originally written for the Wifi thermostats. I spent some time a year or more ago adding some support, but it was never finally merged as I couldn’t test it. I believe it was working though, but again, I can’t be sure as I don’t have the wifi thermostats and the debugging was never concluded…

Chris

1 Like

I have finally openhab up and running on the emonpi server.
Soon will be trying heatmiser binding.
Will let you know

All your hard work is really appreciated. If there’s anything I can do to help test/debug please let me know. But if you have other priorities I completely understand!

Dan

To answer my own question - this turned out to be a weird problem with my logging settings. Once fixed, the 1.4 heatmiser binding works just fine with the wifi thermostats. I’ll post a new topic on the logging weirdness.

[Edit: actually it didn’t, I was misunderstanding the logfiles - the heatmiser 1.4.0 binding just doesn’t seem to work with my wifi thermostats, for whatever reason…]

Dan

Hi,
I did the debugging when Chris started to implement the support for the wifi tnermostat.
The last version to be found in Chris’ heatmiser branch is functional for reading differents states, but has no support for writing to the thermostat. So in my installlation, I can read actual and target temperature, heating mode (on/off), hold mode (on/off), holyday mode (on/off).
Reading hold time does not work.

Best
Hans-Jörg

Many thanks - I think I’ll try getting openhab to read/write to the thermostats using the exec binding and the Perl libraries that are available… will let you know how I do!

OK - I’ve now implemented heatmiser reading and control in a reliable albeit incredibly hacky way using the perl libraries (here).

readheat.sh is my bash script to read thermstat, parse JSON output, and return temp in celcius:

#!/bin/bash

#bash script to query heatmiser temperature 
#required argument is url


#run heatmiser perl script and extract line with temperature argument is 
TEMPLINE=$(/[your path]/heatmiser-wifi-read-only/bin/heatmiser.pl -h $1 -p [your PIN] | grep 'deg C (internal)')

#now extract correct characters
TEMPNUMS=$(echo ${TEMPLINE} | cut -c13-16)

#print result, stripping off the errant 'd' if we need to (where no decimals, and next char is a 'd')
#Also strip off any leading or trailing white space using awk
echo "${TEMPNUMS%d}" | awk '{gsub(/^ +| +$/,"")} {print $0}'

then a regular cron job can run the script and load the output into a defined OpenHAB item HeatmiserTemp:

output = executeCommandLine("[path to readheat.sh]@@[ip address]", 2000)
if (output == "") {
	logWarn("Heatmiser control", "thermostat disconnected")
} else {
	sendCommand(HeatmiserTemp, output) //update stored temp
}

Would be much neater to use the JSON transformation in openHAB, but it’s much too complicated for my small brain.

(I find the thermostats often lose wifi connection, thus the error logging above)

Then it’s easy to use the examples at the bottom of this page to create bash scripts to turn thermometers on/off

I am trying to use JSONPATH as per the wiki.

Here is my item:

Number HeatmiserTemperatura “Temperatura [MAP(it.map):%s]” (PianoTerra,PianoTerra_Salone,Riscaldamento) { http="<[http://192.168.2.251/cgi-bin/heatmiser/heatmiser_json.pl:JSONPATH($.192.168.2.251.heating.target)]" }

the json returned by the above call is:

{
“192.168.2.251” : {
“comfort” : [
[
{
“target” : 22,
“time” : “06:30:00”
},
{
“target” : 19,
“time” : “08:30:00”
},
{
“target” : 23,
“time” : “12:30:00”
},
{
“target” : 22,
“time” : “23:00:00”
}
],
[
{
“target” : 22,
“time” : “07:30:00”
},
{
“target” : 20,
“time” : “23:30:00”
}
]
],
“config” : {
“caloffset” : 0,
“locklimit” : 0,
“optimumstart” : 0,
“outputdelay” : 0,
“progmode” : “5/2”,
“sensor” : “internal”,
“switchdiff” : 1,
“units” : “C”
},
“dcblength” : 72,
“enabled” : 1,
“errorcode” : null,
“frostprotect” : {
“enabled” : 1,
“target” : 12
},
“heating” : {
“hold” : 0,
“on” : 0,
“target” : 22
},
“holiday” : {
“enabled” : 0,
“time” : “2015-12-19 19:46:00”
},
“keylock” : 0,
“product” : {
“model” : “PRT”,
“vendor” : “Heatmiser”,
“version” : 1.9
},
“rateofchange” : 20,
“runmode” : “heating”,
“temperature” : {
“floor” : null,
“internal” : 22,
“remote” : null
},
“time” : “2015-12-19 19:46:22”
}
}

in the log I see this error:

2015-12-19 21:16:36.003 [WARN ] [h.i.HttpGenericBindingProvider] - bindingConfig is NULL (item=HeatmiserTemperatura (Type=NumberItem, State=Uninitialized)) -> process bindingConfig aborted!

I suspect this is due to the format of JSONPATH($.192.168.2.251.heating
I tried to override it a la unix JSONPATH($.192.168.2.251.heating

but that is failing as above.

Before trying to modify the perl script I’d like to solve this