Step widget without range (IR volume control)

I want to use Blynk to control a number of things, one of them being the volume of TV etc. This is done via IR so the notion of having a range which the step widget moves between doesn’t really work as the TV remote just does volume up and volume down there is so “set volume to level 15”. If using a combination of Blynk and the actual TV remote means that the volume level could come out of sync.

What would be nice is to have a step widget that can send an arbitrary value for up and for down, a bit like using buttons but it would look nicer as a step widget.

1 Like

On the code side you could just do soemthing like param.asInt() * 15 ?

Don’t the Step H or Step V Widgets already do that?

And unless your TV has a way of digitally feeding back its volume level (and none do that I am aware of), that will eventually happen anyhow.

If the step widget does already do that that then that would be great, but I can’t see how. It seems to send the current value in the range between your set min - max as it cycles up and down.

The TV can’t feed back it’s current value, that is why I just want to send either a volume up/down command rather than a value in the range. I think I mislead you by saying I wanted to send an arbitrary value, what I meant by this was to send an “up” or “down” command rather than a specific volume level. So effectively like using two button widgets, just nicely contained in one widget.

I see. So just assign the Step widget to a virtual pin, then, in code, just simply acknowledge each increasing or decreasing value as an up or down counter, then send out your own up/down signal accordingly.

That’s what I have so far, but have an issue when you reach 0 on the step widget and want to go lower. I know you can have it wrap round the values, but then it’s more code on my controller to account for wrapping to detect increase/decrease.

My other idea was to set a wide range on the step widget and set it to the middle value so unlikely to hit the extremes. But thought it worth suggesting an improvement to the widget as it would be a cleaner solution.

I’m guessing TV’s with CEC (almost all branded TV’s from the last few years) a Raspberry Pi and libCEC can do all that for you.

P.S. wife through water over our CEC enabled TV this morning, so now we just have sound and no picture!

Only you would figure that out :smiley: Does your wife also throw water at you when you get all geeky like that? :stuck_out_tongue:

1 Like

OK, I get it now… yes, I second that idea! Adding another toggle option that switches between what it is now and sending out a simple, repeating, HIGH/1 or LOW/0 depending on up/down left/right press. Could have many uses.

Or they could just make another toggle switch type widget… never too many widget options I say :slight_smile:

1 Like

Hm… Very nice idea. And what is good - very easy to implement :wink:

Just was thinking a bit. It should send 1/-1 in case of step 1.

@Gunner @zippygiraffe please approve :slight_smile:.

For my use case it doesn’t matter, but 1 for up and -1 for down seems logical.

Wouldn’t that get confusing? increments and decrements in ranges of 0.1 to whatever your MAX is… but goes negative if set at 1 and decremental pushes are received… or am I getting your idea all wrong?

Perhaps if set to 0 then toggles positive/negative or just high/low results

Hard to say. Negative seems more logical to me. We’ll see.

I agree that will work, but set it for when 0 steps are chosen… that way people can still use 1 for, well, steps of 1 that stop at MIN/MAX or loop.

Hopefully I am explaining it correct… essentially keep it as it is, but add that when 0 steps chosen, then every UP/RIGHT sends 1 and every DOWN/LEFT sends -1 (as I think you meant) then a simple:

int x = 0;
x = x + param.asInt();

can act as a counter going either positive or negative.

Maybe I got it wrong, but why would you do that?

Because no one would normally pick 0 for steps, whereas right now one can choose in increments of 0.1 and up… Granted, I haven’t tested the BLYNK_WRITE(Vx) results… and if using param.asInt() one would only get integers anyhow… but still, steps of 1 mean 1, steps of 2 mean 2 and so on… I use steps of 1 for precision servo or LED adjustments and never want them to go into the negatives,

Keep the 1 / -1 counts as a special option.

A post was split to a new topic: Step Widget Question