- Widget managing Json data instead of simple string as done by core widgets.
- Thanks to the Jeedom Community
- The json data is submitted to Jeedom as raw string as the following:
"{'Battery': '90', 'Temperature':'16,5', Humidity':'55'}"
- if your data is the output of PHP script, make sure the format is OK.
- Example of PHP code
$json_string="{";
foreach($result as $x => $val) {
// ....
$json_string .= "'".$x."':"."'".$val."',"; // add ' instead of " bcse widget remove " ==> see widget script : ' replaced back by "
}
$json_string[strlen($json_string)-1] = "}"; // replace last ',' by '}'
$scenario->setData('JSON', $json_string);
- manage options
- manage unities (nested Json)