Monoprice zwave smoke detector -- what am I doing wrong?

Apparently somebody has gotten the monoprice smoke detectors to work in the past, because I can search and find examples in the forum and the wiki…

…that don’t work. (I tried adding endpoints to it, still el zilcho.)

Here’s what happens in the zwave log when the smoke detector goes off, followed by when it clears:

2016-04-01 22:05:58.967 [DEBUG] [ApplicationCommandMessageClass:40  ]- NODE 41: Application Command Request (ALIVE:DONE)
2016-04-01 22:05:58.968 [DEBUG] [ApplicationCommandMessageClass:58  ]- NODE 41: Incoming command class BASIC
2016-04-01 22:05:58.968 [DEBUG] [z.i.p.c.ZWaveBasicCommandClass:73  ]- NODE 41: Received Basic Request
2016-04-01 22:05:58.968 [DEBUG] [z.i.p.c.ZWaveBasicCommandClass:77  ]- NODE 41: Basic Set sent to the controller will be processed as Basic Report
2016-04-01 22:05:58.969 [DEBUG] [z.i.p.c.ZWaveBasicCommandClass:106 ]- NODE 41: Basic report, value = 0xFF
2016-04-01 22:05:58.970 [DEBUG] [.z.internal.ZWaveActiveBinding:466 ]- NODE 41: Got a value event from Z-Wave network, endpoint = 0, command class = BASIC, value = 255
2016-04-01 22:05:59.016 [DEBUG] [ApplicationCommandMessageClass:40  ]- NODE 41: Application Command Request (ALIVE:DONE)
2016-04-01 22:05:59.016 [DEBUG] [ApplicationCommandMessageClass:58  ]- NODE 41: Incoming command class ALARM
2016-04-01 22:05:59.017 [DEBUG] [z.i.p.c.ZWaveAlarmCommandClass:82  ]- NODE 41: Received Alarm Request
2016-04-01 22:05:59.017 [DEBUG] [z.i.p.c.ZWaveAlarmCommandClass:94  ]- NODE 41: Alarm report - Value = 255
2016-04-01 22:05:59.018 [DEBUG] [z.i.p.c.ZWaveAlarmCommandClass:113 ]- NODE 41: Alarm Type = Smoke (1)
2016-04-01 22:05:59.019 [DEBUG] [.z.internal.ZWaveActiveBinding:466 ]- NODE 41: Got a value event from Z-Wave network, endpoint = 0, command class = ALARM, value = 255
2016-04-01 22:06:23.947 [DEBUG] [ApplicationCommandMessageClass:40  ]- NODE 41: Application Command Request (ALIVE:DONE)
2016-04-01 22:06:23.947 [DEBUG] [ApplicationCommandMessageClass:58  ]- NODE 41: Incoming command class BASIC
2016-04-01 22:06:23.948 [DEBUG] [z.i.p.c.ZWaveBasicCommandClass:73  ]- NODE 41: Received Basic Request
2016-04-01 22:06:23.948 [DEBUG] [z.i.p.c.ZWaveBasicCommandClass:77  ]- NODE 41: Basic Set sent to the controller will be processed as Basic Report
2016-04-01 22:06:23.949 [DEBUG] [z.i.p.c.ZWaveBasicCommandClass:106 ]- NODE 41: Basic report, value = 0x00
2016-04-01 22:06:23.950 [DEBUG] [.z.internal.ZWaveActiveBinding:466 ]- NODE 41: Got a value event from Z-Wave network, endpoint = 0, command class = BASIC, value = 0
2016-04-01 22:06:23.995 [DEBUG] [ApplicationCommandMessageClass:40  ]- NODE 41: Application Command Request (ALIVE:DONE)
2016-04-01 22:06:23.996 [DEBUG] [ApplicationCommandMessageClass:58  ]- NODE 41: Incoming command class ALARM
2016-04-01 22:06:23.996 [DEBUG] [z.i.p.c.ZWaveAlarmCommandClass:82  ]- NODE 41: Received Alarm Request
2016-04-01 22:06:23.997 [DEBUG] [z.i.p.c.ZWaveAlarmCommandClass:94  ]- NODE 41: Alarm report - Value = 0
2016-04-01 22:06:23.997 [DEBUG] [z.i.p.c.ZWaveAlarmCommandClass:113 ]- NODE 41: Alarm Type = Smoke (1)
2016-04-01 22:06:23.999 [DEBUG] [.z.internal.ZWaveActiveBinding:466 ]- NODE 41: Got a value event from Z-Wave network, endpoint = 0, command class = ALARM, value = 0

