Page 1 of 1

aqara wall switch selector switch

Posted: Friday 30 August 2019 10:59
by tjabas
Hi!

i have an Aqara zigbee wireless wall switch with 2 buttons, in domoticz it shows an an selector switch, in the device manager it shows as only one switch, my plan was to use this aqara switch to control 2 diferent lights but with only one selector switch in domoticz i really dont know how i can use it in blocky.

do you have any suggestions?

Re: aqara wall switch selector switch

Posted: Friday 30 August 2019 11:15
by domogijs
Hi


Aqara wall swich uses 4 states; off, switch 1, switch 2, BothClick

I dont use blocky but dzevents. the script looks something like this:

Code: Select all

return {
	on = {
		devices = {
			'wallswitch'
		}
	},
	execute = function(domoticz, switch)
	   if (switch.state == 'Switch 2') then 
	     
	     domoticz.devices('lamp').toggleSwitch()
		
	end
end
}
Hopes this helps

Greets Gijs (noob but trying to contribute to the community)

Re: aqara wall switch selector switch

Posted: Friday 30 August 2019 11:20
by tjabas
thanks, but i dont use script, i really dont know how to use it, im stuck with blocky, is it possible to do all in blocky?

Re: aqara wall switch selector switch

Posted: Friday 30 August 2019 22:10
by gerbenvanasselt
Hi Tjabas,

This is an example of a blocky with using a selector switch. I hope this is what you are searching for.
Just place a variable in domosettings --> uservariables.

Image

this is the xml to import it:
Blocklyxml.txt
(4.41 KiB) Downloaded 123 times

Re: aqara wall switch selector switch

Posted: Friday 30 August 2019 22:29
by tjabas
Thank you, that is exactly what im looking for :)

Re: aqara wall switch selector switch

Posted: Friday 30 August 2019 22:46
by gerbenvanasselt
You're welcome, if I can save you the research time it is great.

Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk


Re: aqara wall switch selector switch

Posted: Friday 30 August 2019 23:21
by tjabas
sorry but i didnt have any luck with this blocky, i made an user variable, like this: 6 toggle switch String [0,1,2] 2019-08-30 23:08:28

i dont know if its right.

but i cant seem to understand where i should ad the light buld that i want to turn on by this aqara switch. in blocky i mean

Re: aqara wall switch selector switch

Posted: Saturday 31 August 2019 12:19
by gerbenvanasselt
You have to replace the url part with the light name and add status on or of.
You can use json url to dim a bulb.

Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk


Re: aqara wall switch selector switch

Posted: Saturday 31 August 2019 12:28
by tjabas
i found this: http://127.0.0.1:8080/json.htm?type=com ... cmd=Toggle


works great , thank you all for the help :)

Re: aqara wall switch selector switch

Posted: Saturday 31 August 2019 14:45
by gerbenvanasselt
Yes indeed, did not know about the json toggle version. Thanks for sharing. But nowadays I start dzvents which has a toggling option in it.

Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk


Re: aqara wall switch selector switch

Posted: Sunday 27 December 2020 14:34
by joostvanwijk
gerbenvanasselt wrote: Friday 30 August 2019 22:10 This is an example of a blocky with using a selector switch. I hope this is what you are searching for.
Just place a variable in domosettings --> uservariables.

Image

this is the xml to import it:
Blocklyxml.txt
Thanks for the xml! I was looking for a way to use the aqara switch as a dimmer. Is this the right blocky script to do this?
I don't get the togglecount though... where do you use this for? This is not a value in my domoticz? Do I need something to do first in order to get this?

Thanks in advance!

Re: aqara wall switch selector switch

Posted: Saturday 09 January 2021 12:21
by gerbenvanasselt
The toggle count is used for creating a circle which will take it off state when highest number is reached.

This way you can use one button to do more actions. Every toggle count number is another action with one button.

Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk



Re: aqara wall switch selector switch

Posted: Saturday 09 January 2021 12:55
by tjabas
can i use this switch to dim up or down a light?

Re: aqara wall switch selector switch

Posted: Sunday 10 January 2021 10:40
by gerbenvanasselt
I think you can do a cycle with dimming from minimal bright to bright in the number off steps you want and then ending with off.

Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk


Re: aqara wall switch selector switch

Posted: Saturday 26 February 2022 2:14
by Valiran
Hello,

Sorry to dig this, but I'm facing an issue with my dual wallswitch Aqara model WXKG02LM.
I'm on rPi4 + ZigateDin.
When I add the switch, it's defined as a selector with switch 1, switch 2, BothClick. Off is hidden by default.
The problem I'm facing is that the switch stay un position.
So when I click on left (Switch 1), it stays on Left even if I release. That mean the blockly script given upper is rolling in infinte loop because the Switch value is always equal to the last button you push.
Do you know I can "park" the switch value when not pressing?

EDIT: physically, the switch is not broken, the blue light is off when I release and is blue when I press, so I believe it's only on domoticz side, or Zigate plugin side maybe?

Re: aqara wall switch selector switch

Posted: Saturday 26 February 2022 12:16
by waltervl
In zigate there is a advanced setting about the off value related to Domoticz issue #4143. You can try to switch on the setting and restart plugin.

Re: aqara wall switch selector switch

Posted: Saturday 26 February 2022 14:20
by Valiran
Hello!
That still doesn't work, the selector stays on "Switch 1" for like 2-4 seconds, and during this time, the light blink because there are 2 actions on the button: on and off :(

Re: aqara wall switch selector switch

Posted: Saturday 26 February 2022 15:15
by Valiran
Nevermind...

A simple "http://IP_DOMO:PORT_DOMO/json.htm?type=command&param=switchlight&idx=IDX_OF_LIGHT&switchcmd=Toggle" did the trick.
Now each of my switch on my 2 gangs Aqara work like and old fashioned dual light switch and that's exactly what I wanted :D

If light is off, a push put light on, and vice versa :)