@florianz: Iāve bought a bunch of Monoprice Motion sensors and I springboarded Device Type development using your code for these sensors.
So Iām a total noob with just a day of groovy/smartthings experience so any feedback would be appreciated. I was able to figure out a few things and sent you a pull request to the heavily modified version that adds the following:
Ability to set the really annoying 3-minute default for the Inactivity Trigger to fire. The real minimum is 1 minute.
Added a battery tile and battery updating during waking up at least 24 hours.
If anybody is interested to try it out, the latest code is on:
How to get it to work:
Once you update the code, the Inactivity Timer setting is inside the āPreferencesā tile. Its blank by default (which will use 1 minute).
After youāve set the preference, to make each motion sensor get the new setting immediately, you have to:
Open the motion sensor.
Wait until the red light steadily lights up and add a few seconds to that.
And close it.
If its successful, battery status should show up on the tiles and of course inactivity trigger should be what you set it is.
If it doesnāt work, feel free to send me logs as that code is heavily logged AOTM.
Hope it works for you!
Iām very hopeful this reports battery, that would be awesome. Iāve updated my code. I have 5 of these devices. Have you found anyway to get it to update temperatures more often? It seem to need a drastic change else it only reports every 12 to 24 hours.
I think it reports temp changes only and in degrees celcius. Try putting one in the fridge and see if it reports more often. If there is not a whole degree celcius change then no update.
I actually have no qualms in the temperature readings⦠But then again, i donāt check temperature that often.
I think to save power it only checks ever so often, which hopefully would be tweakable⦠unfortunately I havenāt seen that in any documentation I could get my hands on.
Currently its 100% for me. Coz I just bought them a few weeks back so the batteries are brand new.
Or the hardware is just faking it by constantly saying 100%. I guess your battery is pretty old?
Fantastic, this worked and my Monoprice Motion sensors are now showing battery. Of my 3 monoprice sensors, 2 show 100% and the most active of the 3 shows 83%.
Iāll add that once I closed the cover in step 2.3 and the led turned off, the Activity report for the device showed the battery level in the app; however before the battery tile would show up, I had to kill the SmartThings app and relaunch it.
@kranasian - First Happy Thanksgiving and thanks for your posting. Iām a newbie at adding code to the ide console and are not a programmer. but the code and your instructions helped me setup a new device type for my hub.
I have two monoprice motion sensors. By adding the provided device type. immediately issues were solved.
On my android phone the temperature would not show up in the āThingsā category. It now does!
The battery level also did not show up. It now does! One of the batteries is a first time install so there is a possibility it is 100%. The other has been in use for 6 months now, it also says 100%
Another indicator that something else needs to be tweaked on my settings is that i also have four (4) monoprice door and window sensors that have been in use for ~6 months and they too say the battery is at 100%
I bought 3 Monoprice Open/Close sensors, so Iāll get what @florianz did and see what is still missing there. Last time I checked it looked pretty solid functionality already.
Thanks - The monoprice open/close door sensors along with the monroprice motion sensors are all reporting battery level @ 100% The door sensors and one of the motion sensorās are over 6 months old so my my guess is the battery level should be less then 100% by now?
I see. Iāll take a look sometime this week. But it might be a hardware limitation, so weāll just have to see. I have one thatās a month old and has been āopenā the whole time so it should have non-100% battery.
I updated my device type to this one. The one minute timeout works great thanks! However, Iām still showing 100% battery which canāt be true. Iām also not seeing battery reporting in the log at all.
@kranasian Just a quick update. Itās been a month since my last update and my Monoprice motion sensor that said 83% battery still says 83% battery⦠The other 2 Monoprice motion sensors that said 100% still say 100%. 2 of these are in high traffic areas (1 83% battery, 1 100% battery) and the third (100% battery) is in an ultra low traffic area. I realize this may be a hardware issue beyond your control, just making a report.
Thanks for the update! So far mine has been 100% also. I donāt think it drops in 1% increments, since voltage drops at this granularity would be hard. So iām just hoping to it actually drops to lower than 20%.