zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

What about the alert function? (Pulsating lights for a few seconds)

Open jboeddeker opened this issue 8 years ago • 12 comments

First of all, thanks for all the work!

I'm using zigbee2mqtt for a few days and i like it very much. I already migrated my Osram Smart Plugs to the bridge and added a some other sensors.

But one thing keeps me from removing the hue bridge altogether: i am missing the Alert function of the light bulbs. I currently use it as an additional signal of the doorbell, this works pretty well. So well iwouldn't enjoy missing it.

Is this a feature of the hue bridge or a feature of the bulbs? Either way, could this be implemented?

Thanks for any input.

jboeddeker avatar Jul 29 '18 23:07 jboeddeker

@jboeddeker if you use home assistant I recommend you do this with automation there.

ciotlosm avatar Jul 30 '18 07:07 ciotlosm

I think its same like https://github.com/Koenkk/zigbee2mqtt/issues/15 This scenario (Alert function) should be created in your home automation software.

tb-killa avatar Jul 30 '18 08:07 tb-killa

@tb-killa,@ciotlosm, I can agree with you if it is a feature of the (hue-) bridge. (Although even with that, it could also be implemented in zigbee2mqtt, just because every other bridge exposes that feature. Given that it would be an enhanced feature with quite low priority.)

But if it is a capability of the bulbs, it should be exposed somehow. It just doesn't make sense, to send a large number of brightness changes (viq mqtt) to the bulb, if it can be done with setting a single attribute, which is just not exposed yet.

I am thinking about bulb capability, because in every gateway/bridge (hue, lightify, deConz from google search) i've seen, this attribute is always named the same ("alert").

Same goes for effect. This may be coincidentally or somebody copied somebody... I just have no idea.

jboeddeker avatar Jul 30 '18 10:07 jboeddeker

@jboeddeker Give some example how this "feature" works, maybe we could build some sort of this as a "feature" as tozigbee converter ;) ? I need some more detail informations.

tb-killa avatar Jul 30 '18 11:07 tb-killa

Thanks @tb-killa. I found some groovy code related to smartthings, which looks rather technical (the line with "st cmd..."). Maybe that's the zigbee-message/register to be set?

def alert(action) {
    def value = "00"
    def valid = true
    switch(action) {
        case "Blink":
            value = "00"
            break
        case "Breathe":
            value = "01"
            break
        case "Okay":
            value = "02"
            break
        case "Stop":
            value = "ff"
            break
        default:
            valid = false
            break
    }
    if (valid) {
        log.debug "Alert: ${action}, Value: ${value}"
        sendEvent(name: "alert", value: action)
        "st cmd 0x${device.deviceNetworkId} ${endpointId} 3 0x40 {${value} 00}"
    }
    else { log.debug "Invalid action" }
}

source: https://community.smartthings.com/t/enhanced-zigbee-hue-bulb-direct-connect-to-st/33013

Update: Here is another link, which makes me believe, it's a bulb hardware feature ("blinking is handled at the hardware level") (also smartthings):

https://community.smartthings.com/t/home-monitor-alert-with-lights-blinking/45116/5

This looks like some official specification, chapter 7, page 112 describes the effects:

https://www.nxp.com/docs/en/user-guide/JN-UG-3103.pdf

From the effect description i use the "Breathe" effect. Just checked my lights are flashing 15 times.

All my lights support this, i own the following:

  • innr RB185C
  • innr RB162
  • Osram Lightify Surface Light TW
  • Osram Lightify Indor Flex RGBW
  • Ikea Tradfri E27 opal 1000lm
  • Philips Hue LWB010

@tb-killa, is this the correct repository for the issue? Shouldn't it be moved to the converter repository https://github.com/Koenkk/zigbee-shepherd-converters?

jboeddeker avatar Jul 30 '18 11:07 jboeddeker

Its okay at this place. I has to buy one bulb to test. Will privide so Code and you have to test :)

tb-killa avatar Jul 30 '18 16:07 tb-killa

Thank you.

I will happily test. Setting up a test-pi tomorrow.

jboeddeker avatar Jul 30 '18 17:07 jboeddeker

@tb-killa, any news on that?

Maybe could you lead me into the direction how to add such a message, then i could add it by myself. I know how to write code, but do not know zigbee, zigbee-shepherd & zigbee2mqtt. Does something similar exist?

something like that perhaps?

    convert: (value, message) => {
        return {
            cid: 'genIdentify',    
            cmd: 'functional',
            zclData: {
                // either blink = 0x00, breathe = 0x01 or Okay = 0x02

            },
        };
    },

jboeddeker avatar Sep 11 '18 08:09 jboeddeker

Would be great to see the alert effect implemented. I use it my alarm system with 8 lights (no way that's going unnoticed;). A script on the home automation side will choke on that many transitions, but with the Philips bulbs handling the blinking themselves it works fine.

ebaauw seems to have figured out the Zigbee side of this command: "On the Hue bridge, setting state.alert to select results in two Trigger effect (0x0003/0x40) commands. The first with parameters effectIdentifier Breathe (0x01) and effectVariant Default (0x00). The second with Finish effect (0xFE) and, again, Default (0x00). The second command is sent immediately (30ms) after the first. Setting state.alert to lselect results in only the first command, which causes the light to breathe for 15s. Setting state.alert to none results in only the second command."

source: https://github.com/dresden-elektronik/deconz-rest-plugin/issues/100#issuecomment-322172207

d-EScape avatar Nov 11 '18 14:11 d-EScape

Submitted a pull request to Zigbee-shepherd-converts to add support for alert /Koenkk/zigbee-shepherd-converters#157

d-EScape avatar Dec 03 '18 21:12 d-EScape

@d-EScape PR is merged, closing this.

Koenkk avatar Dec 05 '18 07:12 Koenkk

Thanks @tb-killa. I found some groovy code related to smartthings, which looks rather technical (the line with "st cmd..."). Maybe that's the zigbee-message/register to be set?

def alert(action) {
    def value = "00"
    def valid = true
    switch(action) {
        case "Blink":
            value = "00"
            break
        case "Breathe":
            value = "01"
            break
        case "Okay":
            value = "02"
            break
        case "Stop":
            value = "ff"
            break
        default:
            valid = false
            break
    }
    if (valid) {
        log.debug "Alert: ${action}, Value: ${value}"
        sendEvent(name: "alert", value: action)
        "st cmd 0x${device.deviceNetworkId} ${endpointId} 3 0x40 {${value} 00}"
    }
    else { log.debug "Invalid action" }
}

source: https://community.smartthings.com/t/enhanced-zigbee-hue-bulb-direct-connect-to-st/33013

Update: Here is another link, which makes me believe, it's a bulb hardware feature ("blinking is handled at the hardware level") (also smartthings):

https://community.smartthings.com/t/home-monitor-alert-with-lights-blinking/45116/5

This looks like some official specification, chapter 7, page 112 describes the effects:

https://www.nxp.com/docs/en/user-guide/JN-UG-3103.pdf

From the effect description i use the "Breathe" effect. Just checked my lights are flashing 15 times.

All my lights support this, i own the following:

  • innr RB185C
  • innr RB162
  • Osram Lightify Surface Light TW
  • Osram Lightify Indor Flex RGBW
  • Ikea Tradfri E27 opal 1000lm
  • Philips Hue LWB010

@tb-killa, is this the correct repository for the issue? Shouldn't it be moved to the converter repository https://github.com/Koenkk/zigbee-shepherd-converters?

how did you pair the Osram Lightify Surface Light TW to zigbee2mqtt?

augisbud avatar Feb 08 '19 16:02 augisbud