ivesdebruycker / node-red-contrib-maxcube

A node-red node to control the eQ-3 Max! Cube
Other
13 stars 12 forks source link

TypeError: Cannot read property 'room_id' of undefined #8

Closed jwildeboer closed 7 years ago

jwildeboer commented 7 years ago

Using the version of node-red-contrib-maxcube on npm as of today (2016-11-30) on Node Red 0.15.2, I get the above error in the Node Red debug console. Due to this, it seems I cannot send commands to my thermostats. This is also mentioned in https://github.com/ivesdebruycker/maxcube/issues/12 which I guess is the same problem/bug.

I also see entries like

{ "rf_address": "0ba773" }

Which I guess are my window sensors that AFAICS are not (yet) supported?

jwildeboer commented 7 years ago

Using the cli tool I get correct data. I can also succesfully change the temperature setting on my thermostats. And I also see that my window sensors are treated as thermostats with undefined data but not showing the open or close status I would expect to see. It also seems that the wall thermostats are not showing any uselfull information or settings.

maxcube$ status 0ba773 (Wall Thermostat, Living Room) - temp: undefined, setpoint: undefined, valve: undefined, mode: undefined 0c9362 (Eco Switch, null) - temp: undefined, setpoint: undefined, valve: undefined, mode: undefined 0c98c6 (Bathroom, Bathroom) - temp: 0, setpoint: 10, valve: 0, mode: AUTO 16547f (BalconyDoor, Living Room) - temp: undefined, setpoint: undefined, valve: undefined, mode: undefined 0c98bd (Kitchen, Kitchen) - temp: 0, setpoint: 14, valve: 0, mode: AUTO 0ba823 (Bedroom Wall, Bedroom) - temp: undefined, setpoint: undefined, valve: undefined, mode: undefined 0cb005 (Kitchen Window, Kitchen) - temp: undefined, setpoint: undefined, valve: undefined, mode: undefined 0ca84e (Bedroom, Bedroom) - temp: 0, setpoint: 14, valve: 14, mode: AUTO 0ca05a (Bedroom Window, Bedroom) - temp: undefined, setpoint: undefined, valve: undefined, mode: undefined 018999 (Window Sensor, Bathroom) - temp: undefined, setpoint: undefined, valve: undefined, mode: undefined 0c975a (Balcony, Living Room) - temp: 0, setpoint: 14, valve: 0, mode: AUTO 018973 (WindowSensor, Living Room) - temp: undefined, setpoint: undefined, valve: undefined, mode: undefined 0c9768 (Desk, Living Room) - temp: 0, setpoint: 14, valve: 0, mode: AUTO

jwildeboer commented 7 years ago

I can reliably reproduce this error by simply sending this payload (as JSON) to a maxcube-in node:

{"rfid":"0ca84e","degrees": 15 }

Immediate result:

Nov 30 18:36:28 rpi.home.lan nodered[2563]: 30 Nov 18:36:28 - [error] [maxcube in:129689aa.d5e406] TypeError: Cannot read property 'room_id' of undefined

And the temperature doesn't get set :-(

ivesdebruycker commented 7 years ago

This should be fixed with an update to the latest release of maxcube lib (1.0.3). Can you perform npm update in the node-red-contrib-maxcube folder and try again?

jwildeboer commented 7 years ago

Yes. That seems to fix it. Thank you!