# Indoor Activities

Autumn seems to have caught up with us, even if it feels like it’s just blundered inside and cannot make up its mind as to whether it locked the car (it’s rained a bit this weekend, but rather perfunctorily, and the sun has shone through on a few occasions).

As usual around this time of year, I’ve been trying to disengage from the social cacophony that Eternal September seems to have evolved into. I usually do that by decreasing the time spent online and removing self-serving echo chambers from impinging upon my downtime, which has been a great success–I’m pretty much off Facebook, only follow a handful of friends and family on Instagram, and other than Slack and Twitter (in which I am moderately active), there is little else to curb.

So having become a regular user of LinkedIn over the past few years (given that it is by far the most important social network in my line of business, irrespective of it being owned by my current employer, even though it is essentially useless for anything but social marketing these days), I set myself the goal of unfollowing/unlinking ten people a week until I can open the app and actually get useful news out of it rather than self-congratulatory/promotional posts.

## Measuring The Force

I recently had both of our energy meters replaced by Landis+Gyr ZCXe110CR models, so of course I’m going to revisit my previous attempts at reading meter data, except that this time there is no need for OCR —these meters have a blinking LED that lights up every watt-hour:

They also report our energy consumption via PLC to a remote controller, but there’s no way I can tap into that… Well, none that I feel like tackling, that is.

I have a bunch of TCRT5000 IR reflective sensors about (both with and without breakouts) I had bought to try to read the old rotating disc meters, so I am looking at just sticking one against the LED and using a trivial pull-up resistor setup to use the phototransistor half of them (but haven’t tested that yet).

## Hooking Things Up

In short, I have two main options. The first is the most reliable, but also the most involved:

Grab an ESP-01 module and build what is essentially the same setup as my first doorbell extender, but instead of writing my own sensor handling in C++, I’m going to be lazy about it and use the “push button” functionality of the Tasmota firmware to get an MQTT notification when the light blinks.

Should be only a matter of picking the right pull-up resistor and (crucially) seeing if the LED falls into the IR spectrum the TCRT5000 is sensitive to.

But that requires powering the ESP-01, so another alternative that might work is to hack one of the Xiaomi Zigbee contact sensors (again like I did for my doorbell extender, but replacing the magnetic reed switch). This has the potential to be much neater (zero wiring) but might not work depending on the phototransistor’s forward current and the length of the light pulse, either of which might not be enough for the contact sensor to fire.

A quick test done by shunting the reed switch with one of the phototransistors almost worked, but not reproducibly so since I am having trouble with Zigbee coverage around the house and probably need to sort that out first.

Regardless of sensor type the pulses will come in as MQTT events, so to measure power consumption I’ll just pipe everything into my metrics system and compute a moving average.

I am curious as to whether I can expose it as a simulated HomeKit power meter (since the official spec doesn’t really cover energy meters yet), but there seem to be devices out there doing that already, and I should have no trouble reproducing their proprietary characteristics…

Hopefully it will all be done before we put our heaters back in rotation, so that I can chart power consumption over the winter period.