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

Virtual device interface integration


Question

Posted

I created a nice virtual device (RGB control for a Philips Hue light). The interface contains on/off buttons and 4 sliders, brightness and 3 for RGB colors. All working perfectly. But it doesn't integrate too well.

So 2 questions;

1. On the main screen the VD displays some sort of power-like button (see image, device in bottom right hand corner). What does it do? Can I use or change that button?

2. The device is not listed as a 'Light'. I would like it to show up on my Android in the 'Lighting' category. How to get there? (I would like it to be presented as a dimmable light, which, after opening the device, shows the full UI to control the colors as well).

Thx. Any help is greatly appreciated.

Thijs

Please login or register to see this attachment.

9 answers to this question

Recommended Posts

  • 0
Posted

1) in the advanced tab for the VD there is a radio button for each element marked "Main". The button on the virtual device interface will activate the button marked "Main" when you press it.

2) fibaro does not allow virtual devices to be listed as other devices (i.e. A light). So you have to make due with the vd as it is.

  • 0
Posted

I can just add, that the "Main" button will be connected to first button or slider that appears in virtual device.

  • 0
  • Inquirer
  • Posted

    Thx. At least it saves me searching for solutions then.

    Is it possible to set the state of that 'main' button? and tied to that; would it be possible to change the 2 on-off buttons into a single 'toggle' button?

    • 0
    Posted

    You have to program the button manually. Do a single button with something like this:

    Please login or register to see this code.

    This is not foolproof though. It will not update according to the actual state of the light but only according to the last button push. If you want that, you need to put a piece of code in the main loop which checks the hue light json for state regularly and update the "huelighton" global. I had something that did this, but the Hue bridge is quite unreliable, so it will miss messages. Therefore you also need a check to ensure that the json-message isn't empty before parsing it. Otherwise, the whole device will halt first time it fails to receive the json from the bridge.

    I chose to scrap the single button and go for a two button setup. Then I just call the buttonpush for what I want the light to do.

    PS.: This is just a concept code, it isn't tested, so use at your own caution!

    • 0
    Posted

    Do Fibaro plan to support a Virtual Device being listed under a particular category of device?

    the problem is still there with the Plugins on the alpha version - the Philips Hue plugin device does not appear under "Lighting"...

    Makes the UI very confusing...

    • 0
    Posted

    can you please share the LUA script for the VD.

     

    Thanks.

    • 0
    Posted

    There are several topics with complete vds for controlling Hue lights.

    • 0
    Posted

    I think it would be good to allow us to enhance the default web virtual device presentation a bit more (not the one that 'pops up' with the additional elements).    Allowing us to place a couple more labels or use some more buttons, at least two for on/off with highlighting, even perhaps supporting a click action on the icon, or icons for buttons. This is to provide a bit more functionality than it does now which is too basic..  It's awkward and counter intuitive to bring up the additional interface elements sometimes.  A button to do that might be better.

     

    The device category allocation is important too.  I notice even some official plugins have this wrong - for example my Nest thermostat is in Multimedia.

     

    K

    • 0
    Posted

    Does any one already know how to exactly formulate a PUT behind a button towards a HUE server in a VD on a HCL (so no Lua)? Obviously sth this is wrong: 

     

    PUT /api/10aedbe36278c4fed660dbfb8b3c7/lights/5/state  HTTP/1.10x0D0x0A0

    Content-Length: 120x0D0x0A
    0x0D0x0A
    {"on":false}0x0D0x0A0
     
    nothing happens although in the HUE debug-console it works like a charm. 
     
    many ppl asked similar questions but obviously there is no answer, not even from Fibaro

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