Run Python script every 5 minutes
Posted: Saturday 30 June 2018 19:57
Hi all - Python n00b here!
So after 2 days (off and on) I've finally managed to figure out how to get a change in temperature sent to a Blynk applet. Been a steep learning curve!
How would I achieve the same every say 5 minutes? Not winning fathoming out where to do the timer piece.
Thanks!
So after 2 days (off and on) I've finally managed to figure out how to get a change in temperature sent to a Blynk applet. Been a steep learning curve!
Code: Select all
import DomoticzEvents as DE
import random
import urllib.request
if DE.changed_device_name == "LukeRoomThermometer":
NewTemp = DE.changed_device.s_value
DE.Log("Luke's room's temp has changed...Now: " + str(NewTemp))
Link123 = "http://blynk-cloud.com/8318xxxxxxxxxxxxx/update/V0?value="+str(NewTemp)
req = urllib.request.Request(Link123)
with urllib.request.urlopen(req) as response:
the_page = response.read()

Thanks!