JSON via C++ script
Posted: Wednesday 09 December 2015 13:49
Hello,
I have a script putting a data from a sensor into a file:
Any ideas how I can update JSON in Domoticz? I know how to do it in Python, but I am not good at C++
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());