Sep-04-2020, 05:28 PM
I use one of my RPis for monitoring my fridge temp. I currently have LEDs lit to indicate a good or bad condition. I also get a push notification when the monitoring service starts (cronjob @reboot). The code is a loop that checks the temps every 5 minutes and will send me a push notification (using requests.post and Android apps Join and Tasker). Using Tasker, I can have my phone respond to incoming messages (not just text messages - think pushes). I want the pi to attach a variable to the base of the URL so I can catch the event, where Tasker can alert me, showing the issue.
Why not just combine them? There are other conditions that could be populated to be the "alert" variable, such as alert = overtempfridge, or alert = freezerdooropen.
How do I append the "alert" variable to the "base" and send it with a requests.post?
import requests base = https://autoremotejoaomgcd.appspot.com/sendmessagekey=goo.gl:lonstrinofcharactersthatyoudonotneedforthis&message= alert = overtempfreezer r = requests.post("base + alert")So the "base" variable will always be that. Never changes. It has been edited for privacy. At the end is "&message=" where the next characters would be the "alert" variable. I am hoping to combine the ougoing requests.post to be "https://autoremotejoaomgcd.appspot.com/sendmessagekey=goo.gl:lonstrinofcharactersthatyoudonotneedforthis&message=overtempfreezer"
Why not just combine them? There are other conditions that could be populated to be the "alert" variable, such as alert = overtempfridge, or alert = freezerdooropen.
How do I append the "alert" variable to the "base" and send it with a requests.post?