Have problem when writing smartapp for multiswitches switch


(Dang Anh Minh) #1

Hi, I’m using switches which have more than one switch in one device (Www.lumi.vn). So far, these switches work fine with their devicehandler.
But I have problem when using smartapp to control each invidual switch, while I can turn on/off all the switches in one device with smartapps.
I’ve tried to write a dmartapp with the code have something like:
Switch.on1()
Or switch.off1
On1, off1 is the parameter of switch 1 in my devicehandler

But it doesn’t work, it seems use only parameter on() , off().

Any ideas?

I’m using my phone to post so can not copy the code, the interface of thing. I will send later if needed.
Many thanks,

Minh.


(Scott G) #2

Posting the code of both the SmartApp and Device Handler would help to see what might be going on.

You should be able to call the command used to turn switch 1 on/off from the SmartApp. Is Switch the input name you used in the preference section of the SmartApp? In the device handler is the command for switch 1 on1()? If so, then your switch.on1() line should work.

It’s really hard to help debug without the code though.


(Dang Anh Minh) #3

Hi Scott, thank you for willing to help.

Fortunately, I find out the way to have them works. Each child switch have the prameter like “switch1” and comes together action “on1”. I’ve tried that before but they didn’t work. Maybe because I’m not a coder so my code had something wrong that time.

Now everything works fine. And it also maybe the good news for whom using US hub but want to use with 220v 50hz.
Try this: www.lumi.vn. They use their own profile so you have to ask for switches use with ST. I wish I know them sooner because I bought an Us hub before, I prefer to have Us hub cause I can buy cheaper and easier, I would want to buy more devices using battery from Us.