Wednesday, April 11, 2018

Extract temperature from Fibaro HCL to Homekit Room

For Apple mobile users who want to know the temperature of a room in Apple home using a temperature sensor from Fibaro HCL

Automation Flow:

Aeotec light/temp sensor > Fibaro HCL > bash script >; Domoticz virtual device > homebridge/homekit

Setup Steps

Step 1. Create a temperature virtual device in Domoticz and take note of the device id.

Step 2. Create a bash file with the following script, replacing the XX and user:password fields.


curl "http://user:password@XX.XX.XX.XX/api/panels/temperature?type=devices&method=single&id="$fib_idx > $status
temperature=`cat $status |  sed 's/[{}]//g' |  awk -F : '{print $3}' | awk -F , '{print $1}'`

curl "http://XX.XX.XX.XX:8080/json.htm?type=command&param=udevice&idx="$domo_idx"&nvalue=0&svalue="$temperature

Step 3. Create a cron entry to run this script every 5 or 10 mins (temperature doesn't change that quickly)

No comments:

dead pi

Well, I guess it has to happen at some point. the home automation raspberry pi has died. Much to do with the stupid Strontium mini SD card. ...