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

ON/OFF button for scenes


mercurius19

Question

Hello,

 

I just introduce myself as a newbee into the world of the Fibaro HC2.

I received today my HC2 en try to setup my system.

I created some scenes and like to put a scene on and off with a "ON/OFF" button the way the scene is deactivated and swithed off when I press the "OFF" button and activated and switched on when I press the "ON" button. I like to use this ON/OFF button via the Fibaro App on my smarthphone and via the Fibaro KeyFob.

I read something about a procedure to work with a virtual device button, can someone explain how this works.Of course ny other solution is welcome!

I look forward to some reflections to help me out as a newbee.

 

Nice greetings,

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

Welcome to the club of (frustrated) HC users.

 

Create a variable e.g. mysceneactivation with the values TRUe and FALSE. Create a VD which is changing the value of the variable to either true or false. Use this variable in the scene in the IF condition, but make sure not to use it as a trigger for the scene. That's it.

The variable is then 'only' an additional IF condition, so if the variable is false the scene is not executed, even the other conditions are all valid.

 

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Oeps, frustrated HC users? I hope it doesn't go that way, I cross my fingers ;)

     

    Thank you for your reply, I will try out what you posted. If I do not to arrive to set up what yoy wrote, I will come back. The VD looks the challenge at this moment.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • To kunoch,

    Like I mentioned I'm back.

    Regarding the VD I suppose I have to enter in the field "String te verzenden". How to setup this configuration?

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    Hi

     

    my question is you want on / off or toggle?

    I do not know what you have a plan turn on/off

    but as draft VD see the attachment

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hello,

     

    A on / off is my basic idea to switch on and off a scene. As newbee ;( what is the difference between on / off an toggle?  switch?

    Link to comment
    Share on other sites

    • 0

    idk what you wished.

    Please provide technical specification :)

     

    Edited by 10der
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I created on the HC2:

    a scene "G set OUT". A simple scene with sensors in mode "breached" in order to detect burglary and to activate an sirene.

    a variable "MySceneActivation2" with value "0"

    a predefined variable "MySceneActivation1" with values "FALSE" and "TRUE"

    a VD "ON/OFF Scene" IP-addresse 127.0.0.1 and TCP port 11111(found in lecture) and regarding the advanced settings I brewed like hereafter, try and error??

    Do you any other information?

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    Sorry. I do not understand you.

    Do you want set on / off global param via VD ?!

     

    btw: use spellchecker

    Authorization: Basic QWFhYWE6YmJiYg== plus your code wrong

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • To 10der,

     

    See my first post dated 26/03/17.

    A member of the forum replyed the idea you find hereafter as possible solution. This idea I like to setup, but regarding the settings of the VD, as newbee I do not uderstand anything. Do not look to my try and error about the VD I do not know yet the LUA language ;(

    "Create a variable e.g. mysceneactivation with the values TRUe and FALSE. Create a VD which is changing the value of the variable to either true or false. Use this variable in the scene in the IF condition, but make sure not to use it as a trigger for the scene. That's it.

    The variable is then 'only' an additional IF condition, so if the variable is false the scene is not executed, even the other conditions are all valid."

    BTW I can't open your attachment New_Device.vfib ;(

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @kunoch : I read your cookbook, I understand "How To". It is a great work to understand better VD and variables. During the weekend I will try to apply with the HC2 what you wrote in chapter 5. I keep you informed.

    Thx for you follow up ;)

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @kunoch : I work to setup my plan by following your cookbook. I have to say that at this moment I do not have a lot of luck, it does not work. I added an attachment with my creations, please check once and inform me about "how to" reach my goal.

    Thx for your reply ;)

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    You can make a scene to turn on/off other scene, the code would be the following:

    Please login or register to see this code.


    put the id of the controlled scene on which you act in variable sceneID

    Please login or register to see this code.


    The On/Off scene, can be executed from the Fibaro App on your smarthphone, if the controlled scene is on it will turn it off and the reverse.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thx for your code, looks what I looking for.

    Before I start, Pls confirm my concern below.

    40 minutes ago, linkey said:

    local sceneID = 7      -- I suppose this is the ID of the On/Off scene?

     

    40 minutes ago, linkey said:

    local sceneRunConfig = fibaro:getSceneRunConfig(sceneID)      -- I suppose this (sceneID) is the ID of the scene to activate and deactivate?

     

    Link to comment
    Share on other sites

    • 0

    Please login or register to see this code.

     

    Please login or register to see this code.

    The code is for the scene that you will use from smartphone, it don't need to know its own id, only de id of the scene on which is acted.

    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.

    ×
    ×
    • Create New...