Oh, i know, i have no 5Ghz network, so no 'wl -i eth2'. I disabled it:
Code: Select all
.....
# look in 2.4GHz (eth1) network for device
for x in `wl -i eth1 assoclist | awk '{print $2}'`; do
if [ $x = $mac ]; then
device_present=On
fi
done
# look in 5GHz (eth2) network for device
#for x in `wl -i eth2 assoclist | awk '{print $2}'`; do
# if [ $x = $mac ]; then
# device_present=On
# fi
#done
....
Anyway, i have no errors, but my status is not updated in Domoticz on ON/OFF switch.
-----
[SOLVED] - I had to unbreak 3 lines:
Code: Select all
...
domoticz_status=`curl -s "http://domoticzUser:domoticzPassword@domoticzIP:domoticzPort/json.htm?type=devices&rid=$idx" | grep Status | awk '{print $3}' | sed 's/[",]//g'`
...
curl -s "http://domoticzUser:domoticzPassword@domoticzIP:domoticzPort/json.htm?type=command¶m=switchlight&idx=$idx&switchcmd=On" > /dev/null
else
curl -s "http://domoticzUser:domoticzPassword@domoticzIP:domoticzPort/json.htm?type=command¶m=switchlight&idx=$idx&switchcmd=Off" > /dev/null
...
Because i don't believe that in Tomato /jffs/scripts/ are triggered automagically, i put:
Code: Select all
/jffs/scripts/presence_detection MAC-ADDRESS1 IDX1
/jffs/scripts/presence_detection MAC-ADDRESS2 IDX2
/jffs/scripts/presence_detection MAC-ADDRESS3 IDX3
/jffs/scripts/presence_detection MAC-ADDRESS4 IDX4
and so on...
in Administration/Scheduler first free Custom/every minute/Everyday
Now is working like a charm
Bless You Surroot!