Konnected Alarm Panel PRO Outputs

I was referring to the standard built-in Hubitat Apps (like Rule Machine), which is what the OP is trying to use. Based on their feedback, it would appear that not every Hubitat Capability is fully utilized in every Hubitat built-in App.

Sorry for any confusion.

@nate - you can simply add support for Hubitat's PushableButton capability to the drivers, and the devices will then show up in any Hubitat built-in app that handles button devices. Just be aware, that the PushableButton capability expects a few things, like a button number, and an attribute that tells the app how many buttons the device supports. See my post above (Konnected Alarm Panel PRO Outputs - #17 by ogiewon)

Huh. Hubitat's own rule machine does not allow their own Momentary Capability? That seems like a problem with Rule Machine and Bug Report should be put in.

I tried Webcore to see if it can be done there. At first it seemed like it could not, since it treats it like a pushableButton with parameter 0.

There is usually an option on that menu to Remove a parameter, but this does not have that to remove the 0 parameter.

Which shows up like this, causing an error in the driver:

push0

However, I can change the Button number to an empty expression:

And that results in this:

pushWebcore

And that works to push a Momentary button from Webcore.

So Rule Machine has a bug that should be fixed. Meanwhile, Webcore can be used by OP for this as a work-around, even though Webcore also needs a work-around itself to push a momentary button.

Momentary push() sends a push event. PushableButton creates pushed(value) event that also creates the pushed(value) attribute in the device.

To use pushableButton in the Konnected code, it would need to send 0 as a value for the pushed event, and other parts of the code would need to be changed to accept a pushed(0) event, and resolve that 0 value. Seems like more work than it is worth in modifying the code, when really this is a Rule Machine issue, that has a Webcore workaround.

Edit: I guess 0 would not need to be resolved to anything, if it will be the only value ever sent as a pushableButton pushed(x) value. Still seems like a lot of code changes to work around a Rule Machine issue.

See this post about reporting the bug in Rule Machine.

"Konnected Button Trigger" as show in my screenshots above:

image

image

I need some time to digest all the information posted today. Appreciate all the help guys.

Here is another workaround that might work for you so you can use Rule Machine, if you don't want to use Webcore for those momentary rules.

I created a Push Momentary Button app to link a Pushable Button to a Momentary Button Device.

Click Here for App Code

  1. Copy the code to Apps Code
  2. Create a Virtual Button device in Hubitat with the built-in virtual driver
  3. Create an instance of the App - You can name it in settings
  4. Chose the Virtual Button Device you created, and your Momentary Device to control in settings
  5. Also in settings, choose a pushed button number to use from the virtual button device to trigger the momentary button device you selected.

You can create as many instances of the app as needed for the number of momentary devices you have. You can use the same Virtual Button device for all of the instances, just use a different pushable button number for each instance and name the instance differently.

Then, in Rule Machine, instead of using the momentary button device in the rules, you use the Virtual Button device, usings Pressed(number) for the button number that corresponds to the momentary button you want to push, based on what you used for the button number in the app.

You can also now put buttons on a dashboard to press the momentary buttons, using the virtual button device and the proper number push.

If you do use this, note that you can use this CSS below to change the individual titles for pushable button tiles on a dashboard, to match your momentary device titles. Just update the tile number to match your tile, and update the content for the new title:

/* Change the title */
#tile-1 .tile-title::after {
visibility: visible;
position: absolute;
text-align: center;
left: inherit;
right: 0;
bottom: 0;
white-space: pre-wrap;
}
#tile-1 .tile-title {
visibility: hidden;
white-space: nowrap !important;
overflow: unset;
}
#tile-1 .tile-title:after {
content: 'New Title';
}

Here is a an updated version of Konnected's driver. Simply replace the one from Konnected with this one, and make sure to click SAVE on the Preferences page. Clicking save will initialize the "numberOfButtons" attribite properly.

Afterwards, you will be able to select this device from any Hubitat App that supports "PushableButton" devices. Be sure to enter button number "1" (no quotes) for the push() command.

metadata {
    definition(
        name: 'Konnected Button Trigger',
        namespace: 'konnected',
        author: 'Konnected Inc.',
        singleThreaded: true,
        importUrl: 'https://github.com/konnected-io/konnected-hubitat/blob/master/drivers/konnected-button-trigger.groovy'
    ){
        capability "Momentary"
        capability "PushableButton"
    }
}

def updated() {
    installed()
}

def installed() {
    sendEvent(name: "numberOfButtons", value: 1)
}

public void push(buttonNumber) {
    push()
}

public void push() {
    parent?.componentPush(this.device)
}

Thank you both for the suggested work-around options.

I will make an attempt at changing the Konnected driver option provided by @ogiewon first and let you know how that goes. I want to try this option first to allow me to fully utilize all the features provided by Konnected for various output BUTTONS in order to have a different chime sound for each of my perimetere doors using the Multi-Output sounds for each door (in lieu of just a single beep).

When you are setting up the output in Konnected the firmware if gives you a host of options that you could use for each BUTTON. Here is how I set up Door Chime#1:

That said @ogiewon before I dive into an area I'm not familiar with, I need to double check something first, namely:

I have completed a manual backup so I can revert back to the original driver if needed.

Then I assume I replace the existing driver found under Drivers Codes, Konnected Button Trigger - correct?

