Page 1 of 1

JSON via C++ script

Posted: Wednesday 09 December 2015 13:49
by alexsh1
Hello,


I have a script putting a data from a sensor into a file:

Code: Select all

  fprintf(fp,"{\"datetime\": \"%s\", \"name\": \"%s\", \"power_unit\": \"W\",\"power\": \"%.0f\", \"total_unit\": \"Wh\",\"total\": \"%.0f\", \"packet\": \"%s\" }", buffer, s->getSensName(), s->getPower(), s->getPowerTotal(), s->getPacket());
                    
Any ideas how I can update JSON in Domoticz? I know how to do it in Python, but I am not good at C++