Question about Trigger, conditions and If-Then

Hello everyone,

I’m attempting a gradual migration from Home Assistant (HA) to Gladys to see if it simplifies my home automation.

I’m confused about scenes.

I want to do an If/Else with a Xiaomi click button on Zigbee.
So as triggers I’ve set single click and double click.

Now I don’t understand how I check that it’s a single click?

My goal is

  • If Single Click

Hi @McFlyPartages :slight_smile:

Awesome :star_struck:

Indeed, currently you have to use the action « Retrieve the last state »

Single click = 1
Double click = 2

I admit this part could be improved in Gladys, because as it stands, the action « Condition on variables » isn’t « aware » of what it’s comparing and doesn’t provide a list of values :smiley:

The list of values is defined here in Gladys

1 Like

oh, if I had known that earlier, it would have saved me from sending myself lots of messages to figure out which numeric state of the button to use :sweat_smile:

Be careful, you’ll need to see if you should retrieve single click/double click or another state.
I recommend testing the two separately at first:
if single click then message:single click
if double click then message:double click
On my side, I have to test with a press for example:


2 Likes

So it makes the scenes quite heavy.

Thanks.

1 Like

Why do you need a single click or double click?
It depends on how your VMC (mechanical ventilation system) is triggered — for example, mine is connected directly to a switch. So when I click the button it’s enough to use the « invert outlets » function.
No need to fuss about clicking once or twice :wink:

1 Like

Exactly, I often create dynamic mechanisms to transition from one situation to another!

Yes, that’s a solution, but I did make full use of the buttons. One button, multiple functions.