Dont know if anyone else has tried, but it took me a bit of tweaking to use the onion cloud to read the 1-wire temperature sensor I wired up on the onion cloud.
-
First thing is to wire up the 1-wire temperature sensor. I did this by following this: https://wiki.onion.io/Tutorials/Reading-1Wire-Sensor-Data
-
next thing is to setup your onion on the http://cloud.onion.io
-
get an API key and Device ID and turn to postman or your REST tool of choice.
Set the Method to POST and use the following endpoint
https://api.onion.io/v1/devices/{Your DeviceID}/file/exec
Replacing {Your DeviceID} with your actual device ID. so, if your Device ID was 1234567, the endpoint would look like this:
https://api.onion.io/v1/devices/1234567/file/exec
You would also create a custom header called X-API-KEY and set the value to the API key you generated.
then in the body, set it to "Raw" and the type = "application/json)"
The JSON that I set in my body is below. NOTE: this is for Fahrenheit. you would only need to have $2/1000 if you wanted Celsius. You would also change the 28-000004fd92f7 with the id of your Dallas temperature sensor that you setup in #1
{
"command": "awk",
"params":[
"-F=",
"/t=/ {printf "%.03f", (($2/1000)*1.8)+32;}",
"/sys/devices/w1_bus_master1/28-000004fd92f7/w1_slave"
],
"env": ""
}
This is what I ended up with. Works nicely and no programming needed!