pvvx / ATC_MiThermometer

Custom firmware for the Xiaomi Thermometers and Telink Flasher
https://github.com/pvvx/pvvx.github.io/tree/master/ATC_MiThermometer
Other
2.95k stars 205 forks source link

LYWSD03MMC, FW 4.7, BTHome v2, HA: What exactly does the "Power" sensor report? #566

Open Moonbase59 opened 2 hours ago

Moonbase59 commented 2 hours ago

Thanks for your and atc144's fantastic work on all these temp/humidity sensors!

I have one question I couldn't exactly find out. In Home Assistant, using the BTHome integration, a "Power" sensor shows up and goes on and off for my LYWSD03MMC devices (FW 4.7, set to BTHome v2 and all defaults):

image

What exactly does this sensor report?

It seems to go "on" more often (or permanently) when I place the thermometer in "bad conditions", like into the fridge, or outside. Did I maybe find an "easter egg" and it actually reports being within the set "comfort zone"? Comparing temp/humidity at the times it switches on and off somehow seem to hint at that.

(Having a function like this would actually be useful: One could set the "comfort zone" to something meaningful, like the optimum fridge temperature or the like… and get an alert if something was "outside range". Only the label "power" is a bit misleading should this be the case.)

pvvx commented 2 hours ago

README: Temperature or humidity trigger (GPIO PA5 LYWSD03MMC label on the "reset" pin)

https://pvvx.github.io/ATC_MiThermometer/TelinkMiFlasher.html image

Moonbase59 commented 49 minutes ago

Ah, thanks for the pointer, missed that one. ;-) Let's see if I can use it for something…

Do you think we could advertise something like "within/without comfort zone" easily, as a binary sensor? Like reporting the same as the smiley face? Maybe in a future version?

This could make for a higher "partner acceptance factor"—we could set a "comfort zone" (shown by the smiley + the sensor) and report that back to HA. Thus, the girlfriend/wife/partner wouldn't have to check HA but also see the same info on the smiley, and us "techies" had the same info in HA, easily. That should allow for more possibilities than just the value+hysteresis.

It would also allow for easier "out of range" automation in case of alerts, like for bedroom, plant conditions, fridge, etc. (No need to program templates for each.)

For example, I've set my fridge thermometer to a "comfort zone" of 5–8 °C, and 40–55% humidity, so everyone can see at a glance if "the fridge is happy" (within ranges). Having that reported back to HA could make for easy notification if it gets too cold (wasting energy), too warm (door open, defect), or too wet inside. I currently have to repeat these conditions in the automation, a "within range" sensor would make that easier, especially if one has a lot of these little gadgets. :-)