Skip to content

Generate .json when script is ran #1

@dbowles1975

Description

@dbowles1975

Would it be possible to get this script to spit out a .json in the following format?

{
"posts": [
{ "id": 1, "title": "json-server", "author": "typicode" }
],
"comments": [
{ "id": 1, "body": "some comment", "postId": 1 }
],
"profile": { "name": "typicode" }
}

My idea was to run the script as a cron and then set up JSON Server (fake REST API) to host the values. From there I was going to create virtual sensors in SmartThings and use webCoRE to apply those values to the sensors. This would give me all of my temperature data in SmartThings and allow me to run automations based on those values. My only hurdle is that I don't know enough about JSON to format in a way that JSON Server will accept.

https://github.com/typicode/json-server

I can definitely handle the SmartThings side of this with no problems.

Or maybe you've moved on and found a better way of doing this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions