Thanks, I manage to google it and make it work somehow

I first made a virtual device that can be updated by calling the domoticz url directly
http://192.168.1.1:8080/json.htm?type=c ... &svalue=20
When I checked that the value is updated, I then used the python script I found on the google (changed it a bit)
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))
(change your IP and your device id)
I saved the script in some "temperaturefordomoticz.py" file, somewhere on pi (I have my in /home/pi/ )
Then I called the script from command line like "python /home/pi/temperaturefordomoticz.py" to make sure that value is being sent to domoticz.
Then I made a cronjob that will send the temperature every 5 min with command
crontab -e
then at the bottom of the file I added
*/5 * * * * python /home/pi/temperaturefordomoticz.py
when you save file, you should see all cron jobs by typing "crontab -l" in command line
(more info on cron here
https://debian-administration.org/artic ... _with_cron)
(Also note that Kodi osmc by default doesn't have a crontab installed by default, but can be easily installed either via osmc shop, or googling on how to add cron to raspberry)
I've added this on 3 Pi's I have, and they all work nice, I see them in the domoticz as temperature sensors
Hope someone finds this useful