Page 1 of 1

USB Temperature Sensor Script (RDing TEMPer1F_V1.3)

Posted: Thursday 13 October 2016 10:07
by knotty
Hi,

I'm hoping someone can help me. I've got a USB temperature sensor (RDing TEMPer1F_V1.3) attached to my Pi which runs Domoticz. I've got a script in the OS which when run provides the date/time and temperature.

root@raspberrypi:~# pcsensor
2016/10/13 09:03:16 Temperature 81.95F 27.75C
root@raspberrypi:~#

Can someone help me get this data into Domoticz please? Thanks.

Regards,
Paul.

Re: USB Temperature Sensor Script (RDing TEMPer1F_V1.3)

Posted: Thursday 13 October 2016 12:22
by Sappien
Simple example

Code: Select all

#!/bin/bash

## Change Settings below ##

DOMOTICZ=127.0.0.1:8080
IDXTEMP=100
USBPRG=`/root/pcsensor`

###########################

TEMP=`echo $USBPRG | cut -d' ' -f5 | tr -d C`

echo $TEMP

curl -s "http://$DOMOTICZ/json.htm?type=command&param=udevice&idx=$IDXTEMP&nvalue=0&svalue=$TEMP"