internal temperature from other raspberry pi's
Posted: Wednesday 25 January 2017 23:35
From time to time my Kodi gets a bit hot, so I wanted to see and log its temperature in domoticz. I can see the temperature by typing /opt/vc/bin/vcgencmd measure_temp in the console, but wanted to send it to domoticz. And I found small script on google that I changed a bit, and have cron send value to virtual temperature sensor every few minutes. Script is very simple and looks like
Beginners guide and cron setup (that I wish I had found ) is here
http://www.domoticz.com/forum/viewtopic ... 02#p116402
Code: Select all
#!/usr/bin/python
import subprocess
import time
import os
import urllib2
serverIP = "192.168.1.1:8080"
deviceId = 1
currentTemp = subprocess.check_output(["/opt/vc/bin/vcgencmd","measure_temp"])
currentTemp = float(currentTemp.split("=")[1][:-3])
urllib2.urlopen("http://" + serverIP + "/json.htm?type=command¶m=udevice&idx=" + str(deviceId) + "&nvalue=0&svalue=" + str(currentTemp))
http://www.domoticz.com/forum/viewtopic ... 02#p116402