You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
The current plugin requires it's own syntax of how data is published to particle (key=value): Particle.publish("tvalue", "temperature=20.7");
Proposal:
It's a common approach to group multiple values together in a single event with JSON format in order to limit the number of messages to the particle cloud.
https://www.w3schools.com/js/js_json_objects.asp
JSON objects are surrounded by curly braces {}.
JSON objects are written in key/value pairs.
Keys must be strings, and values must be a valid JSON data type (string, number, object, array, boolean or null).
Keys and values are separated by a colon.
Each key/value pair is separated by a comma.
As an example, an indoor room sensor might transfer the following values:
temperature [°C]
humidity [%RH]
CO2 [ppm]
VOC [ppb]
The corresponding particle event would look like this (data is limited to 255 byte): Particle.publish("airquality", "{\"temp\":20.7,\"humid\":45,\"voc\":98,\"co2\":410\"}");
The text was updated successfully, but these errors were encountered:
Hi @mguntli,
I'm familiar with JSON. This project is work in progress and, tbh, I haven't continued implementing it in a long time because out of connection stability and speed reasons, I switched to using MQTT for my own projects. What I implemented you can check here: https://github.com/norman-thomas/omni-sense. There I already use JSON as well as single values.
If you would like to have JSON support in this project and have a bit of time, feel free to implement it and I will merge it. I would like to implement it, but sadly am a bit short on time these days.
Thanks for your pull request #21 , I already merged it and hope it helps you for now.
Problem:
The current plugin requires it's own syntax of how data is published to particle (key=value):
Particle.publish("tvalue", "temperature=20.7");
Proposal:
It's a common approach to group multiple values together in a single event with JSON format in order to limit the number of messages to the particle cloud.
As an example, an indoor room sensor might transfer the following values:
The corresponding particle event would look like this (data is limited to 255 byte):
Particle.publish("airquality", "{\"temp\":20.7,\"humid\":45,\"voc\":98,\"co2\":410\"}");
The text was updated successfully, but these errors were encountered: