Why doesn’t this work?
When I attempt to do a bit of math and assign the result to another attribute (which is an existing defined attribute for the device targeted) in a subsequent DeviceState, the data never makes it to the device. It shows in the Debug log as a number (red - at least that is what I think red means) while all of the other payload.data nodes show as strings (green - happy?).
I tried using a toString() thinking that was the issue. It didn’t help.
var parts = payload.data.data.split(’,’);
payload.data.tVOC = parts;
payload.data.tVOC_ppm = (payload.data.tVOC / 1000);
- “tVOC”:“3453” . <–green
- “tVOC_ppm”:3.453 <–red