Controlling occupancy from your router (Open firmware: Tomato/DD-WRT/OpenWRT)

Most IP based mobile device scripts check for occupancy either through Tasker/Llama or by pinging the device from vera. I tend to prefer the latter option since it’s universal across devices and it’s easier to manage from a centralized location. However, one downside to pinging is the chance of inaccuracy if a device is on sleep mode or if your wifi reception isn’t very good.

Alternatively, if you have a Broadcom-based router with custom firmware (tomato/dd-wrt/open-wrt), you can use lower level functions to check for wifi clients associated to your network on the physical layer before an IP address is assigned.

Of course, there are pros and cons to consider with this method:

Pros:
Results are more accurate than ping.
Offloads resource utilization from your phones or vera.
Doesn’t require a response from your mobile device, so it drains less power.
Easily tunable to respond as quickly or slowly as you need it to.

Cons:
Open firmware router required with ability to add startup scripts and execute them.
Needs to be rewritten if you have more than one access point (not too hard to overcome though).
Can take more up more resources on your access point.

Requirements:

[ul][li]Custom firmware router with ability to add custom startup[/li]
[li]chixxi’s excellent Virtual Switch plugin (or similar switch to detect occupancy)[/li][/ul]

For those who are interested, here’s a quick and dirty shell script to control Vera occupancy by scanning for mobile devices on your AP. The wl assoclist command included below is specific for Broadcom chipsets, but the script can be altered for Atheros or other routers pretty easily.

To run it, you’ll need to create the following as a startup script for your router. I suggest starting it after everything else has started in order to avoid interrupting other processes on your AP

Original simple code:

#!/bin/sh
# seconds between checks
WATCHDOG_SLEEP_SEC=2
# MAC Address 1
MAC_ADDRESS_1="[XX:XX:XX:XX:XX:XX]"
# MAC Address 2
MAC_ADDRESS_2="[YY:YY:YY:YY:YY:YY]"
# Vera VSwitch 1 Device ID
VSWITCH_1="[99]"
# Vera VSwitch 2 Device ID
VSWITCH_2="[100]"

#This loop will check if a device is registered on the AP and send the on/off command to vera. 

while sleep $WATCHDOG_SLEEP_SEC
do
if wl assoclist | grep -Fq $MAC_ADDRESS_1
then
    #echo Device 1 user is in
    wget -qs "http://[YOUR_VERA_IP_ADDRESS]:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_1&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=1"
else
    #echo Device 1 user is out
    wget -qs "http://[YOUR_VERA_IP_ADDRESS]:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_1&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=0"
fi

if wl assoclist | grep -Fq $MAC_ADDRESS_2
then
    wget -qs "http://[YOUR_VERA_IP_ADDRESS]:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_2&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=1"
else
    wget -qs "http://[YOUR_VERA_IP_ADDRESS]:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_2&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=0"
fi

done
&

[size=18pt]Update 03/26/2015 - New method contributed by Aaron. I have not tested this, but it looks good.[/size]

