[DEPRECATED] Xiaomi Mijia Smart Light Sensor (moved to ST's Edge driver)

Will these work when classic and IDE/groovy are depreciated?

If SmartThings doesn’t provide an easy path to make things like this work, they will lose a lots of users, which will mean lots of used hubs on the market.

I agree but I don’t think we are their demographic.

1 Like

If someone makes them work in whatever replaces Groovy device handlers before they get switched off, then yes. You just have to decide how likely that is. I tend to favour ‘very likely’.

2 Likes

what @orangebucket said… :wink:

I can report after DTH added in ide, on scan in new app added all ok after a few attempts to pick up the sensor. Presented through to Home Assistant nicely. Second Sensor ordered.

Thank You for you work.

Phill.

2 Likes

Just bought one to try and it works perfectly. Will monitor for a few days.

Hey @johnconstantelo, thanks so much for the DTH. I’ve got 4 of these in place now and working an absolute treat. One suggestion, and this may not even be possible, but is it possible to have the Tile show the illuminance instead of battery?

I forget whether it supports lux for tile view but if it does you can just make a new vid via the cli with this layout

Yes, as per @mvevitsis reply. I haven’t done anything with the CLI yet as it seems to still be causing issues and is a bit buggy for more experienced developers. I will eventually get to this once CLI is proven usable for me.

On a side note, ST does have an ofcdevicetype set up for illuminance capabilities called “oic.r.sensor.illuminance”. I use to have that in the DTH, but it didn’t help. Technically the new app should have picked up illuminance before battery, and it has for me for the exact same sensor but on two different OS platforms (android and the webclient beta). See post 43 above for screenshots.

Once I update the DTH to properly display LUX in the new app I’ll definitely post an update to this discussion.

2 Likes

Hey guys, I was looking for the product description and it says it could only be paired with Xiaomi HUB or another hub with zigbee 3.0. Could anyone confirm that this could be paired with the ST hub v2?

Confirmed.

2 Likes

Hi guys,

Would it be possible to make an automation to say, if there is low lux (if someone could suggest a value for a cloudy day?) and if an existing motion sensor detects motion. Then turn on the lights?

Thanks all

Yes. Use a relay and the app smart lighting. Turn the relay on when lux is at desired value. Have smart lighting trigger the lights when there is motion, but only when relay switch is on. Done.

1 Like

Thanks for that, I was more thinking of an automation where:

If motion is detected AND lux is whatever amount THEN turn on light

Is that possible?

Yup, see below:

My automation only runs between sunset and sunrise, and then only when motion is detected and LUX is 0 for 2 of my light sensors. If all those conditions are met, then I turn on the LED light ring and set it to blue on my Halo smoke detectors.

My “motion switch” is a virtual switch that is turned on whenever certain motion sensors are tripped. I had to do it that way because Automations can’t do a combination of AND and OR. I really wanted the Automation to look at 5 different motion sensors (the OR part), and if any one of them were tripped and lux was 0, then turn on a light. Here’s an example of a single motion sensor and light sensor turning on a light:

August 7, 2020 Update:

  • Added/Updated mnmn and VID values to have LUX show up properly in the new app vs. battery level or “checking status”

https://raw.githubusercontent.com/jsconstantelos/SmartThings/master/devicetypes/jsconstantelos/my-xiaomi-mijia-smart-light-sensor.src/my-xiaomi-mijia-smart-light-sensor.groovy

Thank you to @orangebucket for his valuable contribution.

Notes:

For those already using this DTH, to get the new app to update the tile properly, you can clear the app’s cache, or use the IDE to change the device like I did (and this worked for me):

  • Change the Name and Label fields to something different (may not need to do both, but I did just in case).
  • Change the Type field to “Illuminance Measurement Capability”.
  • Click on Update and then wait until the LUX value changes (may not need wait, but I did)
  • Go back and change Name, Label, and Type fields back to what they were and eventually the new app will update:


FYI @mvevitsis, @Pogga @JBR @RoyKwong

5 Likes

:man_dancing:

1 Like

Thats great thanks!

Anyone have any idea what would be a good starting point to tune on the lights if its a pretty cloudy day. I have no idea what a good starting lux would be, or even what the range for this is between full daylight and night (though im guessing 0 lux for night lol)

Thanks

1 Like

It depends upon where you place the sensor. I’m using one in my family room and have it turning on the light when lux goes under 10, and turning it off when lux goes above 20. That handled the cloudy day issue for me. But those lux values are what I needed in my north-facing family room. They might be different for a room with more sun. The easy way is to place the sensor in that room and then look at the values for various parts of the day.

(FWIW, I took the same sensor outside on a sunny day; it jumped to 95000).

You also need to be careful to place the sensor in a location that is not illuminated by the light it turns on. I didn’t do this at first, and when things started working the light would go on and then off and then on and then off…