arthurkrupa / gree-hvac-mqtt-bridge

MQTT Bridge for controlling Gree smart air conditioners, e.g. with Home Assistant or OpenHAB
GNU General Public License v3.0
126 stars 62 forks source link

mqtt-bridge crashing when sending commands #88

Open Mac5000 opened 8 months ago

Mac5000 commented 8 months ago

Hi,

First of all I want to thank you guys for creating this integration. I have everything up and running and I can read values using my mqtt broker but I have a problem with the sending of the commands.

For some reasons (Unfortunally I'm not good in coding ...) the sending of the commands is working fine and the appliance is receiving the command and also excecuting it.

the problem is that the mqtt bridge is crashing with this output :

[UDP] New device registered: c6d18638 [UDP] Device c6d18638 is bound! [MQTT] Message "1" received for home/greehvac/power/set /sinclair/app/deviceFactory.js:178 this.device.props[opt] = pack.val[i] ^

TypeError: Cannot read properties of undefined (reading '0') at /sinclair/app/deviceFactory.js:178:42 at Array.forEach () at Device._handleResponse (/sinclair/app/deviceFactory.js:177:16) at Socket. (/sinclair/app/deviceFactory.js:45:47) at Socket.emit (node:events:513:28) at UDP.onMessage [as onmessage] (node:dgram:930:8)

So in the above example I'm just sending value 1 to turn the system on. The system is receiving this command and is also turning on but somewhere something is going wrong resulting in a crash and not accepting any commands anymore.

I allready tried to debug this myself but so far no luck. Any ideas ?

Mac5000 commented 8 months ago

Update : I've managed to run the nodejs process by using pm2 so this makes the process to be relaunched after every command but its not the best solution but for now it works.