I'm looking for a quick tip on how to post a json string to homeseer from a raspberry pi running python3.
I thought that I would play around with a raspberry pi 3b+ and start off with installing python and setting up a DHT22 temperature/humidity sensor on it. This was fairly simple and I have succeeded in using a python script to read the sensor and print the values to the console. Next step is to update a newly created virtual device on my HS3 with the temperature from the raspberry pi. The simplest method would seem to be to excecute a json function, but after 2 hours of searching and testing, I cannot get python to run the json post such that it communicates properly with HS3.
This simple json string run from a web browser will update my virtual device properly (with a test value of 12): http://192.168.254.211/JSON?request=...f=493&value=12
It appears that the "requests.post" function in python 3 is the function that I should be using, but I cannot figure out how to build the json payload properly for it to communicate with HS3. Any help would be appreciated.
I thought that I would play around with a raspberry pi 3b+ and start off with installing python and setting up a DHT22 temperature/humidity sensor on it. This was fairly simple and I have succeeded in using a python script to read the sensor and print the values to the console. Next step is to update a newly created virtual device on my HS3 with the temperature from the raspberry pi. The simplest method would seem to be to excecute a json function, but after 2 hours of searching and testing, I cannot get python to run the json post such that it communicates properly with HS3.
This simple json string run from a web browser will update my virtual device properly (with a test value of 12): http://192.168.254.211/JSON?request=...f=493&value=12
It appears that the "requests.post" function in python 3 is the function that I should be using, but I cannot figure out how to build the json payload properly for it to communicate with HS3. Any help would be appreciated.
Comment