Jump to content
  • 0

[SCENE] not triggered by variable


Question

I am still testing around the usage of variables and tried the following simple thing.

I do have a predefined variable having two values being ON and OFF.

I do have a scene (automatic) which switches on a wall plug, when the variable is in its OFF status and sets the variable to ON.

If variable=ON the "switch on" and set variable to ON

nothing happens.

Only when I restart HCL, the scene is triggered. When I then switch the variable to OFF in the variable panel, nothing happens.

What I also noticed. when the variable is switched ON and I manually trigger the scene, the wall plug is switched ON, even the trigger condition of the variable being OFF is not fulfilled, how comes?

this somehow makes the usage of variables as trigger conditions useless.

anyone having a clue?

 

Link to post
Share on other sites

Recommended Posts

  • 0

Hi
If you change a variable in the variable panel, it does not seem like a trigger, so Fibaro has made it.

Your trigger marking is important.

Can you send some images of the scenes, with trigger marking.

 

Edited by hTiger1
Link to post
Share on other sites
  • 0

Simple lua to change variable.

This change the global On And Off

 

fibaro:setGlobal( 'On', ON)

fibaro:setGlobal( 'Off', OFF)

 

 

Edited by sonnyboy
Link to post
Share on other sites
  • 0

I know how to change variable. It works fine through VD. But problem comes if I want to use that same variable in scenes.

 

For example:

 

IF VARIABLE=0 THEN START X

IF VARIABLE=1 THEN START Y

 

Unfortunately it wont start ever any scene even if it is in automatic mode.

 

739a7ef94a9a4ce7a0d6d8d6d227a1cb.jpegcca890c7aeb445949ec77317567cfbdd.jpeg

Edited by plutonium
Link to post
Share on other sites
  • 0
12 hours ago, plutonium said:

I know how to change variable. It works fine through VD. But problem comes if I want to use that same variable in scenes.

 

For example:

 

IF VARIABLE=0 THEN START X

IF VARIABLE=1 THEN START Y

 

Unfortunately it wont start ever any scene even if it is in automatic mode.

 

739a7ef94a9a4ce7a0d6d8d6d227a1cb.jpegcca890c7aeb445949ec77317567cfbdd.jpeg

Hi
Have tested your little example and it works perfectly with me, maybe it can help.
"Test scenes" are similar to yours, (Test = 0) from startup.
"Activerscene" is a manual scene that changes to (Test = 1).
I have both windows next to each other and I can see that the "Test scene" runs automatically when I click on the "Activation scene".

The VD is also executed as it should.

 

5900621aae8f0_Screenshot-26-04-201710_52_48.jpg.59fccbed079bf2b12b655eb6321d6871.jpg590063b81d69e_Screenshot-26-04-201711_08_35.thumb.jpg.d0a3c2a28cc913028c7663e750ba1e21.jpg  5900622c70082_Screenshot-26-04-201710_55_28.thumb.jpg.c3e700d669cef40f0af2c4062475eaa5.jpg

5900623373cbf_Screenshot-26-04-201710_57_08.thumb.jpg.b72dbb577dd8be178951fb5648ae1d76.jpg5900623925a37_Screenshot-26-04-201710_57_42.thumb.jpg.4dc8a7c6bf1f0b7d65ae2545338eb4a4.jpg

 

 

Edited by hTiger1
Link to post
Share on other sites
  • 0

I think this is not exactly what I was looking for.

 

I have virtual device created with 2 buttons. One button changes value to 1, another to 0. Variable changes and works perfectly.

 

Then I created scene as upside and scene not running at all.

 

Here is bad screen picture how my VD looks like:

454ee34f41bd4903b6ba2d32ccf5d79a.png

 

If I press HOLIDAY button it will change variable in 0. If i press EVERYDAY variable it will change variable in 1.

Then I created scene where I said.....IF variable is 0 DO something.. (This is not executed at all)....scene never starts.

Link to post
Share on other sites
  • 0
1 hour ago, plutonium said:

I think this is not exactly what I was looking for.

 

I have virtual device created with 2 buttons. One button changes value to 1, another to 0. Variable changes and works perfectly.

 

Then I created scene as upside and scene not running at all.

 

Here is bad screen picture how my VD looks like:

454ee34f41bd4903b6ba2d32ccf5d79a.png

 

