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

Limit Value for Slider in Virtual Device


Question

Posted

I am trying to put a Virtual Device that allows me to boost the heating in the house from 1 hour to 10. However, the slider has values going from 1 to 100.
 
 
 
Is there a way of limiting the range for slider to 10? I will for the time being read it and divide it by 10 to get me there but a 1-10 would be a better solution for me.
 

If anyone has a Virtual Device that they have already setup, if you can share this, then it would be great.
Thanks
Raj

Please login or register to see this attachment.

3 answers to this question

Recommended Posts

  • 0
Posted

Did you find out how to limit the range on slider? I also need this =)

  • 0
Posted

You can use operator modulo to calculate whatever range you need taking as an input the slider value 0-100 

 

eg.

place the following in the slider definition :

 

 

local suwak1 = 9+fibaro:getValue(fibaro:getSelfId(), 'ui.Slider1.value')
suwak1 = (suwak1/10 - suwak1%10/10)/10

 

 

 

the local variable 'suwak1' will have one of the the values    0 , 0.1 , 0.2 , .... , 0.9 , 1    depending on the slider position.

 

You can calculate to have whatever range you need and to skip fractions if you need.

  • 0
Posted (edited)

Tnx I'll give it a try :-D

Edited by freespirits

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