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.


#!/bin/bash
status=/home/pi/scripts/temperature
domo_idx=XX
fib_idx=XX

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:

Splitting the home network

Who wouldn't want to separate the traffic at home for security reasons. The more common ones include wireless guest and wireless users. ...