[ol][li]In vera - install multiswitch plugin[/li]
[li]On your Tomato router - enable JFFS[/li]
[li]Create two scripts using the following code and save with respective file names. Case-sensitive. Pay attention to extensions (remove txt). File names will be services-start and VeraOccupancy. If you’re using windows, make sure to use a linux-compatible text editor such as gedit, notepad++, editplus, etc. Notepad will not work[/li]
[li]Make sure to update VeraOccupancy script to match your environment. In particular, change the values marked XX which include your vera IP, your phones’ MAC addresses, and the device IDs for the vera multiswitch[/li]
[li](Contributed by AskewPiste: For UI7 use http://XX.XX.XX.XX:3480/data_request?id=lu_action&output_format=xml&DeviceNum=XX&serviceId=urn:dcineco-com:serviceId:MSwitch1&action=SetStatus1&newStatus1=0 for the URL)[/li]
[li]Upload both scripts to your router in the /jffs/scripts/ path. You should now have 2 files in your router: /jffs/scripts/services-start and /jffs/scripts/VeraOccupancy[/li]
[li]Set execute permissions for both files: ssh into your router and run chmod 755 /jffs/scripts/services-start and chmod 755 /jffs/scripts/VeraOccupancy[/li]
[li]Reboot your router[/li]
[li]Test by turning wifi on your devices on/off. If everything is working correctly, your multiswitch should react according to how you set it up[/li]
[li]Script your own occupancy scenes based on multiswitch status[/li][/ol]

[ol][li]Bonus: If you have multiple APs, you can add this script to those other APs as well. You should also create more devices on your multiswitch to match[/li]
[li]Bonus: To shorten the script, you can condense the conditional test by adding an OR operator like this example to test for both 2.4ghz and 5ghz at the same time. if (/usr/sbin/wl -i eth1 assoclist | grep -Fq $MAC_ADDRESS1) || (/usr/sbin/wl -i eth2 assoclist | grep -Fq $MAC_ADDRESS2)[/ol]

services-start

#!/bin/sh
# folder location:  /jffs/scripts
# file name: services-start
sh /jffs/scripts/VeraOccupancy &

VeraOccupancy

#!/bin/sh
#set -x			# activate debugging when launched from cmd
# folder location:  /jffs/scripts 
# file name: VeraOccupancy
# version: 2.00

# Instructions:
# modifying code - search for and replace all XX

# when using less than 4 MAC addresses: you must remove code for the other MACs
# when adding additional MAC addresses: ensure you understand each section needs to be replicateduplicate

# to be added to future versions... User Constants for all variables; Single code Loop to iterate through all MACs


# Vera Device & Button reference - place your info here to remind yourself
# MAC1 = Device: Occupancy Trigger (246) button 5
# MAC2 = Device: Occupancy Trigger (246) button 6
# MAC3 = Device: Wifi Tracking (278) button 3
# MAC4 = Device: Wifi Tracking (278) button 1

# User Constants
MAC_ADDRESS_1="XX:XX:XX:XX:XX:XX" # HTC
MAC_ADDRESS_2="XX:XX:XX:XX:XX:XX"  # Samsung
MAC_ADDRESS_3="XX:XX:XX:XX:XX:XX"  # WindowsPC
MAC_ADDRESS_4="XX:XX:XX:XX:XX:XX"  # FireTV

VERAURL=""http://XX.XX.XX.XX:3480/data_request?id=variableset&DeviceNum=XXserviceId=urn:dcineco-com:serviceId:MSwitch1&Variable="
VERAURL2="http://XX.XX.XX.XX:3480/data_request?id=variableset&DeviceNum=XX&serviceId=urn:dcineco-com:serviceId:MSwitch1&Variable="



WATCHDOG_SLEEP_SEC=10
a1_2ghz_last="0"
a1_5ghz_last="0"
a2_2ghz_last="0"
a2_5ghz_last="0"
a3_2ghz_last="0"
a3_5ghz_last="0"
a4_2ghz_last="0"
a4_5ghz_last="0"
x=0
y=0

while sleep $WATCHDOG_SLEEP_SEC
do
        if [ "$x" == 60 ]; then
                # Every 10 minutes or so we do them all again, just in case Vera missed something
                x=0
                a1_2ghz_last="0"
                a1_5ghz_last="0"
				a2_2ghz_last="0"
				a2_5ghz_last="0"
				a3_2ghz_last="0"
				a3_5ghz_last="0"
				a4_2ghz_last="0"
				a4_5ghz_last="0"
        fi
        x=$(( $x + 1 ))

# Monitor MAC_ADDRESS_1

# 2.4ghz band
a1_2ghz_new=`wl -i eth1 assoclist | grep $MAC_ADDRESS_1`
if [ "$a1_2ghz_new" == "$a1_2ghz_last" ] ; then
	sleep 0
   else
	a1_2ghz_last="$a1_2ghz_new"
if [ "$a1_2ghz_new" == "assoclist $MAC_ADDRESS_1" ]; then
	wget -qs "${VERAURL}StatusXX&Value=1"
fi
fi


# 5ghz band
a1_5ghz_new=`wl -i eth2 assoclist | grep $MAC_ADDRESS_1`
if [ "$a1_5ghz_new" == "$a1_5ghz_last" ] ; then
	sleep 0
   else
	a1_5ghz_last="$a1_5ghz_new"
if [ "$a1_5ghz_new" == "assoclist $MAC_ADDRESS_1" ]; then
	wget -qs "${VERAURL}StatusXX&Value=1"
fi
fi


if [ -z "$a1_2ghz_new" ] && [ -z "$a1_5ghz_new" ] ; then
wget -qs "${VERAURL}StatusXX&Value=0"
fi


# Monitor MAC_ADDRESS_2

# 2.4ghz band
a2_2ghz_new=`wl -i eth1 assoclist | grep $MAC_ADDRESS_2`
if [ "$a2_2ghz_new" == "$a2_2ghz_last" ] ; then
	sleep 0
   else
	a2_2ghz_last="$a2_2ghz_new"
if [ "$a2_2ghz_new" == "assoclist $MAC_ADDRESS_2" ]; then
	wget -qs "${VERAURL}StatusXX&Value=1"
fi
fi


# 5ghz band
a2_5ghz_new=`wl -i eth2 assoclist | grep $MAC_ADDRESS_2`
if [ "$a2_5ghz_new" == "$a2_5ghz_last" ] ; then
	sleep 0
   else
	a2_5ghz_last="$a2_5ghz_new"
if [ "$a2_5ghz_new" == "assoclist $MAC_ADDRESS_2" ]; then
	wget -qs "${VERAURL}StatusXX&Value=1"
fi
fi

if [ -z "$a2_2ghz_new" ] && [ -z "$a2_5ghz_new" ] ; then
wget -qs "${VERAURL}StatusXX&Value=0"
fi

# Monitor MAC_ADDRESS_3

# 2.4ghz band
a3_2ghz_new=`wl -i eth1 assoclist | grep $MAC_ADDRESS_3`
if [ "$a3_2ghz_new" == "$a3_2ghz_last" ] ; then
	sleep 0
   else
	a3_2ghz_last="$a3_2ghz_new"
if [ "$a3_2ghz_new" == "assoclist $MAC_ADDRESS_3" ]; then
	wget -qs "${VERAURL2}StatusXX&Value=1"
fi
fi


# 5ghz band
a3_5ghz_new=`wl -i eth2 assoclist | grep $MAC_ADDRESS_3`
if [ "$a3_5ghz_new" == "$a3_5ghz_last" ] ; then
	sleep 0
   else
	a3_5ghz_last="$a2_5ghz_new"
if [ "$a3_5ghz_new" == "assoclist $MAC_ADDRESS_3" ]; then
	wget -qs "${VERAURL2}StatusXX&Value=1"
fi
fi

if [ -z "$a3_2ghz_new" ] && [ -z "$a3_5ghz_new" ] ; then
wget -qs "${VERAURL2}StatusXX&Value=0"
fi

# Monitor MAC_ADDRESS_4

# 2.4ghz band
a4_2ghz_new=`wl -i eth1 assoclist | grep $MAC_ADDRESS_4`
if [ "$a4_2ghz_new" == "$a4_2ghz_last" ] ; then
	sleep 0
   else
	a4_2ghz_last="$a4_2ghz_new"
if [ "$a4_2ghz_new" == "assoclist $MAC_ADDRESS_4" ]; then
	wget -qs "${VERAURL2}StatusXX&Value=1"
fi
fi


# 5ghz band
a4_5ghz_new=`wl -i eth2 assoclist | grep $MAC_ADDRESS_4`
if [ "$a4_5ghz_new" == "$a4_5ghz_last" ] ; then
	sleep 0
   else
	a4_5ghz_last="$a4_5ghz_new"
if [ "$a4_5ghz_new" == "assoclist $MAC_ADDRESS_4" ]; then
	wget -qs "${VERAURL2}StatusXX&Value=1"
fi
fi

if [ -z "$a4_2ghz_new" ] && [ -z "$a4_5ghz_new" ] ; then
wget -qs "${VERAURL2}StatusXX&Value=0"
fi

done

cool idea 8)
can’t wait to try it on my dd-wrt router

