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


Where to get device property information from?


icedfusion

Recommended Posts

When writing lua scripts, I can't seem to find any documentation about what information I can get from a device.

 

As an example, if I take an RGBW device, I can from within HC2 select the device and it will give me a list of properties - but I have no idea what they will return.....

 

i.e.

fibaro:getValue(RGBW_ID, "value");

 

Where do I get the list of possible 'value' return values from for the RGBW device (and all other devices) so that I can do a comparison to continue my scripts - I can't seem to find any help in the docs for this.

 

Equally, if I want to know if the device is 'on' or 'off' - if this is not listed in the device properties, is it not possible to determine if the device is on or off?

 

Cheers

 

ice.

Link to comment
Share on other sites

Hi @icedfusion,

 

It is very simple to check what you get as answer with function fibaro:getValue(deviceID, "value") just make one test scene or VD with button and use this code:

Please login or register to see this code.

To check if device is turned On or is turned Off you use same function:

Please login or register to see this code.

If you get 0 (zero) for answer then device is turned off. If you get answer that is bigger than 0 (1 - 99) then device is turned On. Switches, relays and wall plugs will always return 1 if they are turned on, while dimmer, roller shutter and some other modules will return value between 1 -- 99 depending on brightness or position of the blinds etc.

 

When you are editing scenes code in HC2 web GUI interface then on the left column you have Devices list from which you can find device and all its properties and actions that you can select. When selected it will appear in code at cursor position. Also if you are editing code in virtual device then if you right click in code menu will appear from which you can select device properties or action.

 

  • Like 1
Link to comment
Share on other sites

  • 5 years later...

What if you just get "nil" all the time? I have roller shutters from Elero. I can controll them via "open", "close" and "stop" but soemthing like this always returns "nil":

 

fibaro.debug("SCENE4", fibaro.getValue(22"value"))

 

Also I would like to know if there is a way to set specific values, thus a position. The shutters have 2 favorite positions which are even supported by the Yubii Home app and web interface. And the shutters are said to be bi-directional, so I would expect that they send their position back to the box. The documentation from Fibaro only states one generic string as example but there is no list of properties anywhere. This might be depending on the exact device to be controlled, yes. But maybe there are some lists somewhere?

 

 
 
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
Reply to this topic...

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