Version 1.0.0
37 downloads
This function can come in handy if you want to print a json structure in readable form for debugging or inspection.
It takes a json string as input and returns a HTML formatted string which can be printed in the debug window using fibaro:debug();
Example
Input:
"{\"api_data\":{\"status\":\"online\",\"timestamp\":\"2019-01-18-18:01:32\",\"sensor_1\":[\"value_1\":125,\"value_2\":35],\"sensor_2\":[\"value_a\":34.5,\"value_b\":45]}}"
Output:
{
"api_data" : {
"status" : "online",
"timestamp" : "2019-01-18-18:01:32",
"sensor_1" : [
"value_