Thank You @silencery

This seems to work very well and more reliable than pinging cell phones which tend to sleep occasionally.

I changed your script a little bit for my DD-WRT (E4200) router, put it in a custom script and added some code to the startup script as well. My version only calls the Vera if there is a change (computer turns off or on). My script also pings some local hosts that is connected by wire to my LAN. As an addition I also pings an external host to indicate if Internet (e.g. an external host) is accessible or not. The external host is not pinged so often since it might be considered abusive to do so.

In my case, I use a multiswitch to indicate what computers are active. Using a multiswitch I can watch up to 8 computers in a single device. See attached image how i use the multiswitch.

Here’s the DD-WRT startup script

while [ ! -e "/tmp/custom.sh" ]; do sleep 1 # wait till /tmp/custom.sh gets generated done /tmp/custom.sh &

And here is the modified occupancy script that I put in the Custom Script textbox:

[code]#!/bin/sh
WATCHDOG_SLEEP_SEC=10
MAC_ADDRESS_1=“04:xx:xx:xx:xx:77” # My Galaxy S2
c1_last_state=“0”
MAC_ADDRESS_2=“78:xx:xx:xx:xx:0B” # My sons Galaxy S2
c2_last_state=“0”
HOST_1=“htpc-lan.XXXXX.local”
h1_last_state=“x”
HOST_2=“htpc-wlan.XXXXX.local”
h2_last_state=“x”
HOST_3=“alfa-usb-wlan.XXXXX.local”
h3_last_state=“x”
HOST_4=“alfa-spoofed.XXXXX.local”
h4_last_state=“x”
HOST_5=“mackentorsken.XXXXX.local”
h5_last_state=“x”
HOST_10=“www.sunet.se”
h10_last_state=“x”
VERAURL=“http://192.168.XXX.XX:3480/data_request?id=variableset&DeviceNum=57&serviceId=urn:dcineco-com:serviceId:MSwitch1&Variable=
x=0
y=0

