Database link in stead of scripting Bacnet_Domoticz

All kinds of 'OS' scripts
Post Reply
Cnor
Posts: 2
Joined: Monday 13 July 2015 19:11
Target OS: Raspberry Pi
Domoticz version: latest
Location: The netherlands
Contact:

Database link in stead of scripting Bacnet_Domoticz

Post by Cnor » Sunday 13 August 2017 17:48

I Have a master Domoticz with several (KaKu/energie/etc) devices for years, mainly for lighting works like a charm!

Now i am just playing with a Bacnet device from JohnsonControls: a NCE. I have installed a slave Domoticz on Ubuntu in a virtualbox to fiddle around with. This is a free programmable Bacnet device. I managed to read and write from and to Domoticz using http://bacnet.sourceforge.net/.
Analogue Values i do wit cron on my slave. for digital values I call a script with Blockly.
Example digital:
#!/bin/bash
/home/cor/bacnet-stack-0.8.4/bin/bacwp 500 19 3001912 85 11 -1 2 2
Example analogue:
#!/bin/bash
echo start
jsonValue() {
KEY=$1
num=$2
awk -F"[,:}]" '{for(i=1;i<=NF;i++){if($i~/'$KEY'\042/){print $(i+1)}}}' | tr -d '"' | sed -n ${n$
}
echo stap 2
DOMOTICZ=`curl -s --connect-timeout 2 --max-time 5 "http://192.168.178.12:8080/json.htm?type=device$
if [ -z "$DOMOTICZ" ]
then
echo stap 3
exit 1
else
TEMP=$(echo $DOMOTICZ | jsonValue Temp 1)
echo de temp is $TEMP
HUMID=$(echo $DOMOTICZ | jsonValue Humidity 1)
echo vocht is $HUMID
/home/pi/bacnet-stack-0.8.3/bin/bacwp 500 2 3001873 85 16 -1 4 $HUMID
/home/pi/bacnet-stack-0.8.3/bin/bacwp 500 2 3001871 85 16 -1 4 $TEMP
fi

I am not a Linux expert, but i would like to exchange some more info between the two devices....
I bet this can be done easyer than my examples

Anybody an Idea?
MasterDomoticz RaspberryPi SlaveDomoticz on VirtualUbuntu. JohnsonControls NCE25

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest