[Request] Stateless switch

Would it be possible to add a stateless switch.

I’ve made my own virtual stateless switch but would be nice to have a tile for it in the dashboard as well. Can maybe be two tiles, one for on and one for off.

What would it report as a stateless switch? What command would it send?

Good question. Not sure what the state is if it’s not on or off.

An example of the way I use it is if I turn on my living room it turns on everything. If only one thing is on it will turn on the others when I press it again. And same if I use the off.

It doesn’t care what state it’s in it’s just executing an on or off when I run it.

On the dashboard I could imagine it as either two tiles to execute on or off. Or a single time where you can touch the top half or bottom half.

Hopefully that makes sense.

Maybe the button tile would work? Or momentary. They both send pushed and the button sends the button number you choose.

I guess this is a use case for a custom command tile without an attribute. Just blindly sends that command to the chosen device.

I have stateless switches.
If the are manually turned on (heaven forbid) then they will not report to Hubitat and therefore the dashboard.
They will turn on and off via the dashboard and report their state correctly on the dashboard and the hub.
This is also true if they are turned on via a piston/rule.
I have the dimmers defined using a Lightwave dimmers /outlets DH.
Search for Lightwave RF on the forum to find the thread and the DH's.
This may help you get an idea of what is required.

A custom command button associated with a device would be very nice. Use case: The Samsung WiFi Audio driver includes several toggle capabilities (input source, equalizer preset, shuffle, repeat. Another, TP-Link lights have circadian mode (state) on-off.

1 Like

The button trick work.

I updated my virtual drive to include the PushableButton capability and handle the push command.

The good thing is you can actually send more than just a number. I am able to send on/off so the tiles also say on/off as well.

1 Like

The issue with a custom command tile is that we restrict the commands that can be sent so its not just a free text box. We don't want to open a means to send arbitrary commands, like changing or setting a lock code, for example via dashboard.

As I continue to think through a custom command tile, about the only way this could be done is either add a custom text box with a list of commands in the main Dashboard app that the hub admin can override the default ones to be allowed. Or expand the built in approved command list for some of these types of usage cases. However, I do think the flexibility of the button tile (with a custom label) would handle this with minor adjustments to how the drivers would handle button press mappings. Essentially becoming a remote control.

Thanks for the response. One minor thought. it would be great if the custom label could be either user-defined text or an attribute (to reflect the current value of what the button is controller.

I would use a LOT of these buttons for:

  1. toggling device elements such as equalizer preset, input source, repeat mode.
  2. audio presets, and
  3. speaker group presets.

Question: On the button() implementation, what is the current limit of the number (i.e., button(1), button(2), ... , button(30))?

That would leave only me porting the Sensi Thermostat to have everything I use Hubitat capable.

Not sure of a limit beyond the limits of the driver attached to it. In theory there only is a limit to the integer value.

1 Like

Could you share your virtual driver for this please? I also have a need for a stateless switch and am struggling with the various other methods people have proposed. I basically want a switch that will assert an on or off even if it is already previously in that state. I need this because I have some devices using IFTTT and they seem to not reliably follow the HE command. So their actual status gets detached from the HE virtual device status. I'm trying to find a way to force these devices into an on or off status irrespective of what they think they are (eg. send the command again) :slight_smile:

Hope it makes sense. It seems to me like there should be an option in the Virtual Switch to simply send/assert the command again irrespective of current device status, to cover off situations like this.

Ah, I just found this and it seems to be working nicely. Sorry to disturb. Cheers.

Hi @Angus_M,

I walked this exact road in the last week :slight_smile:
My problem was that the stateless switch did not trigger my Rules...

My solution was @dan.t's code provided in this thread: