Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when setting temperature on PRTHW-TS WiFi RF #2

Closed
Floppy opened this issue Feb 15, 2019 · 12 comments
Closed

Error when setting temperature on PRTHW-TS WiFi RF #2

Floppy opened this issue Feb 15, 2019 · 12 comments

Comments

@Floppy
Copy link

Floppy commented Feb 15, 2019

Reading temperature works fine, but setting it results in:

[15/02/2019, 16:33:09] [Main Thermostat] getTemperatureDisplayUnits
[15/02/2019, 16:33:09] [Main Thermostat] getTemperatureDisplayUnits succeeded!
[15/02/2019, 16:33:09] [Main Thermostat] getCurrentTemperature
[15/02/2019, 16:33:10] [Main Thermostat] getCurrentTemperature succeeded!
[15/02/2019, 16:33:10] [Main Thermostat] getTargetHeatingCoolingState
[15/02/2019, 16:33:10] [Main Thermostat] getTargetHeatingCoolingState succeeded!
[15/02/2019, 16:33:14] [Main Thermostat] setTargetTemperature 23.2
/usr/local/lib/node_modules/homebridge-heatmiser/node_modules/heatmiser/lib/wifi.js:173
        this.emit('error', e);
             ^

TypeError: Cannot read property 'emit' of undefined
    at /usr/local/lib/node_modules/homebridge-heatmiser/node_modules/heatmiser/lib/wifi.js:173:14
    at Wifi.<anonymous> (/usr/local/lib/node_modules/homebridge-heatmiser/node_modules/heatmiser/lib/wifi.js:133:7)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:607:20)

Running latest homebridge and heatmiser plugin on node 8.11.

@Floppy
Copy link
Author

Floppy commented Feb 15, 2019

Ah! Looking at the heatmiser module, I see someone has reported this as a bug on there - looks like the model needs setting to an HW version. See carlossg/heatmiser-node#3

@Floppy
Copy link
Author

Floppy commented Feb 15, 2019

OK so I think what is needed is a model setting in the config, using the list at https://github.com/carlossg/heatmiser-node/blob/master/lib/wifi.js#L40. It's the fourth parameter to wifi.new, so it should be easy enough to pass in. I'll send a PR!

@pumamood
Copy link
Owner

Hi, i didn't have homebridge working anymore. I'll accept your PR, 'model' could be an optional paremeter for settings

@Floppy
Copy link
Author

Floppy commented Feb 15, 2019

After a bit of experimentation, I've found that the heatmiser-node library configures itself for the right model without a problem, as long as you've read something from the stat before you try to write. Because the code in this module creates a new object each time it writes, the autoconfiguration doesn't work.

I can fix it without extra config by making the wifi object persistent, rather than recreated each time. This will also DRY up the code.

@Floppy
Copy link
Author

Floppy commented Feb 15, 2019

Hm, https://github.com/carlossg/heatmiser-node/blob/master/lib/wifi.js#L167 should mean that the read-before-write isn't required, but it's not working for some reason.

(sorry for the stream of debugging notes, hope you don't mind @pumamood)

@Floppy
Copy link
Author

Floppy commented Jun 22, 2020

I'm coming back to this now after having a break from homebridge; if I can get it working and debug my issues, I would be happy to take on maintenance of the plugin.

@iainbullock
Copy link
Contributor

@Floppy I have the same problem with my PRTHW model. Did you ever get it to work?

@Floppy
Copy link
Author

Floppy commented Feb 4, 2021

Turns out the pandemic is still going on and my life remains a mess, so no, not really. Also I'm playing with homeassistant now rather than homebridge; not that I've got that working either :)

@iainbullock
Copy link
Contributor

iainbullock commented Feb 4, 2021 via email

iainbullock referenced this issue in iainbullock/homebridge-heatmiser-ib Feb 5, 2021
Fix for Issue #2

I originally called it Fix pumamood#3, it's actually a fix for Issue #2 at pumamood/
homebridge-heatmiser

Error when setting temperature on PRTHW-TS WiFi RF #2

It needs additional lines in config.json, see README.md
@pumamood
Copy link
Owner

pumamood commented Feb 5, 2021

hi guys you can PR what you need or became collaborator if you want

@iainbullock
Copy link
Contributor

iainbullock commented Feb 6, 2021 via email

@iainbullock iainbullock mentioned this issue Feb 6, 2021
Merged
pumamood added a commit that referenced this issue Feb 6, 2021
@iainbullock
Copy link
Contributor

@pumamood you can close this now

@pumamood pumamood closed this as completed Feb 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants