"switches.on()" to a dozen lights, only affects 1/3rd of them


  • Dozen levitron dimmable switches connected to one hub, furthest switch approx 90ft
  • Created smartApp with OAuth, and gave that app access to use all 12
  • ABLE to query from a python script to get all 12 light states …


Attempting to turn them all on or off at once:

   // or this way...
   switches.each{ it.on() }

only works for 8 out of 12 of them… and its usually the same 4 that fail.
(BUT, for those 4 failed devices the on/off command DOES register in the device log)

What works

  • Switching each individual light from the SmartThings app 100% of the time
  • Calling all 12 in a python loop, so that it becomse 12 individual HTTP calls

Would these happen to be Zigbee switches? I identified a similar problem and reported it to support.

Try this code and see if it works:


1 Like

@SteveWhite - All are zwave.
wierd - delay() gave me an error.

An unexpected error occurred.',
'type': 'groovy.lang.MissingMethodException'}

but i tried this… with same results (20-40% of devices fail)

   // wasn't sure if delay option is synchronous or async, 
   // so just in case, increasing delay
   def ms=200  
        ms += 200

I guess the best option then is to call each device one by one from HTTP calls,
just seems a little disappointing, something basic like this doesn’t work.

My bad, I meant pause(120) not delay. Forget that delay is not supported by ST.

Are your switches Zigbee? I believe I have found a timing issue causing Zigbee commands to fail when controlling large groups of devices.

Works at pause(500), but not pause(400).

Wow a half a second between commands? Something may up with your mesh. How many devices do you have?

I have 12 switches on one hub and plan on putting 12 more. I read somewhere 30 seems to be the theoretical limit but I could be wrong.