I’ll start this question with some background info:
I have a couple of z-wave lights hanging over my dinertable in the living. These things can be dimmed and/or switched from Homey. Primarily, they are controlled from a couple of flows that make up scenes where we can switch between “Diner”, “Evening”, “To bed” and so on. These switch the lights on or off.
Secondly, I have an old tablet hanging on the wall that I run a homey.ink based dashboard on. It allows to switch between these scenes through a couple of virtual switches but also provides the original switches for the lights so that my wife can easily switch 'm on or off without using the physical switches on the wall. She found out that she can control the dim function from these lights by long pressing the button of each light at which time a slider appears. So far so good.
However. I also have a spare KAKU remote control laying around, gathering dust. So , just for the heck of it, I hooked it up to Homey - works like a charm! Now, the wife wanted it to control the lights over the dinertable too, and that’s where the problems start.
So, I built the following flow:
When the lights are off, they are switched on. If they already were on, it increases brightness. Great!
However… the counterpart is not so great (don’t mind the “and” card in there, it doesn’t do anything useful now):
I would have liked to decrease the brightness on this button when the lights are over 20% brightness and switch 'm off when they drop below 20%. Ideally, the flow would read: “If dimvalue > 20%” then “set relative dim level -20%” else “switch off”.
Here’s the caveat: that “if dim value” card does not exist. Without it, the lights will dim to 0%, but that is not the same as “off” (the switches on the tablet that are connected to the raw lights stay active when dimmed to 0% !).
I know I can add a variable to keep track on the dim level, but that would just mimic the real value and is bound to fail at some point (for example: when loosing contact with the lights when somebody inadvertently touches the physical switches…).
So, is there a way to read the dim level after all? Or a foolproof workaround?