Cannot toggle virtual switch states

Hello,
I created a virtual switch on Hubitat (planning to turn this on for holidays or days I decide to work from home so I can keep certain automations running during the day). I'm facing a few different issues:

  1. From the device page I can't hitting on/off doesn't seem to do anything.
  2. The device page also won't show the current state of the switch.
  3. I added the switch to the dashboard, but I can't seem to toggle it from there either.

Please see attached screenshots. Could you help me figure out what I'm doing wrong.


There are some errors in the debug logs. Not sure if it means anything.

A separate question is if this should be a presence. A switch can be turned on/off. Presence seems similar (present/away) so I went with the switch.

Seems like device 42 is gumming things up. You can click that red "error" text to be taken to the device detail for that device to see what it is, then maybe look at what apps or using it (or any automations you might have set up using it, which this should help you figure out) to see if something might be hitting it excessively hard. (The warning just cut off in your screenshot might be helpful too?)

The events have already been filtered for this virtual switch and it looks like these errors are related to the virtual switch. The app being referenced is the dashboard app from where I'm unable to toggle the switch.

This seems very unlikely. A switch doesn't have a "presence" attribute (at least not without a custom driver), which the error is complaining about. Matching the device ID -- including using the easiest method of doing this, clicking the red "error" link to take you to the device detail page for device 42, the source of this log entry -- is the way to see.

Referenced where? As an "In use by" app? If so, I'd again make sure you're looking at the right device. And yes, if it does not work from the device detail page, it's definitely not going to work from Dashboard. If you are having problems with a device, I would leave Dashboard out of the picture until you figure that out first. It's just an app in the end.

If you just created this one, you could also just remove it and re-create it and see if that takes care of the problem. Be sure to remove it from any apps, including Dashboard, before removing.

2 Likes
  • Clicking the red "error" link took me to the virtual switch page.
  • I removed and re-created the virtual switch. I still get the same error
    (for dev-43, which is the new switch id)

I renamed the switch after creation (to New Test Switch) but the tab title hasn't changed.

That is unusual, though at least the methods match up with what the device offers this time. Just to rule out database corruption, I would suggest making a backup, then restoring that backup (which does a soft reset as part of that process; you could do one yourself beforehand if you want, and you'll often see it recommended, though there is no reason to). This will "clean" the database. See the "Soft Reset" section here for more detailed instructions: How to Troubleshoot Apps or Devices | Hubitat Documentation

Live Logs won't update this name until the page is reloaded. Past Logs will not update this name until the oldest log entry with the entry with the oldest name (it uses the first/oldest name available) has been purged out based on a total-log-size quota.

1 Like

See the "Soft Reset" section here for more detailed instructions: How to Troubleshoot Apps or Devices | Hubitat Documentation

Soft-resetting the device fixed my issues!! Thank you so much for your help.

1 Like

Hi, just out of curiosity, my hub is set to reboot once a week. Does this also act as a soft reset too? Cheers in advance :+1:

No, a reboot does not do a soft reset, though there is (I think? or at least used to be) some cleanup that gets done on reboot and during nightly maintenance.

2 Likes