Posts

Energy monitoring and creating a code black hole...

 I want to improve my energy monitoring system, which is currently based on a Chinese Tuya device, which uses a CT clamp, and is interrogated every 30 seconds by a Python script on an RPi. This device talks to the Tuya cloud, and accessing it locally on the LAN requires a Tuya developer account and lots of shenanigans. it is also about 3% out, which is boring. Ideally I'd just get someone to fit a wireless-enabled inline device which actually measures the current, rather than using a CT clamp. However, these don't seem to exist, so I'd need An inline device like an Eastern SDM120M, which does ModBus, sadly over RS485, which is a PitA Another device to use ModBus to interrogate the SDM120, and do something with the data The OpenEnergyMonitoring (OEM) approach is to use a RPi in conjunction with a RS485-USB converter plugged into the RPi's USB ports. I have obtained a PZEM-016 CT-based power monitor, which is apparently 1% accurate, which also has ModBus over RS485, and I

Open Energy Monitor - homegrown emonPi Construction (part 4)

 I think I might have had a  breakthrough in the simplified construction of the OEM energy monitoring equipment. I was looking for a helpful guide to migrating/porting AVRmega328p functions to ESP8266, and what did I find? A forum post asking for assistance in using their combined Arduino mega328 and ESP8266 board!! Wow. Comes with a nifty DIP switch array to select which chip talks to what, so you can programme the two chips separately, and also monitor the serial output of either. There is also a setting where they just talk too each other serially. This is amazing! I can easily run the standard OEM ADC software, carefully constructed to provide good data, and have it send the data, rather than to a RPi as it currently does, send it to the the ESP8266 which can forward using wifi to whatever destination I choose. This is brilliant! And it's costing me about £7 delivered from China. Result! Even if it doesn't do what I want, it's a very handy piece of kit . What's more

Open Energy Monitor - homegrown emonPi Construction (part 3)

 This project has been parked for a bit while various other things happened. I've been working with the ESP8266 in its various guises for a while now, and it's a very impressive and flexible piece of kit, largely because of its WiFi (and Bluetooth on the ESP32) capability. This opens it up to being used in lots of instrumentation projects, especially coupled with the ease of using firmware like Tasmota , which enable using it with minimal coding. So rather than just pick up where I left off (which I really should!), I've been looking at implementing some of the emonPi functions in an ESP8266. In principle this should be possible, especially as the OEM people re apparently looking at such things as well - they've even got an add-on emonESP that uses one to link the original Arduino-based hardware to Wifi. I just tried compiling the emonPi/firmware/src code in the Arduino 2.0.3 IDE, which of course exploded. In order to get it just to compile, and bearing in mind I was pl

Adding Smartwares RM175RF Smoke Alarms to NodeRed

Image
I recently acquired a Ring house alarm system, and was looking for a means of including smoke alarms in the system. It appears that you can get ZWave-enabled smoke alarms in the US, which work with the US Ring systems, but because of a difference in the permitted radio frequency bands, they don't work in the UK and EU. Bum. And nobody seems to have done the same thing for any in this geography. However, my NodeRed is equipped with RFLink, the nifty NL-based 433MHz wireless system, which I already use to control some light switches and listen for the Friedland doorbell . The latter uses a Telegram interface and a bot to send a Telegram message when the bell rings, and has worked fine for a long time. I was reading through the latest RFLink supported devices list and realised it contains smoke alarms!! I patiently worked my way through the list until I found some that were available in the UK, handily from Amazon, so I didn't have to wait long. I bought Smartwares RM175RF in a do

Sofar HYD6000-ES Inverter RS485 data logger part 2

Image
Right, got the nonRS485 stuff all working. Tweaked the code considerably to add  Added ESP8266mDNS to advertise on the local LAN using mDNS to make it easy to find A website that displays the most recent data on a simple page; I dropped the very complex ESP8266WebServer in favour of the WiFiServer class A reset page that resets the configuration and asks for new details.  A "noRS485" flag, set on compile, but could be configured via a webpage if required so it's less twitchy about not having RS485 connected for testing Dummy data if noRS485 is set This was all fairly hard work, largely because my C++/Arduino/ESP8266 knowledge is really pants.  I've also made another ESP8266 that subscribes to the MQTT messages and displays them on a web page - this was my alternative if I couldn't get the web server working with the original!  Now just waiting for the RS485 interface to arrive so I can get round to Dave's and start shorting out his inverter :-). IDEAS Make noR

Sofar HYD6000-ES Inverter RS485 data logger

As noted in an earlier blog entry, a friend of mine has acquired a Sofar HYD6000-ES inverter as part of a mighty 8kW PV array. He is currently using the dodgy Solarman cloud software to monitor it, using the pretty standard LSW-3 wireless stick that actually uses RS485 under the covers, and sending data to the fixed address stashed within. However, it doesn't appear to be monitoring the batteries at all, so in an effort to enable this, I've been looking at alternatives. This helpful Github site  has a great description of an RS485-attached device, based on an ESP8266. This sends regular data updates out on MQTT over the local WiFi, accessing the inverter's internal registers via ModBus. I've purchased the components, and am starting to mess with software, using the Arduino IDE configured for ESP8266 Wemos D1 mini. I have the basic Sofar2MQTT sketch running, although since I lack the RS485 adaptor at this point I don't know if that works. At least the sketch runs! I

Security and Monitoring of Sofar HYD 6000-ES Inverters for yourself - an investigation

 A friend has a Sofar HYD 6000-ES hybrid PV inverter installed, and I was interested in The possible security implications of its nominal WiFi/Internet connection How to get the logging data directly into one's own software and bypass the "cloud" which is located in China! Security Issues In respect of the first point, this webpage has some interesting insights viz. the Access Point (AP) interface remains active even when you've configured it as a Station (STA) to access your home WiFi, including the following interfaces, according to the article: 53/UDP, DNS 80/TCP, HTTP 8899/TCP, Datalogger Info 48899/UDP, HF AT Interface Depressingly, the article shows how easy it is to hack the passwords from copies of the firmware :-/, so given the importance of the kit, it's probably good to take some remedial action. Possible actions: Access Point access: The configuration screens allow for the SSID to be hidden, which at least prevents casual detection/connection, althoug