How can I change the opacity of an image based on dimmer level?

Hi everyone,

My first post here. I am a former iRule user and started with HR about 2 weeks ago. So far I am very satisfied with the app, thanks to the people who made this!

At the moment I have modified a standard light tile with a light image that turns on and off. I would also like to modify the dimmer tile with the same light image, but I would like the brightness of the light to correspond to the percentage of the dimmer. I want to do that by adjusting the opacity of the image based on {Binding @ Device.Level}. So I have defined a data trigger with property ‘opacity’ and value {Binding @ Device.Level}. It seems that {Binding @ Device.Level} is being taken as a value because I see the image of the light. But that value is between 1 and 100 and the opacity goes from 0 to 1. So I want to multiply the value {Binding @ Device.Level} by 0.01 and it looks like this: {Binding @ Device.Level * 0.01}. It seems this is also taken as a value as the light image is also visible, but I still can’t manage to actually adjust the opacity of the image like that. My question is what am I doing wrong, or can’t it work like this?

Thanks in advance for the feedback!

I don’t believe there is a way to create a direct binding or do this with a single DataTrigger. What you’ll probably have to do is create several that use a RegEx range. Here’s some info on how to do that.

1 Like

Thanks! I have followed your advice and this way it works fine.

Just an update as I came across this looking for the same thing and the link is dead but I used the regex generator at 3widgets here.