After 3 weeks, finally the end result came dangerously close 😉
Every time I finish something new and the time comes to actually start using it, I get excited – will it work? Cause testing in the office is something completely different than seeing real live data coming in! (yep, I forgot to check if I still had a free connection on the switch in the fuse box…)
The Simplecortex had been running without any problems during the last 2 days so it was time for the last part: inverting the P1 signal before it arrives at the Simplecortex UART0. I had an old Arduino Proto Shield laying around and put an 7470 inverter on top.
The ‘receiving end’ i.e. my Domotica system is ready – which consisted of adding an MQTT client to it and making sure it subscribes to the necessary topics. Just 2 more wires that needed to be soldered and I could hook up the Simplecortex to my smart meter… couldn’t wait!
And this evening I decided to remove the laptop that was logging the P1 data to a file from day 1 and replaced it with the contraption you see below.
And this is what it publishes (output from a MQTT subscriber):
/P1/powerusage1 00311.543 /P1/powerusage2 00158.107 /P1/powerdeliv1 00000.000 /P1/powerdeliv2 00000.000 /P1/tariff 0001 /P1/powerusagec 0001.88 /P1/powerdelivc 0000.00 /P1/gasusage 00027.758
hardest most exciting part was developing the code in C for the Simplecortex. For my work but also at home I see a lot of code, in all kinds of languages and I can follow what the code should do – but getting started with writing my own code in a language which I hadn’t really used before took me some time – I just kept on changing things because I was not satisfied. Now I am (thanks, JC!), although there are still some minor things I have to work on. But those are not necessary for now; I can flash the Simplecortex later, when everything is completely finished software-wise.
Now I can start logging gas usage again and I can stop using my DIN rail mounted KWh-meter with S0 output which I used for power usage (but not before I’ve had a chance to compare it with the smart meter, though). Source code will be available on GitHub soon (account has already been made) .
Next project that will be handled in a similar way: the Opentherm Gateway! For that one the Simplecortex needs to be able to subscribe as well!
Edit: the P1_Publisher project has been committed to Github some moments ago: https://github.com/rhekkers/P1_Publisher