AsI was sitting checking my Aqara Zigbee temperature sensors (blogged a while ago – the CR2032-powered model WSDCGQ11LM) using the Node-Red nodes for the job, I noted that if I covered the sensor with my hand for a few seconds, I’d get a reading – sadly, not just that but THREE readings within a second. No problem with one sensor but if you have several and there’s, say, a gust of wind, that could end up as one hell of a lot if un-necessary info coming back at you.
So off I went to use the RBE node which only allows payloads through for a given topic, on change. Two issues there, RBE is no more, replaced by the “filter” node – and I’m neither using msg.topic nor msg.payload. Easily solved – read on.
So above you see my incoming nodes giving the complete state of each of my two Aqara sensors. In that object there is a LOT of info but you can directly access msg.device.friendly_name and msg.payload.temperature which is what I do with that cream-coloured function node. But FIRST I’m now using the filter node included in Node-Red since around Node-Red 2.0
Filter usage is default – note in the image on the left what I’ve put in there.. and sure enough it works – the function to the right then merely converts msg.payload temperature into payload plus a space and msg.device.friendly_name into msg.payload for the debug. Works a treat.
if only life were generally this simple. Instead of a barrage of info I now get only what I need. Next step is to add a simple .toFixed(1) to the temperature part to get rid of that over-the-top level of precision. Done. Of course the sensor itself is still producing that information.
msg.payload : string[17] "23.4 aqara-temp-1" 12/01/2022, 22:11:17 msg.payload : string[17] "23.5 aqara-temp-2" 12/01/2022, 22:11:24 msg.payload : string[17] "24.1 aqara-temp-1"
Just to be awkward, my Aqara TVOC sensor has a different format – out of that comes msg.temperature, msg.humidity and msg.voc so this isn’t a universal technique but you get the general idea. I looked at the entire object coming from the node I had set up to read the TVOC to find that out.
Meanwhile I’ve been keeping an eye open for the battery life of the WSDCGQ11LM sensor. NOt that good – I can’t be exact but I have several of these unit dotted around the house and outside in our pergola. I just replaced the battery in the latter as the voltage was down to 2.85v and reporting as 10% left, this after only a few months.
Indeed I spend more time changing batteries on sensors than I care to think about. I’d work on rechargeable and a solar cell if the rechargeable CR2032 batteries weren’t the rubbish that they are.
My neighbour and I checked last summer, a batch of rechargeable CR2032 compared to the normal non-rechargeable versions… 10% of the already not-exciting capacity of the standard CR2032 – so that’s not going to fly. In winter you could get a few weeks of no bright sunlight and that would be that. This is not a problem specific to Aqara of course, I’ve had similar sensors from Sonoff and others and again, the battery life in real use rarely compares to the bold advetising claims.
I DO like the Aqara sensor for size and accuracy as well as handling temperature, humidity and pressure – but maybe it’s time to forsake the convenience of wireless operation and consider replacing that battery with a simple, tiny 3v3 linear regulator – after all, 5v USB supplies are 10-a-penny and in any technical house, usually all over the place. Worth a thought. I have solar power feeding my pergola (for outside lighting) and In the control box is a 5v switched supply. Of course I’d have to see how well the sensor responds to such a supply as there is certainly no room in the case for a smoothing capacitor.