Joe’s reuse of old OSM prototype.

Devtank’s first OpenSmartMonitor install was updated a few months back, with the old sensors coming back to the Devtank HQ. These old models we learnt a lot from, but they have become obsoleted by the newer sensors.

As I needed to get the electrics of my house brought into this century, so I could fit a EV charger, I had also got a Modbus meter fitted. The OSM has always been able to read Modbus over RS485.

Now the OpenSmartMonitor firmware has been completely rewritten since the original sensors where built, but the old OSMs where going free to a good home and I can’t stand e-waste, so a personal project was born!

https://github.com/jabjoe/osm_legacy_port

Porting the new firmware to the old hardware wasn’t too bad work wise. The new firmware was already cross platform to support the STM32 and Linux for automated testing. So I just did a quick and dirty third port to the ESP32 of the old sensor. It was was pretty much entirely in vim on my phone over Termux and SSH to hide my evening development and pretend to be playing Candy Crush or something like a normal person!

Now the first ones were ESP32 based with a LoRa chip for the comms. I don’t have or need LoRa at home, so I moved the antenna connector to the ESP32 own wifi.

Hardware mod complete! I can call myself a hardware engineer now right? [Devtank’s hardware team say absolutely not]

The OpenSmartMonitor firmware already had the exact comms and protocol abstracted, so I added the ESP’s wifi as comms and the JSON over MQTT as the protocol.

Job done for my purposes, attach to wall!

This work will make it’s way into the OSM firmware in the end. After a fair amount of clean up…..

I hooked that MQTT into Home Assistant along with my other home automation.

However, I want to inspect the data more than that. So I moved Home Assistant to MySQL, which it semi supports instead of SQLite. Then pointed Grafana at the database and I now get what I wanted, pretty graphs of anything I need.