while sleep $WATCHDOG_SLEEP_SEC
do
if [ “$x” == 180 ]; then
# Every 30 minutes or so we do them all again, just in case Vera missed something
x=0
c1_last_state=“0”
c2_last_state=“0”
h1_last_state=“x”
h2_last_state=“x”
h3_last_state=“x”
h4_last_state=“x”
h10_last_state=“x”
fi
x=$(( $x + 1 ))

c1_new_state=`wl -a wl0.1 assoclist | grep $MAC_ADDRESS_1`
if [ "$c1_new_state" == "$c1_last_state" ] ; then
	sleep 0
else
	c1_last_state="$c1_new_state"
	if [ "$c1_new_state" == "assoclist $MAC_ADDRESS_1" ]; then
		wget -qs "${VERAURL}Status1&Value=1"
	else
		wget -qs "${VERAURL}Status1&Value=0"
	fi
fi

c2_new_state=`wl -a wl0.1 assoclist | grep $MAC_ADDRESS_2`
if [ "$c2_new_state" == "$c2_last_state" ] ; then
	sleep 0
else
	c2_last_state="$c2_new_state"
	if [ "$c2_new_state" == "assoclist $MAC_ADDRESS_2" ]; then
		wget -qs "${VERAURL}Status2&Value=1"
	else
		wget -qs "${VERAURL}Status2&Value=0"
	fi
fi

# Ping LAN hosts
h1_new_state=`ping -w 1 -c 1 $HOST_1 | grep 'received' | awk -F',' '{ print $2}' | awk '{ print $1}'`
if [ "$h1_new_state" == "$h1_last_state" ] ; then
	sleep 0
else
	h1_last_state="$h1_new_state"
	if [ "$h1_new_state" == 1 ]; then
		wget -qs "${VERAURL}Status4&Value=1"
	else
		wget -qs "${VERAURL}Status4&Value=0"
	fi
fi

h3_new_state=`ping -w 1 -c 1 $HOST_3 | grep 'received' | awk -F',' '{ print $2}' | awk '{ print $1}'`
if [ "$h3_new_state" == "$h3_last_state" ] ; then
	sleep 0
else
	h3_last_state="$h3_new_state"
	if [ "$h3_new_state" == "1" ]; then
		wget -qs "${VERAURL}Status6&Value=1"
	else
		wget -qs "${VERAURL}Status6&Value=0"
	fi
fi

