Device not changing state from driver page

Hello,

I'm using Generic z-wave switch driver for my schneider connect 1 gang switches.
The device itself works and changes the state when I physically press it.
But I can't change the state of the switch from the driver page, when I press on or off nothing happens.
I believe this affects my ability to use dashboards and so on.
These are the switches I have.

What should I do?

Those are not switches. Those are battery powered button controllers. The driver you mentioned is intended to control a mains powered switch. I do not see that these devices have a supporting driver. I do not believe they will work with Hubitat.

1 Like

Ok, interesting.
The driver works with physical presses but not with the digital ones.

Note that there are two states on most pages. I believe the following to be true (from my experience).

  • Current States. These are Attributes and should automatically update when the state changes.
  • State Variables: These are semi-static variables used in the driver. They do not update on the page when changed. To update, you would refresh the browser page.

Yep, that I know.
The problem is that I can't change the state of the device/driver(?) digitally. As in I can't use the dashboard to turn on/off my battery powered switch or button controller or what ever it is called.
And if I use the dashboard to turn on/off the relay I'm using, then we are out of sync..

And let me get this straight. When I press my switch does it change states on and off in itself or does it just change the state of the driver in hubitat?

There are no states to change as these devices do not manage a load. So, I don't understand what you are trying to accomplish by turning it "on" or "off". There is no thing to turn on or off as the device doesn't control an electric load. This device would only be useful if turning the device on/off were instead interpretted as button presses. You could then use the device to control other devices in Hubitat. Do you understand? Have you tried the Generic Z-wave button controller driver?

I am not trying to accomplishing anything. I am asking a question. And apparently The right answer to My question is that no, your device should not have a on/off state bit as it is a button that gives on and off commands (as 0x00 and 0xFF). The state bit is in The driver i am using that is meant for a switch device that has a state that The drivers internal on and off buttons change? Am I getting this right?

Yes, I have tried The button controller driver, didn't work. But maybe i messed something up with it so i will try it again.

Sorry, English is not my native language and I was up late.

The button controller driver gives out logs like this:

Unhandled Command: BasicSet(value:0)
Unhandled Command: BasicSet(value:255)

Generally a button controller is just an action trigger. You don't push a state change to the button controller. Further, I see nothing about this device that indicates it could make use of that information-- it doesn't flip back or forth, or light on/off. This just transmits presses to Hubitat.

If you are using it to control a relay, then you should put that relay on your dashboard.

When you say "out of sync" what are you referring to? What is out of sync?

Hello,
When i put My relay on from The dashboard The connected switch has to first be pressed on and only after that i can turn it off with The switch.
So my switch (or The driver?) And The relay are out of Sync.

How does your button control the relay? Is this a Rule Machine button link? I'm wondering if there is an intermediate state in the middle somewhere.

Another thing you can do to test is see if you can determine if the button controller transmits the "off". So for example,

  1. Turn the relay on
  2. Watch the driver events when you press "off", then later the on-off you have to press to sync them

Let's see if the driver is seeing the off press. If it is, then the problem is somewhere later in the automation.

I am using simple lighting for my lights.

Yes, the button transmits the command to the driver. Even when it is in off state and the relay is on.

The button can't change the state of the relay off becouse the buttons driver is already in off state, only after I turn the button on, it can be set off.

Also when I go to the driver page the "on" and "off" buttons do nothing.

edit: changed switches to buttons

Ok, so the problem is I think, (as @Ryan780 said earlier) that I have wrong driver. I think when I press the on and off in the driver page the driver tries to set the state of my button controller but it has no states.

Lets straighten this up a bit.

The device is battery powered 2 button controller.
Upper button gives "basic on command"
Lower button gives "basic off command"

I made a driver with pushablebuttons and mapped them first with ABC and then rulemachine.
I made it so that I have two button devices controlling one relay.
Alas when I press device 1. button 1. -> the light goes on. Then device 1. button 2. -> light goes out.
same with device 2..
But when I press device 1. button 1. -> light goes on, device 2. button 2. -> nothing happens.
After that I press device 2. button 1. button 2. -> light goes out. There is something fishy going on.
And yes, i get reports from the buttons on every push.

Can you post the driver you wrote?

import groovy.transform.Field

@Field static Map commandClassVersions = [
0x26: 1 //SwitchMultiLevel
,0x20: 1 //Basic
,0x8E: 1 //MultiChannelAssociation
,0x85: 1 //Association
,0x70: 1 //Configuration
,0x86: 1 //Version
,0x72: 1 //ManufacturerSpecific
]

metadata {
definition (name: "Schneider button",namespace: "SS", author: "Taneli Kaukoranta") {
capability "Actuator"
capability "PushableButton"
capability "Refresh"
}
preferences {

    input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
    input name: "txtEnable", type: "bool", title: "Enable descriptionText logging", defaultValue: true

}

}

def logsOff(){
log.warn "debug logging disabled..."
device.updateSetting("logEnable",[value:"false",type:"bool"])
}

def parse(String description) {
def result = null
if (logEnable) log.debug "parse description: ${description}"
def cmd = zwave.parse(description)
if (cmd) {
result = zwaveEvent(cmd)}
return result
}

def zwaveEvent(hubitat.zwave.commands.basicv1.BasicSet cmd)
{
def result
if (cmd.value == 0) {
result = sendEvent(name:"pushed", value:2)
if (logEnable) log.info "Button 2 was pressed"

} else {
    result = sendEvent(name:"pushed", value:1)
    if (logEnable) log.info "Button 1 was pressed"
}
return result

}

1 Like

For button events, you always have to have "isStateChange: true" in the sendEvent. So, it would look like this:

sendEvent(name:"pushed", value:1, isStateChange: true)

Otherwise, you won't get repeat button events from the same button.

But also, which switch do you have currently? This might work for on-off, but I don't think it will. I think you're going to have trouble getting repeat button actions because the device is already on when it's turned on.

I can control the relay like this, on and off.
How ever I can't control the relay with two devices.
Or I can but one at a time.
I can't create a "hallway switch" where i put the lights on at the other end of the hallway and turn them off at the other.

I will try to use a virtual switch that i mirror to the physical relay.

Dude, you're not even answering my questions now.

I'm gonna bow out. Best of luck.