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

Controlling virtual slider with scene


Question

Posted

I've connected several third party WiFi RGBW LED controllers to my HC2, using virtual devices. Now I have created a slider, which can be used to set the LED brightness.

I would like to be able to dim the lights the same way as a regular Fibaro dimmer does. This would mean building a couple of Lua pieces:

When button pushed: start sliding.

When button released: stop sliding.

This would probably not be that difficult. However, what a Fibaro dimmer also does is reverse the direction when you release and push again.

How could this be done? I would need to know, when button pushed, how much time has passed since the button was last released. And I would need to know which direction the slider was going when the button was last released.

Is there anyone who made something like this? It could also be used to control your media volume (Sonos, XBMC, etc)

Please login or register to see this image.

/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

2 answers to this question

Recommended Posts

  • 0
Posted

rb338, zwave standard not saying about direction of change report. but if you really want you can use scen activation where that information is sending

  • 0
  • Inquirer
  • Posted

    A.Socha, Not sure what you meant. I did get it to work - partly.

    I've created a scene with some code:

    Please login or register to see this code.

    This works. When I hold the button, I can see the slider move.

    HOWEVER the action associated to the slider is NOT being executed!

    This is what the slider does (apart from setting the variables):

    Please login or register to see this code.

    When I click the slider or move it about from the web interface or iOS app, it works fine. Just not when the value is changed from a scene.

    Is this a known bug? Am I doing something wrong?

    [ Added: 2014-03-20, 07:35 ]

    Reported bug #1285.

    [ Added: 2014-03-21, 07:18 ]

    As also noted on the bug report:

    The problem seems to be that I should not use:

    fibaro:call(deviceId, "setProperty", "ui.SliderDimmer.value", i)

    But:

    fibaro:call(deviceId, "setSlider", "3", i)

    Somehow, setProperty will only change the slider value and not execute the code that's part of the slider, and setSlider (which has to call the slider with a number, instead of the name like with setProperty) will actually execute the code.

    So maybe more a feature than a bug, but the inconsistenties are confusing.

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