h4_new_state=`ping -w 1 -c 1 $HOST_4 | grep 'received' | awk -F',' '{ print $2}' | awk '{ print $1}'`
if [ "$h4_new_state" == "$h4_last_state" ] ; then
	sleep 0
else
	h4_last_state="$h4_new_state"
	if [ "$h4_new_state" == "1" ]; then
		wget -qs "${VERAURL}Status5&Value=1"
	else
		wget -qs "${VERAURL}Status5&Value=0"
	fi
fi

h5_new_state=`ping -w 1 -c 1 $HOST_5 | grep 'received' | awk -F',' '{ print $2}' | awk '{ print $1}'`
if [ "$h5_new_state" == "$h5_last_state" ] ; then
	sleep 0
else
	h5_last_state="$h5_new_state"
	if [ "$h5_new_state" == "1" ]; then
		wget -qs "${VERAURL}Status3&Value=1"
	else
		wget -qs "${VERAURL}Status3&Value=0"
	fi
fi

if [ "$y" == 11 ]; then
	# We dont want to ping an external site so often, might be considered as abuse
	y=0
fi
y=$(( $y + 1 ))

if [ "$y" == 1 ] ; then
	h10_new_state=`ping -w 5 -c 1 $HOST_10 | grep 'received' | awk -F',' '{ print $2}' | awk '{ print $1}'`
	if [ "$h10_new_state" == "$h10_last_state" ] ; then
		sleep 0
	else
		h10_last_state="$h10_new_state"
		if [ "$h10_new_state" == "1" ]; then
			wget -qs "${VERAURL}Status8&Value=1"
		else
			wget -qs "${VERAURL}Status8&Value=0"
		fi
	fi
fi

done[/code]

You should change the script (all XXX) to reflect your Vera system configuration. Also check that you can ping hosts by name in your system, e.g. “alfa-usb-wlan.XXXXX.local”, if not you may just replace the name with an internal IP address.

Edit reason: Updated with an improved script.

Farang,

That’s awesome. Great to see you were able to improve on it :slight_smile:

Yeah, the quick script i threw together is not the most efficient since it will constantly send a signal. It’s very much overkill since we generally only need to trigger on change. I did that on our secondary access point which uses a similar script and updates a simple flat file via a CIFS share mounted to the primary access point.

There’s definite room for improvement in the script so i’m glad you were able to put something together.

On the vera side, I’m using one vswitch per household member, but yes, a multiswitch is an even better idea :slight_smile: Maybe i’ll move to that method too.

In my own tests, this method has worked surprisingly reliably; better than ping indeed. Hope it turns out the same for you in the long run.

Would it be possible to turn this into a plugin? I understand that it’s run on a router, but detecting a device by MAC sure beats ping and the need for static DHCP leases.

DD-WRT user here for the record.

Very cool… I have 4 DDWRT around the house for coverage. I’m not sure I could set it up, but might give it a try.

[quote=“S-F, post:5, topic:180260”]Would it be possible to turn this into a plugin? I understand that it’s run on a router, but detecting a device by MAC sure beats ping and the need for static DHCP leases.

DD-WRT user here for the record.[/quote]

Huh. interesting idea! I’m afraid I haven’t stepped into writing vera plugins yet so i’m not clear, but at the very least, the plugin layer would need access to ssh, ssh key exchange (to build remote execution ability on the router). If UI5 has this ability, this technically could be packaged into a plugin. I’ll see what I can dig up.

Yup, it can definitely be done with multi-units. I have a primary and secondary access point and they communicate with each other by updating a CIFS share on the primary (master) access point. It’s kinda ghetto, but it works. I’ll try and post that version of the script when I have a chance.

Yup, it can definitely be done with multi-units. I have a primary and secondary access point and they communicate with each other by updating a CIFS share on the primary (master) access point. It’s kinda ghetto, but it works. I’ll try and post that version of the script when I have a chance.[/quote]

Sounds over my head. LOL

Nah, if you can setup dd-wrt or use vera, you’re fine.

I recommend trying it on one access point first just to make sure it works to your liking. I’ll post the mult-unit instructions soon.

hmmm. My N router runs DD-WRT. I could use this to switch off recording mode on my inside camera’s when my cell is detected so it’s only on when I am away. As the inside ones are used as nanny cams for my dogs.

