hjespers / node-red-contrib-nest

Node-Red module for Nest thermostats and smoke detectors
20 stars 15 forks source link

Structure issue with Nest Request node (node-red-contrib-nest v0.1.6) #3

Open JonMurphy opened 8 years ago

JonMurphy commented 8 years ago

I am experiencing an odd issue with the node-red-contrib-nest v0.1.6 and the Nest Request node. I am trying to get info from the structure area of Nest. If I set Type = Structure and ID = blank and Streaming = false then msg.payload = [].

And if I set Type = Structure and ID field = blank and Streaming = true then I get some of the Nest structure. The msg.payload only returns 1008 characters. Setting the debugMaxLength: 2000 in setting.js does not change anything. What am I doing wrong?!?

[{"id":"fd8798e9.027868","type":"nest request","z":"99cebb52.663148","account":"","devicetype":"structures","deviceid":"","streaming":"false","name":"","x":255,"y":58,"wires":[["adef0635.5210f8","9a7d0d25.6582f"]]},{"id":"d8a6958b.275968","type":"inject","z":"99cebb52.663148","name":"","topic":"","payload":"","payloadType":"none","repeat":"","crontab":"","once":false,"x":108,"y":58,"wires":[["fd8798e9.027868"]]},{"id":"adef0635.5210f8","type":"debug","z":"99cebb52.663148","name":"","active":true,"console":"true","complete":"payload","x":417,"y":58,"wires":[]},{"id":"9a7d0d25.6582f","type":"file","z":"99cebb52.663148","name":"Nest Log","filename":"/Users/name/Desktop/nest.log.txt","appendNewline":true,"createDir":false,"overwriteFile":"false","x":405,"y":108,"wires":[]}]

Also - here are a couple of small items in the Nest Request node: Client ID should be Product ID Client Secret should be Product Secret

Also I have a Nest Protect and can test things if needed (I saw the TODO list on github)

JonMurphy commented 8 years ago

Hi Hans - I installed the 0.1.8 version a few days ago. Just wanted to say "Thank you!" for the Nest Node! I am still experiencing an issue with the node-red-contrib-nest. For Type = Structure and ID field = blank and Streaming = true then the output "msg" is an object as expected. But the output msg.payload is a string and is 1007 (or 1008) characters. And the string is incomplete so I cannot convert it to a json object.

If I set Type = Structure and ID = blank and Streaming = false then msg.payload is an object and seems to work as expected.

Also I know you published the 0.1.7 and 0.1.8 changes on January 5 and 6 but it took me a few days to figure out how to update npm published nodes (i.e., sudo npm update). As you can guess I am a noobie at all of this! Best regards, Jon

JonMurphy commented 8 years ago

Forgot one other item. Starting with Type = Structure and ID field = blank and Streaming = true and then changing the Streaming = true to Streaming = false (and then doing a Deploy) does not stop the streaming from the Nest. It will just continue as it was streaming. The only way to stop the Nest Streaming (that I've found) is to stop & then start Node-RED.

hjespers commented 7 years ago

Yes streaming mode still has some issues. I really need to rewrite this feature or just remove it entirely and have Node-Red poll for data.