From this, it seems that I could key off of a BASIC report, or an alarm. Here are my three guesses that could possibly work:

Contact PINBALL_ALLEY_SMOKE_DETECTOR  "Smoke detector [%s]"  (Group_Fire,Group_Pinball_Alley,Group_Persistence) {zwave="41:0:command=SENSOR_BINARY"}
Contact PINBALL_ALLEY_SMOKE_DETECTOR_2 "Smoke detector 2 [%s]" (Group_Fire,Group_Persistence) {zwave="41:0:command=SENSOR_ALARM"}
Contact PINBALL_ALLEY_SMOKE_DETECTOR_3 "Smoke detector 3 [%s]" (Group_Fire,Group_Persistence) {zwave="41:0:command=BASIC,respond_to_basic=true"}

and a handy rule I made to log what’s going on:

rule "log smoke states"
when
    Item LOG_PBA_STATE changed or
    Item PINBALL_ALLEY_SMOKE_DETECTOR changed or
    Item PINBALL_ALLEY_SMOKE_DETECTOR_2 changed or
    Item PINBALL_ALLEY_SMOKE_DETECTOR_3 changed
then
    {
        logInfo("openhab","pba smoke state: " + PINBALL_ALLEY_SMOKE_DETECTOR.state)
        logInfo("openhab","pba alarm state 2: " + PINBALL_ALLEY_SMOKE_DETECTOR_2.state)
        logInfo("openhab","pba alarm state 3: " + PINBALL_ALLEY_SMOKE_DETECTOR_3.state)
    }
end

Which is all well and good. Only problem is that the results I get are completely lacking.

The only item that updates is the BASIC state, which always reads closed. It reads closed when the smoke detector isn’t doing anything, it reads closed when the tamper alarm is going off, and it reads closed when it’s detecting smoke. So… yeah BASIC report isn’t doing it.

The other two items just show uninitialized, always.

What am I doing wrong with this item definition? Thanks in advance!

Well, figured out my own problem. :wink:

Turns out I was misreading the BASIC state. I thought (from my previous experience with Vera and these smoke detectors) that if you pushed the test button it sent a “smoke detected” status.

Turns out that’s not true, at all. Luckily I had a can of smoke detector tester spray on hand (yes they make it!), and with a bunch of time and some brute force iteration, sifted through everything while having the zwave binding in debug mode.

I’ve wound up with these item definitions:

Contact PINBALL_ALLEY_SMOKE_DETECTOR "Smoke detector [%s]" <fire> (Group_Fire,Group_Persistence) {zwave="41:0:command=BASIC,respond_to_basic=true"}
Contact PINBALL_ALLEY_SMOKE_DETECTOR_TAMPER "Smoke detector tamper [%s]" <fire> (Group_Fire,Group_Persistence) {zwave="41:0:command=ALARM"}
Number  PINBALL_ALLEY_SMOKE_DETECTOR_BATTERY     "PBA Smoke battery [%d %%]" (Group_Battery, Group_Persistence) {zwave="41:0:command=BATTERY"}

That’ll give you smoke reports, tamper reports, and battery info. Note that the tamper switch stays open for an hour and then clears. You can clear it immediately by sending

sendCommand(PINBALL_ALLEY_SMOKE_DETECTOR_TAMPER,CLOSED)

in one of your rules if it really bugs you or you feel the need to clear it immediately.

Not really sure how to get it to appear correctly in a sitemap, though. Even though I use the fire icon, it never shows as being on fire when the alarm goes off. Probably due to being OPEN/CLOSED instead of something else. (Figure I need a mapping, just not sure which one.)

Check the names of the fire icons. They should end in what ever state it represents. For example: fire-open.PNG and fire-losed.PNG. if not rename them accordingly.