jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
196 stars 48 forks source link

GE/Jasco 26931 Z-Wave motion switch - cannot set motion sensing mode #141

Closed cgallred closed 3 years ago

cgallred commented 3 years ago

These in-wall motion-sensing switches can be sent a command to change the motion sensing mode. Would it be possible for hacs-hubitat to expose the mode-setting commands to HA so I can use them in e.g. Node-RED?

There are three modes: manual, vacancy, and occupancy. I have one installed in the upstairs hall bathroom. During the day I have it set to occupancy mode (auto-on, auto-off triggered by the motion sensor). At night I have it set to vacancy mode (manual on, auto-off) so that when one of the kids goes into the bathroom in the middle of the night they have the opportunity to close the door before potentially flooding the hallway with light, but it will at least still shut itself off if they forget to do it themselves.

When I was using webCoRE on HE I was able to create pistons that could send commands to change modes: image

Unfortunately the mode commands are not exposed via hacs-hubitat so far as I can tell.

Here's the Maker API device info, showing that he commands are exposed. Please let me know if I can provide more info:

{
    "id": "309",
    "name": "GE/Jasco Z-Wave Motion Switch",
    "label": "Upstairs Bathroom Light",
    "type": "GE Z-Wave Plus Motion Switch",
    "attributes": [
        {
            "name": "motion",
            "currentValue": "inactive",
            "dataType": "ENUM",
            "values": [
                "inactive",
                "active"
            ]
        },
        {
            "name": "pushed",
            "currentValue": null,
            "dataType": "NUMBER"
        },
        {
            "name": "numberOfButtons",
            "currentValue": null,
            "dataType": "NUMBER"
        },
        {
            "name": "switch",
            "currentValue": "off",
            "dataType": "ENUM",
            "values": [
                "on",
                "off"
            ]
        },
        {
            "name": "switch",
            "currentValue": "off",
            "dataType": "ENUM",
            "values": [
                "on",
                "off"
            ]
        }
    ],
    "capabilities": [
        "MotionSensor",
        {
            "attributes": [
                {
                    "name": "motion",
                    "dataType": null
                }
            ]
        },
        "Configuration",
        "Actuator",
        "Refresh",
        "Light",
        {
            "attributes": [
                {
                    "name": "switch",
                    "dataType": null
                }
            ]
        },
        "Switch",
        {
            "attributes": [
                {
                    "name": "switch",
                    "dataType": null
                }
            ]
        },
        "Sensor",
        "PushableButton",
        {
            "attributes": [
                {
                    "name": "numberOfButtons",
                    "dataType": null
                },
                {
                    "name": "pushed",
                    "dataType": null
                }
            ]
        }
    ],
    "commands": [
        "DebugLogging",
        "Manual",
        "Occupancy",
        "Vacancy",
        "configure",
        "off",
        "on",
        "push",
        "refresh",
        "setLightTimeout"
    ]
}
jason0x43 commented 3 years ago

The integration generally only exposes commands associated with particular capabilities. However, it also provides a generic hubitat.send_command service that can be used to send arbitrary commands to a device. Try that, using one of the command names from the "commands" list and an entity that belongs to the device you want to send the command to.

PNG image
cgallred commented 3 years ago

Thanks, that worked!