[RELEASE] Zooz 4-in-1 Sensor


(Brian Spranger) #226

Kevin, is the 4-in-1 monoprice sensors supported on hubitat? I picked up a hub and see your over here too.

Would like to move these sensors over to the hubitat for local control of the lights

(Fubka) #227

My sensor (monoprice) keeps on sending me alerts while I am at home by sending notifications for motion as "active). The SmartThings app does not report this as a warning, but still with a notification. How can a stop notifications while I am at home every time I move on the couch or walk into the room? Thanks.

Note, I even get notifications when the system is disarmed.


Update, the new version is available at our website now as well (click here to get it)!

(Magnus Back) #229

How fast is the motion detection now?
I have the Monoprice variant and it’s so slow, takes over 5s to detect motion sometimes.


It takes around a second depending on sensitivity settings.

(Alec McLure) #231

I’m liking this sensor a lot - but have no idea how to edit the DTH so I can avoid decimals entirely (not just on the primary) - I certainly don’t need anything but integers for, say, humidity (and no, I want motion as my primary). I’ve tried with math.round but apparently never in the right place- would love a clue! Thanks!

(Kevin) #232

If you change line 863 in the “applyOffset” method to the following it should round the values the next time they’re reported.

return Math.round(val)

(Alec McLure) #233

Hello Kevin, @krlaframboise

First - thanks much for responding! I tried that and got
"error java.lang.NullPointerException: Cannot invoke method round() on null object @line 865 (applyOffset)" in the log (as I was getting in my earlier attempts). An earlier debug line shows that me that val has a value after offset applied - so confused that it’s not passing in. But - I’m kinda new at this.

(Note: line 865 instead of your line 863 because I’ve been adding some comments - it’s the right line) .

I’ll keep on trying to figure it out - but let me know if you have any other inspiration.

(Reason I care is because I’m adding some icons and background colors for temp and humidity and could really use losing the decimal point).


(Joe) #234

I just changed this and as the values are now reporting back in, they are rounded.

return Math.round(val)


Ok Fukba,

I’ll bite. Go to your dashboard and change the setting from armed/away to disarmed? Also check the smartapps notify me when and make sure it only alerts you disarmed away…

(Alec McLure) #236

Thanks Joe @noot - I’ll try again from a fresh copy - if you look at the logs do you see any errors?

(Alec McLure) #237

So, I made the changes again from fresh install - as I should have, to begin with. It looks like the problem at least for me is when the offset is 0 - here’s an example with lux and light% set to 0, then to 1

I changed the method to

( so I took out the if(offset) basically - so even if zero it will do the addition math/conversion))
and now they are all reporting fine without errors in the log.

(Note - this is what worked for me - not necessarily recommending for anyone else - I’m still a novice at this - doing as a self-learning exercise - this might break something I’m not even aware of. ).

Thanks for the hints, @noot and @krlaframboise!



@krlaframboise I am using your DH for a Monoprice 4-in-1. It was a bit or a learning curve for me getting it all up and running (one very key point was having the sensor close to the hub when forcing it to wake up to accept updates - and multiple pokes of the sensor button if there are multiple settings pending). Anyway, I am left with one anomaly. The small tile that denotes No Motion/Motion does does not seem to function properly. If motion is detected then the main tile will reflect as such but the smaller tile never does. If I drag down on the screen while motion is active I can see it set the small tile to blue/motion very briefly but then it sets back to No Motion.

I am using iOS. Any thoughts?

EDIT: The motion status sticks if I change it to a standardTile but then the text is smaller of course. Just FYI for all. Yet another Android/iOS difference.

(Kevin) #239

SmartThings sucks…

It’s virtually impossible to get the UI to look good on iOS and Android. Both mobile apps also have caching issues which is why it sometimes takes a while for the tiles to change state.


Agreed and understood.

I took your handler and reworked it this afternoon for iOS and added icons and a few other tweaks. I do thank you for providing the handler to work off.


I did some more digging today and see that this was actually already reported some months back by someone else. I’ve basically determined that this tile and the tamper tile need to be coded as a standardTile in the iOS world or the app will indeed flash the change very quickly then return to the original state. This also affects the tile that is supposed to display the number of pending changes. For example, if there are zero changes pending the DTH tries to display blank for the tile label but on iOS as the DTH is currently coded it shows ‘0 Change(s) Pending’ instead - just like the motion and tamper tiles it’s not displaying the labels matching the current state. I chose not to change this particular tile to s standardTile to get the intended tile labeling because the text gets truncated due to space.

Sorry for the rambling but I thought it worth documenting.

Like others I have made my own tweaks (I wish there was a battery icon in the stock ST icons - I may still change that at some point):

(MGPacella) #242

No signature of method: script_app_metadata_5a24d6d7_aa63_4283_9830_df9ff8b5e401.metadata() is applicable for argument types: (script_app_metadata_5a24d6d7_aa63_4283_9830_df9ff8b5e401$_run_closure1) values: [script_app_metadata_5a24d6d7_aa63_4283_9830_df9ff8b5e401$_run_closure1@2c0b002a] Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)

I keep geeting this fault when I try to create???


Make sure you are trying t create a Device Handler and not a SmartApp.

(MGPacella) #244

Ok it worked now I have the device handlet what do I do next???


If you have already included your sensor to SmartThings you need to go to Devices in your IDE and edit the sensor’s type to the hander you just installed. If you have not already included your sensor to Smartthings then when you do it will pick up the new handler automatically.