Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

[SCENE] not triggered by variable


kunoch
 Share

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 comment
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 comment
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 comment
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.

 

Please login or register to see this image.

cca890c7aeb445949ec77317567cfbdd.jpeg

Edited by plutonium
Link to comment
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.

 

Please login or register to see this link.

Please login or register to see this link.

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.

 

Please login or register to see this image.

/monthly_2017_04/5900621aae8f0_Screenshot-26-04-201710_52_48.jpg.59fccbed079bf2b12b655eb6321d6871.jpg" />

Please login or register to see this attachment.

  

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

 

 

Edited by hTiger1
Link to comment
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:

Please login or register to see this image.

 

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 comment
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:

Please login or register to see this image.

 

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 comment
Share on other sites

  • 0
  • Inquirer
  • 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 comment
    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 comment
    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 comment
    Share on other sites

    • 0

    @hTiger1, it is possible, but you have to make http head and json body. When i get to office, i will make one vd and post it here.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 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 comment
    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 comment
    Share on other sites

    • 0
  • Inquirer
  • @plutonium Thanks a lot. I will give it a try and report back

    Link to comment
    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:

    Please login or register to see this attachment.

    Button example with notes:

    Please login or register to see this code.

     

     

     

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @jakub.jezek

    maybe a very silly question:

    Please login or register to see this code.

    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 comment
    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 comment
    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.

     Share

    ×
    ×
    • Create New...