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

How to make a virtual device to switch between home and away


Den James

Question

How can I make a virtual device to switch between the variable Home and Away? I made the variables Home and Away.

 

Then I made a VD. I chose '2 buttons' and labeld them 'Home' and 'Away'. But what do I fill in at ID and the textbox under ID?

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Got the sollution. Was like Kage said, but with a few things extra I forgot. So thanks Kage for getting me started.

     

     

    PUT /api/globalVariables/globalstatehome HTTP/1.1
    Host: 127.0.0.1
    Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxx
     
    {"name":"globalstatehome","value":"weg"}


    IP adres VD has to be set to 127.0.0.1 and port 11111.
    Change xxxxxxxxxxxxxxxxxxxxxx by the string you make on following website

    Please login or register to see this link.


    If you loging and pasword are both admin, you put admin:admin on the website and convert.
    You will get: YWRtaW46YWRtaW4=
    Fill this in on the xxxxxxxxxxxxxxxxxxxxxxxxx
     

    Link to comment
    Share on other sites

    • 0

    fibaro:setGlobal(globalstatehome, " Home")

    fibaro:setGlobal(globalstatehome, "Away

     

    where globalstatehome is the variable within Home and Away

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I filled the above in under string in the VD. A button for Home and a button for away.

     

    I first made a predifined variable. I named it 'Globalstatehome' and with values 'home' and 'away'

     

    Then I made a scene and set that a light had to go on when the sun goes down AND when the variable is set to AWAY.

     

    But nothing happends. I clicked on AWAY in my VD.

     

    What could be the problem?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I've got a HC Lite and this doesn't support LUA.

    Please login or register to see this image.

    /emoticons/default_icon_confused.gif" alt=":-?" />

    Link to comment
    Share on other sites

    • 0

    doesn't have your VD a button for string and one for LUA

    Link to comment
    Share on other sites

    • 0

    try something like this

     

    PUT /api/globalVariables/YOUR_VARIABLE HTTP/1.1

    Host: 127.0.0.1
    Authorization: Basic YOUR _ADMIN:PASSWORD
     
    {"name":"YOUR_VARIABLE","value":"THE VALUE CHANGE"}
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • So I put all this by STRING?

     

    I changed it to my settings. Could this be right? The ***** are where my pasword comes.

     

    PUT /api/globalVariables/globalstatehome HTTP/1.1
    Host: 127.0.0.1
    Authorization: Basic YOUR _ADMIN:*******
     
    {"globalstatehome":"YOUR_VARIABLE","thuis":"THE VALUE CHANGE"}

    Link to comment
    Share on other sites

    • 0

    PUT /api/globalVariables/globalstatehome HTTP/1.1

    Host: 127.0.0.1
    Authorization: Basic admin:******
     
    {"name":"globalstatehome","value":"Home"}
     
     
    That is my idee (don't no if it works but gif it a try)
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Tried it, but nothing happends. Thanks for trying.

     

    Any other ideas?

    Link to comment
    Share on other sites

    • 0

    Tried it, but nothing happends. Thanks for trying.

     

    Any other ideas?

    Hi

    You can also use two scenes.

    Link to comment
    Share on other sites

    • 0

    Nicely done. Two minds.......

    Link to comment
    Share on other sites

    • 0

    Thanks Guys been trying to work this out for some time. Now all works.  Wish there was more info on virtual device for the HCL and what you can actually do

    Link to comment
    Share on other sites

    • 0
    Hi

    Thanks guys it works great, is clearly better than scenes.

    Link to comment
    Share on other sites

    • 0

    Btw, if you are using 127.0.0.1 and port 11111, then you can leave out the authorization part. It's only needed for regular API which is running on port 80

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
    ×
    ×
    • Create New...