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

Simple Slider to change Dimmer


Question

Posted

hi Guys, 

 

Looking for simple function/code to change the value of a dimmer based on slider. cant seem to find any reference to this on forum or net. 

 

Thanks in advance

 

6 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    SOLVED

    Not sure if this is the best way to do it, but thought id share for future reference for newbies like me :

     

    on the Virtual Device Slider, Type Lua

    Please login or register to see this code.

    What im doing is getting the value of that slider and setting the dimmer to that value. 

    • 0
    Posted

    How does the slider on VD gets its initial value?
    I tried

    Please login or register to see this code.

    in the main loop.

    But that runs every second and "overrules"  a slow move with the slider.

    • 0
    Posted

    if you want the slider to set the dim value of the light then paste this code in the slider object:

    Please login or register to see this code.

    Change LIGHT_ID to the ID of the light being controlled.

     

     

    To set the slider value to the current light value paste this in the main loop:

    Please login or register to see this code.

    Update Slider123 = with the ID of the slider

    Change LIGHT_ID to the ID of the light being controlled.

    Change VD_ID to the ID of the virtual device

    • 0
    Posted

    SOLVED #2

     

    Thank you Aleks,

     

    Clean code and it runs perfectly.

    • 0
    Posted

    Hi, is there any way I can control a slider on HCL?

    • 0
    Posted

    Firtsly very new to coding , I am trying to control a shelly dimmer with a slider.  Here is the code that I have but it isnt working.  Can anyone help?

    local device    = fibaro:getSelfId()
    local ipaddress = fibaro:getValue(device, "IPAddress")
    local port         = fibaro:getValue(device, "TCPPort")
    SliderVal = fibaro:getValue(145, "ui.Button3.value");
    fibaro:call(145, "setSlider", "3", "SliderVal");
    fibaro:debug(SliderVal);

     

    Thanks

     

    Kenny

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