If I press HOLIDAY button it will change variable in 0. If i press EVERYDAY variable it will change variable in 1.

Then I created scene where I said.....IF variable is 0 DO something.. (This is not executed at all)....scene never starts.

Hi
Have recreated your senary, it does not work for me.

Same mistake as you have.:)
Fibaro you want to fix it!

Link to post
Share on other sites
  • 0

I also intended to use a VD first and then as this did not work I changed the variable manually (trigger is the variable and scene is started when HCL starts). Just no reaction when the variable changes its value.

The manual trigger also worries me somehow as it triggers (executes the THEN) even the trigger condition is wrong. Or does manual trigger immediately jumps to the THEN section, disregarding the IF?

When I combine the variable trigger with a 'real' trigger (4-button wall switch), then it works like supposed.

But thanks for the feedback, so I am not the only one.

 

Link to post
Share on other sites
  • 0

For change of variable and on that change trigger some scene, please look at post in link below. then if you change variable, scene should be also triggered.

 

Link to post
Share on other sites
  • 0
2 hours ago, jakub.jezek said:

For change of variable and on that change trigger some scene, please look at post in link below. then if you change variable, scene should be also triggered.

Hi
Thanks.
It looks like something that can only be used on HC2?

 

Link to post
Share on other sites
  • 0

But can not be true that to be able to do something with the HCL, everybody has to rely on friendly forum members to create a working VD in HC2 to be then loaded into the HCL.

I would love being able to do it myself. I would even assume it is possible, if the available docs would be more precise on the nitty gritty details. Like on the Rapsi with OpenHAB (the "hard" way of doing homeautomation)

Link to post
Share on other sites
  • 0

@kunoch @hTiger1 Here is the solution!! :)

 

1. Create scene that will change variable from 0-1 (MANUALLY) - I call it "Normalni rad" on my native language, eng. "Normal work". Name of previously created variable is TEST with possible values 1 and 0 (you can call it whatever you like).

121cb34b1c5a4936a6677606ddb07d68.png57de459f676e4af6af83f8b852ecace6.png

 

2. Create scene that will change variable from 1-0 (MANUALLY). - I call it "Praznici" on my native language, eng. "Holiday mode".

669a581deb2841da972ee627eaf59721.pngfccfb0a77c1a4c3a9b223bfe79f1553f.png

 

3. Create VD with 2 buttons HOLIDAY & EVERYDAY and LABEL (which will say currently active mode). Also you can change icons for each mode to look little bit better :).

1b9cad9d4d4e4022ac3af23540439f6f.png9eb53a9e0eef49cfb85a0573edf09eb5.png

 

Hope it helps :)

 

NOTE: You can also HIDE sceenes an you will not see them even if they will work normally.

Edited by plutonium
Link to post
Share on other sites
  • 0

@kunoch and @hTiger1,

 

Now i got into office and i made some very quick VD. I'm switching globalVariable named test between values 1 or 2. I made this VD on HCL and tested it both in HCL and HC2 and it works.

 

VDs here: test-GV (1).vfib

Button example with notes:

PUT /api/globalVariables/test HTTP/1.1   --> PUT for change; then path to variable with it's name; HTTP protocl
Host: 127.0.0.1                          --> local IP adress of HCL
Content-Lenght: 33                       --> Total lenght of body (located at the end of code
Authorization: Basic YWRtaW46YWRtaW4=    --> Uthorization to HCL (admin) encoded in Base64: Credentials are admin:admin
										 --> empty line for HTTP to recognize head from body (above is head and below is body)
{"value":"1","invokeScenes":true}        --> Body

 

 

 

 

Link to post
Share on other sites
  • 0

@jakub.jezek

maybe a very silly question:

{"value":"1","invokeScenes":true}

in the PUT line you refer to the variable test but here to something different. I do not fully get it. or is the ID of the scene you trigger 1?

Thanks for clarification.

Link to post
Share on other sites
  • 0

I'm changing value of predefined global variable named test. That variable name serves as Id also.

 

I have there 2 predefined values. One is value "1" and second is value "2". With that PUT I'm changing value of the variable.

 

And in cases of global variable I do not need to have "ID" or "name" in the body.

 

With "invokeScenes" I'm triggering some scene, that has value of variable test in a condition.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...