In other words in this instance I'd open the Konnected Button Trigger type that reflects it is being used for "Restart, Door Buzzer #3, Door Chime Output" and replace it with what you have furnished. Correct? The existing driver is the following:

That said, I'm not at all familar with the "Restart" device that Konnected automatically created that appears to use the same driver, so not sure if this work-around will impact the features of that button.

Nice fix up! After all that, @user7221 pointed out to me that by just adding the Switch Capability to the driver would have allowed this to work in RM as was, as push() command would be available when the momentary button is just selected as a switch.

1 Like

Yes, simply copy and paste the code I provided over top of the existing code, and then click SAVE to save the new driver.

Then, open up one of your Devices that uses this driver, select the Preferences tab, and then simply click SAVE as shown below.

You then be able to select this device in RM and use its "Push()" command, passing in a "1" as the button number.

This code change should not impact anything in a negative way, as the change was simply to add some additional functionality, not change the existing functionality.

Thanks!

Yes, that is another solution. However, I would not add the Switch capability, unless one is willing to implement the on() and off() commands correctly, as well as an automatic turn off feature as this really is just a momentary/pushable button.

Instead, one could simply add the "Actuator" capability, and then use that in RM to find the device, and then call its 'push()' command. The Actuator capability has no commands and no attributes to implement, so it is very simple for things just like this.

However, it will probably be easier in the future for Konnected users to simply look for a "Button" style device, instead of the more abstract Actuator. Not sure which direction @nate will want to take? :thinking:

It is great that Hubitat is so flexible and provides many options.

1 Like

I have not as yet reported it as a 'bug' yet to staff following the thread you provided.
You are more that welcome to report it to staff (I'm a little concerned about not necessarily having the skillset to answer specific questions in that regard).

@ogiewon - appreciate the confirmation. I will proceed with some testing and confirm my results.

1 Like

Yeah, I guess it is not "technically" a bug, it is more of an undocumented assumption that some other capability will just be added to the driver and it will be selected as that type of device.

Looks like Hubitat decided for Rule Machine (and probably other built-in apps) to make the default capability pairing to just be switch for selection in more generalized apps like Rule Machine.

Even other parts of the Konnected code is using Momentary Switch, just not that trigger device.

metadata {
definition (name: "Konnected Momentary Switch", namespace: "konnected-io", author: "konnected.io", mnmn: "SmartThings", vid: "generic-switch") {
capability "Switch"
capability "Actuator"
capability "Momentary"
}

Problem solved using the updated Konnected driver @ogiewon provided. I am very much appreciative of the help from everyone in this regard. It seemed like such as simple initial question and I was really stumped on a solution, so I could not have got this working the way I wanted without all your help. Thank you very much once again.

@nate - this is 100% funtional. I guess you need to decide how you want to move forward for when the next person asks how to do the same thing :slightly_smiling_face:.

1 Like

Thank you @ogiewon for the tip (also, great to hear from you!).

Adding the Actuator capability by itself didn't do it, at least for the Basic Rules app. Maybe Rule Machine is a bit more flexible but I think @b.griffiths1207 was originally using Basic Rules for his desired automation and I want to make sure it works for the the basic and advanced cases.

You gave me an idea though and I added the PushableButton capability to the device driver and that seems to have made it appear under Push action! The only tricky thing was defaulting it to numberOfButtons = 1 because apparently the PushableButton capability supports multiple buttons on a single device, whereas Konnected treats each device as a singular button/entity.

Here's the updated driver code. Does this look reasonable?

metadata {
    definition(
        name: 'Konnected Button Trigger',
        namespace: 'konnected',
        author: 'Konnected Inc.',
        singleThreaded: true,
        importUrl: 'https://github.com/konnected-io/konnected-hubitat/blob/master/drivers/konnected-button-trigger.groovy'
    ){
        capability "Momentary"
        capability "Actuator"
        capability "PushableButton"
        command "push"
    }
}

def installed() {
    initialize()
}

def updated() {
    intialize()
}

def initialize() {
    sendEvent(name: "numberOfButtons", value: 1)
}

public void push(_) {
    parent?.componentPush(this.device)
}

Works as expected in Basic Rules:

If this looks good to you guys I'll push the change to our GitHub packages. Thanks for the feedback!

2 Likes

@nate - Nice to hear from you as well!

The only change that I would make is to remove the 'command "push"' line. That is already implied by including the PushableButton and Momentary capabilities.

Here is the very slightly modified version.

metadata {
    definition(
        name: 'Konnected Button Trigger',
        namespace: 'konnected',
        author: 'Konnected Inc.',
        singleThreaded: true,
        importUrl: 'https://github.com/konnected-io/konnected-hubitat/blob/master/drivers/konnected-button-trigger.groovy'
    ){
        capability "Momentary"
        capability "Actuator"
        capability "PushableButton"
    }
}

def installed() {
    initialize()
}

def updated() {
    intialize()
}

def initialize() {
    sendEvent(name: "numberOfButtons", value: 1)
}

public void push(_) {
    parent?.componentPush(this.device)
}
1 Like

Ok, easy! thanks for the review.
The official Konnected driver is now updated here.

2 Likes

I tested the work-around yesterday with both a Basic Rule and a Rule Machine rule - both worked just fine.

HPM should find and update this driver code @nate just posted today, correct? Just checking I don't need do anything on my end with the work-around driver I installed yesterday?