Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Print json string in readable format 1.0.0

   (0 reviews)

About This File

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_1" : 125,
      "value_2" : 35
    ],
    "sensor_2" : [
      "value_a" : 34.5,
      "value_b" : 45
    ]
  }
}

 



User Feedback

You may only provide a review once you have downloaded the file.

There are no reviews to display.

×
×
  • Create New...