Hubitat Groups Switch

Yesterday I lost all my Hubitat related Google Home automations. Not too big of a deal and all but 2 are back in order and working. The two routines NOT working are Good Morning and Good Night. A Hubitat Group (Good Night Switch) turns off at bedtime but must be reset to the ON position before it can work again the following evening. I believed that this event occurred during the Good Morning routine but if I add it there and the Night Time Group switch is turned on all the lights associated with this group turn on.

These two Google Home routines have worked for years but I can't figure out how. Obliviously, if the Night Time Group switch is turned on all the lights in that group will turn on. It baffles me how this worked in the past. This switch has to be in the ON position for the Good Night routine to work. How can I get this switch in that position without turning on all the lights in this group?

I think I have found a work-around. Simply include a virtual switch to the night time group which you turn on during the Good Morning Routine and off during the Night Time routine. By turning on one device within the group will cause the Night Time Group Switch to return to the ON position without turning on all the devices within the group.

That these routines worked in the past was just a fluke as I never used the above technique.

Anyone have a better idea?

I built a quick virtual switch driver "Switched button pusher" that also sends button 1 pushed when switch is turned on and button 2 pushed when switch is turned off. That way, when a switch that is already on is turned on again and the push trigger will fire. Very useful for some Alexa and Homekit integration challenges.

/**
 *  Simple switch that pushes its own buttons
 */

metadata {
    definition (name: "Switched button pusher", namespace: "sleuth255", author: "Sleuth255") {
        capability "PushableButton"
        capability "Switch"
        attribute "numberOfButtons","2"
	}
}


// General App Events
def initialize() {
}

def installed(){
	initialize()
}

def updated(){
	initialize()
}

def on() {
    sendEvent(name: "switch", value: "on");
    sendEvent(name: "pushed", value: "1", isStateChange: true, type: "digital")
}

def off() {
    sendEvent(name: "switch", value: "off");
    sendEvent(name: "pushed", value: "2", isStateChange: true, type: "digital")
}



1 Like