Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate .json when script is ran #1

Open
dbowles1975 opened this issue Mar 25, 2019 · 1 comment
Open

Generate .json when script is ran #1

dbowles1975 opened this issue Mar 25, 2019 · 1 comment

Comments

@dbowles1975
Copy link

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?

@SDNick484
Copy link
Owner

Very cool idea, I need to look into it, but I would think it should be possible. I am traveling on business this week and won't be able to test/code anything, but should have some time next week. I also have a Smartthings Hub and look forward to the final result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants