[RELEASE] Monoprice/Linear/GoControl WAPIRZ-1 Motion Sensor with Temperature and Battery Device Type (Updated)

dth_motionsensor
monoprice
temperature
dth_alerts
dth_sensors

(Ross) #23

RBoy, I'm using your code, how do I apply the V1.0.3 update? And, thanks for the device handler and help!!


(www.rboyapps.com - Make your home your butler!) #24

Ross I've given the instruction on the website in the Installation section (FOR UPDATING EXISTING DEVICE HANDLERS WITH A NEWER VERSION OF THE CODE:)

  1. Open your Device Handler in the SmartThings IDE
  2. Select all (Ctrl+A) and delete the old code, Copy-Paste the newer version of the code
  3. Click on "Save" and then Click on "Publish" and then Click "For me"
  4. IMPORTANT, DON'T SKIP THIS STEP: Open the Device on your phone, check/update your preferences and hit "Done". Now hit the "Request Update" button. If you don't do this last step the updated Device Handler may not work.

http://smartthings.rboyapps.com/


(Ross) #25

wow, I can't believe I didn't look there first.:confounded:

Thanks!


#26

OK, I am trying your new code v1.0.3 and it seems to be working now. Detects motion and then goes inactive after a minute. "Motion has stopped" now shows in my activity log. Maybe I didn't have a bad device after all.

One thing, when device detects motion, it sends two Active commands to ST. Is that the device or your code doing that? My activity log will show Motion detected twice at the same moment. See below.

Also, anyway to decrease the inactivity timeout anymore than 1 minute?

27f914c0-d90a-4c51-b7fb-fae84aadce5f 10:51:53 AM: trace Parse returned [name:motion, value:inactive, descriptionText:Monoprice Motion and Temperature Sensor motion has stopped, isStateChange:true, displayed:true, linkText:Monoprice Motion and Temperature Sensor]
27f914c0-d90a-4c51-b7fb-fae84aadce5f 10:51:53 AM: trace BasicSet(value: 0)
27f914c0-d90a-4c51-b7fb-fae84aadce5f 10:51:53 AM: trace Parse returned [[name:motion, value:active, descriptionText:Monoprice Motion and Temperature Sensor detected motion, isStateChange:false, displayed:false, linkText:Monoprice Motion and Temperature Sensor]]
27f914c0-d90a-4c51-b7fb-fae84aadce5f 10:50:36 AM: trace Parse returned [name:motion, value:active, descriptionText:Monoprice Motion and Temperature Sensor detected motion, isStateChange:true, displayed:true, linkText:Monoprice Motion and Temperature Sensor]
27f914c0-d90a-4c51-b7fb-fae84aadce5f 10:50:36 AM: trace BasicSet(value: 255)
27f914c0-d90a-4c51-b7fb-fae84aadce5f 10:50:36 AM: trace Parse returned [[name:motion, value:active, descriptionText:Monoprice Motion and Temperature Sensor detected motion, isStateChange:true, displayed:true, linkText:Monoprice Motion and Temperature Sensor]]

(www.rboyapps.com - Make your home your butler!) #27

That's the device.

The minimum is 1 minute, if you put 0 it'll never send a inactive signal. (the code prevents 0 anyhow).


#28

Now I don't know whether it's my device or your code now. When using the Aeon Multi sensor device type, it works fine. It stops detecting motion after 3 minutes. With your code, after three minutes, device is still showing motion detected. From looking at the logs after the timeout, the device is sending an inactive followed by active command making the device still detecting motion.


(Ross) #29

RBoy, mine is getting stuck in Motion mode too. I haven't tried going back to the Aeon device type.


#30

@RBoy, here are logs from my custom Aeon Multisensor device type. You can see it sends active motion once and 3 minutes later inactive once.

Also, I think the Monoprice motion sensor is locked at 3 minute timeout.

08006abb-d3fa-49dc-99a1-a70af8a8ecc6 1:47:47 PM: debug Parse returned Central Motion Sensor motion is inactive
08006abb-d3fa-49dc-99a1-a70af8a8ecc6 1:47:46 PM: debug Parse returned null
08006abb-d3fa-49dc-99a1-a70af8a8ecc6 1:47:46 PM: debug Catchall reached for cmd: NotificationReport(event: 2, eventParameter: [], eventParametersLength: 0, notificationStatus: 255, notificationType: 7, reserved61: 0, sequence: false, v1AlarmLevel: 0, v1AlarmType: 7, zensorNetSourceNodeId: 0)}
08006abb-d3fa-49dc-99a1-a70af8a8ecc6 1:44:16 PM: debug Parse returned null
08006abb-d3fa-49dc-99a1-a70af8a8ecc6 1:44:16 PM: debug Catchall reached for cmd: NotificationReport(event: 2, eventParameter: [], eventParametersLength: 0, notificationStatus: 255, notificationType: 7, reserved61: 0, sequence: false, v1AlarmLevel: 255, v1AlarmType: 7, zensorNetSourceNodeId: 0)}
08006abb-d3fa-49dc-99a1-a70af8a8ecc6 1:44:16 PM: debug Parse returned Central Motion Sensor motion is active

(www.rboyapps.com - Make your home your butler!) #31

It's working fine here with the v1 hub.

Use the latest 1.0.4 code. Set the timeout to 1 minute and force a manual update (see the first post).

Also note that when it says one minute it actually takes maybe 2-3 minutes. When it's set to 3 I see the sensor actually take 4-5. This isn't a very good quality sensor.

I would recommend. Delete the device and start over to avoid any issues switching between device types. Also make sure it isn't too far from your hub for testing proposes first.


(Ray) #32

Unless you put the jumper inside the cover to test mode then it will be 1 minute.


#33

I re-added device and using 1.0.4 code. Device is still getting stuck in motion detected state after 1 minute when I have my timeout set to 1 minute and after 3 minute when I have my timeout set to 3 minutes.

From below, I think the active state after the timeout period is causing device to get stuck in motion. I let it sit for 5 minutes and no other activity is logged.

Log from 1 minute timeout set

ba044721-71c6-4726-b0f2-d7eacf8671c1 3:37:37 PM: trace Parse returned [[name:motion, value:active, descriptionText:Central Motion Sensor detected motion, isStateChange:true, displayed:true, linkText:Central Motion Sensor]]
ba044721-71c6-4726-b0f2-d7eacf8671c1 3:37:37 PM: trace Parse returned [name:motion, value:inactive, descriptionText:Central Motion Sensor motion has stopped, isStateChange:true, displayed:true, linkText:Central Motion Sensor]
ba044721-71c6-4726-b0f2-d7eacf8671c1 3:37:37 PM: trace BasicSet(value: 0)
ba044721-71c6-4726-b0f2-d7eacf8671c1 3:36:28 PM: trace Parse returned [[name:motion, value:active, descriptionText:Central Motion Sensor detected motion, isStateChange:false, displayed:false, linkText:Central Motion Sensor]]
ba044721-71c6-4726-b0f2-d7eacf8671c1 3:36:28 PM: trace Parse returned [name:motion, value:active, descriptionText:Central Motion Sensor detected motion, isStateChange:true, displayed:true, linkText:Central Motion Sensor]
ba044721-71c6-4726-b0f2-d7eacf8671c1 3:36:28 PM: trace BasicSet(value: 255)

Log from using 3 minute timeout set

ba044721-71c6-4726-b0f2-d7eacf8671c1 3:46:59 PM: trace Parse returned [[name:motion, value:active, descriptionText:Central Motion Sensor detected motion, isStateChange:true, displayed:true, linkText:Central Motion Sensor]]
ba044721-71c6-4726-b0f2-d7eacf8671c1 3:46:59 PM: trace Parse returned [name:motion, value:inactive, descriptionText:Central Motion Sensor motion has stopped, isStateChange:true, displayed:true, linkText:Central Motion Sensor]
ba044721-71c6-4726-b0f2-d7eacf8671c1 3:46:59 PM: trace BasicSet(value: 0)
3fcca82d-ccb8-4c5c-b730-4df5d72408cc 3:43:52 PM: trace getPhrases(), state.welcomeIssue = null
ba044721-71c6-4726-b0f2-d7eacf8671c1 3:43:32 PM: trace Parse returned [[name:motion, value:active, descriptionText:Central Motion Sensor detected motion, isStateChange:false, displayed:false, linkText:Central Motion Sensor]]
ba044721-71c6-4726-b0f2-d7eacf8671c1 3:43:32 PM: trace Parse returned [name:motion, value:active, descriptionText:Central Motion Sensor detected motion, isStateChange:true, displayed:true, linkText:Central Motion Sensor]
ba044721-71c6-4726-b0f2-d7eacf8671c1 3:43:32 PM: trace BasicSet(value: 255)

#34

I tried the jumper trick and nothings changes on the sensor. I believe it does not work on Monoprice model.


(www.rboyapps.com - Make your home your butler!) #35

Your log is showing that's its going inactive but the it goes active again. Either the sensor is sending an active link or you have phantom event issue with your instance.
First one is easy to isolate. Cover it with a blanket and see what happens.

If it's the second you may need to contact ST support to find out why.


(www.rboyapps.com - Make your home your butler!) #36

Here's why I think your have a phantom event issue with your cloud instance.

If you look at the debug events, you'll see the "physical" notification from the device:

ba044721-71c6-4726-b0f2-d7eacf8671c1 3:37:37 PM: trace BasicSet(value: 0)

The 0 is indicating that the event is no motion. Each time the physical is called the code sends one *and *only one event.
so the immediate next event is:

ba044721-71c6-4726-b0f2-d7eacf8671c1 3:37:37 PM: trace Parse returned [name:motion, value:inactive, descriptionText:Central Motion Sensor motion has stopped, isStateChange:true, displayed:true, linkText:Central Motion Sensor]

Whis is correct, it's telling ST that the motion has been turned off.

But then right afterwards you see another event being reported to ST:

ba044721-71c6-4726-b0f2-d7eacf8671c1 3:37:37 PM: trace Parse returned [[name:motion, value:active, descriptionText:Central Motion Sensor detected motion, isStateChange:true, displayed:true, linkText:Central Motion Sensor]]

This one tells ST that the motion has been turned on. However, *I don't see any "Physical" notification *from the device being sent.
Hence I think this is a "phantom event" originating from a cloud issue that ST support needs to look into.

BTW this problem isn't unique to you. It's been around on the cloud for a long time just that I haven't seen it rear it's head a while now.


(www.rboyapps.com - Make your home your butler!) #37

I can suggest one more thing to try to force the ST platform to resync and possibly avoid a ghost motion event. Force the state change while reporting the event.

One lines 111 and 113 where it's createEvent is used to report motion, add this to it

, isStateChange: true

See if that fixes the ghosting issue.


(www.rboyapps.com - Make your home your butler!) #38

Bingo! I was able to replicate it, it happened JUST ONCE but I was able to get it to replicate. This is definitely a ST platform issue. It's creating ghost events, infact I got 1 real and 2 phantom events!

e1de53af-0260-43c5-8ed3-ee400586e9fd  6:23:13 PM: trace Parse returned [[name:motion, value:active, descriptionText:Room Motion And Temp Sensor detected motion, isStateChange:false, displayed:false, linkText:Room Motion And Temp Sensor]]
e1de53af-0260-43c5-8ed3-ee400586e9fd  6:23:13 PM: trace Parse returned [name:motion, value:inactive, descriptionText:Room Motion And Temp Sensor motion has stopped, isStateChange:true, displayed:true, linkText:Room Motion And Temp Sensor]
e1de53af-0260-43c5-8ed3-ee400586e9fd  6:23:13 PM: trace BasicSet(value: 0)
e1de53af-0260-43c5-8ed3-ee400586e9fd  6:22:02 PM: trace Parse returned [name:motion, value:active, descriptionText:Room Motion And Temp Sensor detected motion, isStateChange:true, displayed:true, linkText:Room Motion And Temp Sensor]
e1de53af-0260-43c5-8ed3-ee400586e9fd  6:22:02 PM: trace BasicSet(value: 255)

The cure was to add the "isStateChange: true" and it resolved the issue.

I'll also report this to ST but I'll update the device and put it up for now.


(www.rboyapps.com - Make your home your butler!) #39

@Ross @Mclovin50 I've put a temporary patch in the code version 1.0.5 but this is a ST platform issue with Phantom events.

Please report it to ST support along with your logs showing the extra events being generated so they can fix if (prior to updating to version 1.0.5).

Anyone else seeing it also please report to ST support.


(Ross) #40

Thanks RBoy! I added the lines manually and it seems to be doing the trick.


(www.rboyapps.com - Make your home your butler!) #41

Great but please report it to ST along with your logs. They will need enough instances to realize it's a system wide issue


(Ross) #42

Unfortunately, it's still doing the same thing. :rage:
Immediately after it stops detecting motion it detects motion and just stays that way. ST, you are killing me!