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


Question

Posted

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?

16 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    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
     

    • 0
    Posted

    fibaro:setGlobal(globalstatehome, " Home")

    fibaro:setGlobal(globalstatehome, "Away

     

    where globalstatehome is the variable within Home and Away

    • 0
  • Inquirer
  • Posted

    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?

    • 0
    Posted

    try under LUA

    • 0
  • Inquirer
  • Posted

    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=":-?" />

    • 0
    Posted

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

    • 0
  • Inquirer
  • Posted

    No, only string.

    • 0
    Posted

    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"}
    • 0
  • Inquirer
  • Posted

    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"}

    • 0
    Posted

    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)
    • 0
  • Inquirer
  • Posted

    Tried it, but nothing happends. Thanks for trying.

     

    Any other ideas?

    • 0
    Posted

    Tried it, but nothing happends. Thanks for trying.

     

    Any other ideas?

    Hi

    You can also use two scenes.

    • 0
    Posted

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

    • 0
    Posted

    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

    • 0
    Posted
    Hi

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

    • 0
    Posted

    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

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