"{"values":[{"key": "id", "value": 171},{"key": "counter", "value": 0},{"key": "temperature", "value": 2561},{"key": "x_axis", "value": -223},{"key": "y_axis", "value": -256},{"key": "z_axis", "value": 246},{"key": "battery", "value": 2817}]}"
我有一个设备(zolertia z1)使用MQTT发送json数据,我在node-RED中使用一个函数来提取值,但我不断收到错误我的代码
return {values: msg.values.temperature};
错误:
function : (error)
"TypeError: Cannot read property 'temperature' of undefined"