Hello,
i wanted to read the value of a temperatur sensor with a phyton script. Im using an unipi with evok and pimatic.
So Pimatic must read the last line of this script and set it as temperatur output:
#!/usr/bin/python
from jsonrpclib import Server
s=Server("http://localhost:81/rpc")
#print s.owbus_list(1)
s.ao_set_value(1,2.6)
print s.sensor_get_value('286E6474060000B7')
Device:
{
"id": "Temp1",
"name": "Temperatur Sensor 1",
"class": "ShellSensor",
"attributeName": "value",
"attributeType": "number",
"attributeUnit": "C",
"command": "sudo bash /home/pi/temp.py",
"interval": 60000
}