DeanCording / node-red-contrib-comfort

A Node Red node to calculate the thermal comfort level of an environment using ASHRAE Standard 55
Other
6 stars 4 forks source link

strings as input #2

Closed Urs-Eppenberger closed 7 years ago

Urs-Eppenberger commented 7 years ago

Hello Dean Many thanks for your node. I built it into my home sensor network where I measure temperature and humidity in various places. I take the values from an MQTT broker and put them into global variables within node-red. Within your comfort node, I fetch these values with the global. setting, i.e. global.storageTemp and global.storage.Hum Looking at the debug output, I see that node-red handles these values as strings: "22.3" It seems your comfort node does not like this. Would it be possible to test this on input in your node and convert it directly in your node? Else I place a function node in front of your node to do this, so it is not a very big issue. Please let me know what you think.

DeanCording commented 7 years ago

Javascript's loose typing is fantastic until it does stupid things like this. I've made some changes to make it explicitly convert all inputs to numbers. The fix has been pushed to a new release.

Cheers,

Dean

Urs-Eppenberger commented 7 years ago

This was fast. Awesome. Many thanks.