Nobody can help me ?vulbas wrote: ↑Tuesday 06 March 2018 19:48 hello,
finaly that work for my phone !!!![]()
![]()
but i whant put an another phone, and that don't work
how to add a second phone on the code ?Code: Select all
cru a PRESENCE "*/1 * * * * /jffs/scripts/presence_detection 74:23:44:F7:2C:9B 3701" cru a PRESENCE "*/1 * * * * /jffs/scripts/presence_detection D4:A3:3D:20:51:69 3705"
the IDX is only 3701 on this code![]()
Code: Select all
#!/bin/sh mac=$1 idx=$2 device_present=Off domoticz_status=`curl -s "xxxxxxxxxxxxxxx/json.htm?type=devices&rid=3701" | grep Status | awk '{print $3}' | sed 's/[",]//g'` # 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 # tell domoticz the new device status if [ $domoticz_status != $device_present ]; then if [ $device_present = "On" ]; then curl -s "xxxxxxxxxxxxxxxxxx/json.htm?type=command¶m=switchlight&idx=3701&switchcmd=On" > /dev/null else curl -s "xxxxxxxxxxxxxxxxxxxxx/json.htm?type=command¶m=switchlight&idx=3701&switchcmd=Off" > /dev/null fi fi




