thosirl / homebridge-heatmiser

Heatmiser integration with Homebridge
2 stars 0 forks source link

/usr/lib/heatmiser/heatmiser in HeatmiserWifi.js #1

Open andy8ch opened 7 years ago

andy8ch commented 7 years ago

I might be missing something, but trying to get this work and the above is not found. Do I have to install another module to make it work. Sorry - bit of a newbie, but I could find reference to this anywhere.

thosirl commented 7 years ago

Hi, You need to have https://github.com/thosirl/heatmiser-node installed also, that gives you the underlying library to enable the communication.

Tom

slicksurf commented 7 years ago

Hi,

I know this is quite an old now, but I wondering If I could get some help getting this going. As a noob at this, I've got home bridge setup and working for other devices, so my trouble is trying to get this to work. I used "sudo npm -g heatmiser-node" to install the package and placed the two files in "~/.homebridge/accessories" and placed your configuration in ./homebridge/config.json but when I launch I get this error, what have I done wrong?:-

[9/16/2017, 11:22:50 AM] Loaded plugin: homebridge-tradfri-plugin [9/16/2017, 11:22:50 AM] Registering platform 'homebridge-tradfri.IkeaTradfri' [9/16/2017, 11:22:50 AM] --- [9/16/2017, 11:22:50 AM] There was a problem reading your config.json file. [9/16/2017, 11:22:50 AM] Please try pasting your config.json file here to validate it: http://jsonlint.com [9/16/2017, 11:22:50 AM] /usr/lib/node_modules/homebridge/lib/server.js:197 throw err; ^

SyntaxError: Unexpected token { in JSON at position 285 at JSON.parse () at Server._loadConfig (/usr/lib/node_modules/homebridge/lib/server.js:191:19)

slicksurf commented 7 years ago

Ok, I've had a bit more luck, there is a missing bracket in wifi.js of the plugin on the line before case 'awaymode':. The error above was similar in my config.json. Also I had to change the lib location in your files to /usr/lib/node_modules/heatmiser

But now I can't get both current temp or set temp, home bridge crashes when I try to set.

/usr/lib/node_modules/heatmiser/lib/wifi.js:173 this.emit('error', e); ^

TypeError: Cannot read property 'emit' of undefined at /usr/lib/node_modules/heatmiser/lib/wifi.js:173:13 at Wifi. (/usr/lib/node_modules/heatmiser/lib/wifi.js:133:7) at emitOne (events.js:96:13) at Socket.emit (events.js:191:7) at readableAddChunk (_stream_readable.js:178:18) at Socket.Readable.push (_stream_readable.js:136:10) at TCP.onread (net.js:561:20)

slicksurf commented 7 years ago

Ok, looks like this seems to be an issue with the wifi.js, setting this.model = "PRTHW" fixes that.

Now it appears to work, but I had to change the following in HeatmiserWifi.js

var c = data.dcb.remote_air_temp

to

var c = data.dcb.built_in_air_temp

Now Homekit correctly displays room temperature. Is it possible to make Siri set the hold temperature and time?