Run script based on slider percentage

So I have separate scripts for each of my fan speeds. Needed to do that because it’s RF and I’m using the BroadLink hub. So I set up automations one for each range.

Example: when slider is 1-17%, trigger script 1, which is the first fan speed.

See if that info helps you. I’m not exactly sure what your setup is.

Yeap I’ve done the same too - one for each speed.

Actually, what should I have in my trigger? this?

Here is what I have for my speed 1 script. Keep in mind I certainly am not a coding master lol it was a lot of trial but

error but this works for me.

And regarding a question of yours that I missed. I just updated Home Assistant a couple of weeks ago for the first time in about six months and my slider still works fine. The size changed for some reason. I’m not sure if your slider looked a little skinnier than the normal mushroom sliders, mine did after the update, and I just tweaked the height in the code. But other than that it works fine.

Thanks for sharing those screenshots James. Very helpful. I’ve configured mine like yours now and tested the scripts and they run fine, but still have the error come up. Suspect its something to do with my mushroom card coding. I’ll keep at it!

I’m using a Mushroom Fan Template card, suspect I need to find a way to include a slider into the custom template card as from your code it seems like that’s what youve got running

I think that might be it. I’m using custom slider card v2. I’m not the mushroom one . The card mod stuff in there will make it look exactly like a mushroom slider

Cool - do you know what repo custom slider card v2 comes from?

1 Like