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

Showing status variable in the iOS App


Danielos

Question

Hi all,

 

I have a global variable with the presence status. Now, I want to show this status in the fibaro ios app. Are there any ideas how I could realize that? 


Thank you very much!

 

Dan

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hi Dan,

 

I made a VD with some buttons to change the global variable.

 

example: 

fibaro:setGlobal("Aanwezig", "Aanwezig");

 

Then upload an image for each variable value and put the Lua code below in main loop.

Adjust the numbers to the id of the representing image.

In my example the variable = Aanwezig

This variable has four posible values: Aanwezig, Afwezig, NietStoren or Vakantie.

If the variable can't be identified then it will be Ongebekend.

 

local iconAanwezig       = 1092;
local iconAfwezig          = 1093;
local iconOnbekend      = 1102;
local iconVakantie         = 1091;
local iconNietStoren      = 1136;

 

vDeviceID = fibaro:getSelfId()

 

  if fibaro:getGlobalValue("Aanwezig") == "Aanwezig" then
  fibaro:call(vDeviceID, "setProperty", "currentIcon", iconAanwezig)  
  else if fibaro:getGlobalValue("Aanwezig") == "Afwezig" then  
  fibaro:call(vDeviceID, "setProperty", "currentIcon", iconAfwezig);
  else if fibaro:getGlobalValue("Aanwezig") == "Vakantie" then  
  fibaro:call(vDeviceID, "setProperty", "currentIcon", iconVakantie);
  else if fibaro:getGlobalValue("Aanwezig") == "Niet storen" then  
  fibaro:call(vDeviceID, "setProperty", "currentIcon", iconNietStoren); 
  else fibaro:call(vDeviceID, "setProperty", "currentIcon", iconOnbekend);
end
end
end
  end

 

You can then Always recognise the velue of the variable by the image in the VD

 

Please login or register to see this image.

/monthly_2019_02/image.png.f14a26b9bef054996370e94899db6196.png" alt="image.png.f14a26b9bef054996370e94899db6196.png" />

  • Thanks 1
Link to comment
Share on other sites

  • 0
  • Inquirer
  • @Langedijk thank you very much for your answer. sounds interesting. And you can see the status in your iOS / Android Fibaro App, too?

    Link to comment
    Share on other sites

    • 0

    Yes, you will find the coresponding image that you assign to thevariable in the top right corner of the VD on Android and iPhone app and on the web based interface.

     

    The VD is attached, just rename the viriable values and image ID to your needs.

     

     

    Please login or register to see this attachment.

    • Thanks 1
    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...