openhab / openhab-google-assistant

openHAB Google Assistant: Actions on Google for openHAB
Eclipse Public License 2.0
173 stars 85 forks source link

Length check insufficient for thermItems.heatingCoolingMode as number #67

Closed izzy84075 closed 5 years ago

izzy84075 commented 5 years ago

Insteon thermostats return the system mode as a floating point number, and as far as I can tell, this Google Assistant code is expecting only integer data.

I haven't figured out how to get debug info to determine if this is exactly the problem, but it seems to me that the length check at openhab.js, line 203 should be replaced with an attempt to call parseInt, and if it returns anything but NaN, treat the mode as a number.

izzy84075 commented 5 years ago

My notes on important data conversion points while tracing through the various bindings: https://pastebin.com/VAqAWTNe .