Syntax error in Function node

I have dowloaded data from my Ewelink Thermostat (TRVZB), where the state of the thermostat stored in "thermostat-mode" object. Im unable to get or transfer this data to my global variable, because the hyphen in the name not accepted.
Any solution?
Peter

  1. Use a change node instead of a function node.
  2. Use square bracket notation instead of dot notation.

You can either quote it or place in between square brackets. For example:

obj = {
   "thermostat-mode": xyz
}

or

mode = obj["thermostat-mode"]

Thanks!
In the meantime I found the answer in "Use an object with a hyphen in a function" topic. Same like OMRID advice.

Thanks again your time and quick answer.

Peter

(You should make the thread as solved to show it has been answered.)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.