Another thing I could do is check on both my work and personal cell. If one leaves and the other remains during weekdays, I could email myself on the ‘left’ phone and tell my self ‘turn around dummy, you forgot your remain cell’ :slight_smile:

I have a linksys E4200 witch has a Broadcom BCM4716 chip rev 1

I tried the following code and must have done something wrong.

[code]#!/bin/sh

seconds between checks

WATCHDOG_SLEEP_SEC=2

MAC Address 1

MAC_ADDRESS_1=“F0:27:XX:XX:XX:58”

MAC Address 2

MAC_ADDRESS_2=“CC:3A:XX:XX:XX:30”

Vera VSwitch 1 Device ID

VSWITCH_1=“76”

Vera VSwitch 2 Device ID

VSWITCH_2=“77”

#This loop will check if a device is registered on the AP and send the on/off command to vera.

while sleep $WATCHDOG_SLEEP_SEC
do
if wl assoclist | grep -Fq $MAC_ADDRESS_1
then
#echo Device 1 user is in
wget -qs “http://192.168.1.210:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_1&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=1
else
#echo Device 1 user is out
wget -qs “http://192.168.1.210:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_1&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=0
fi

if wl assoclist | grep -Fq $MAC_ADDRESS_2
then
wget -qs “http://192.168.1.210:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_2&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=1
else
wget -qs “http://192.168.1.210:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_2&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=0
fi

done
&[/code]

Besides the MAC “X’s” everything is entered as seen. I saved the script as a startup under admin. - commands… Even ran it. and tried rebooting.

integlikewhoa,

Sorry to hear it’s not working. Actually, farang’s version should work better for you since he’s also on DD-WRT (i’m on Tomato), plus it’s written cleaner. Give that a shot and see if it works. If not, let me know and I’ll see if i can help find the issue.

[quote=“silencery, post:13, topic:180260”]integlikewhoa,

Sorry to hear it’s not working. Actually, farang’s version should work better for you since he’s also on DD-WRT (i’m on Tomato), plus it’s written cleaner. Give that a shot and see if it works. If not, let me know and I’ll see if i can help find the issue.[/quote]

I actually did and it throws an error soon as it run.

/bin/sh: eval: line 4: syntax error: unexpected end of file (expecting “do”)

Hrm, unfortunately, that’s a pretty general error.

It could mean syntax (as it says) or a variable somewhere was not set properly. I’ll investigate.

Just to be clear. Which part threw the error? Farang’s startup script or the occupancy script?

Were there any errors when you ran the original version I posted? If not, i assume it just ran but nothing happened?

Yours ran no errors but nothing happened.

His is the startup or first part that throws that error.

[quote=“integlikewhoa, post:16, topic:180260”]Yours ran no errors but nothing happened.

His is the startup or first part that throws that error.[/quote]

When you run mine, can you test with a static URL to ensure it works?

Replace

wget -qs “http://[YOUR_VERA_IP_ADDRESS]:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_1&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=1”

With:

wget -qs “http://192.168.1.210:3480/data_request?id=lu_action&output_format=xml&DeviceNum=76&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=1

Of course, make sure you have chixxi’s virtual switch plugin installed as well for the URL to work. It’d be a good idea to verify in a browser first.

I do have plenty of virtual switchs installed and multi switches.

I run “http://192.168.1.210:3480/data_request?id=lu_action&output_format=xml&DeviceNum=76&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=1

in a browser and it turns on the switch 76 and expected. Ill test in ddwrt now

Nothing happens, Is there any other settings in the router needed? Should I be able to run just a simple command from inside the router to see if its even getting out? Such as this?

wget -qs “http://192.168.1.210:3480/data_request?id=lu_action&output_format=xml&DeviceNum=76&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=1

I see my phone and MAC on the active list. I ahve disabled my other AP to ensure I’m connected to the main. Iv disconnected and reconnected many times.

Yup, absolutely. If you turn on SSH you can use a program like putty (if you’re on windows) and execute

wget -qs “http://192.168.1.210:3480/data_request?id=lu_action&output_format=xml&DeviceNum=76&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=1

directly from the command line in your access point. That would be a good place to start to check if the issue is on the vera side or your access point.