I’ve installed a device to capture SMETS1 smart meter data every 10 secs and have been authorised to access the data via MQTT – a free service.
I’ve now got it working to the point where if I issue the following command in an SSH terminal window on an RPi running emon then I can see the data changing every 10 secs …
mosquitto_sub --cafile /home/pi/cert.pem -h glowmqtt.energyhive.com -u UserName -P PassWord -t SMART/HILD/MACaddress -p 8883.
It’s json data that looks like this …
{"elecMtr":{"0702":{"03":{"01":"000001","05":"43","04":"9B","02":"0003E8","07":"XXXXXXXXXX","08":"XXXXXXXXXXX","03":"43","00":"00","06":"00"},"00":{"07":"26D2DEF6","01":"000000000000","00":"00000009E91C","14":"02","02":"0000000019A0"},"04":{"01":"0000C8","00":"FFFFD8"},"02":{"00":"00"}}},"gasMtr":{"0702":{"00":{}}},"ts":"2020-08-21 19:37:30","hversion":"EHZBWIFI0v4","time":"5F40227A","gmtime":1598038650,"pan":{"status":"joined","nPAN":"00","join":"0","lqi":"EC"},"ets":"2020-08-21 19:37:26","error":{"lastCommand":"00","errorCode":"00"},"gid":"70B3D521E0003F41"}
Which, when interpreted, looks like this …
{
"elecMtr": {
"0702": {
"03": {
"01": "000001",
"05": "43",
"04": "9B",
"02": "0003E8",
"07": "XXXXXXXXXXXXX",
"08": "XXXXXXXXX",
"03": "43",
"00": "00",
"06": "00"
},
"00": {
"14": "02",
"07": "26D2DF00",
"01": "000000000000",
"00": "00000009E91C",
"02": "0000000019A0"
},
"04": {
"01": "0000C8",
"00": "000189"
},
"02": {
"00": "00"
}
}
},
"gasMtr": {
"0702": {
"00": {}
}
},
"ts": "2020-08-21 19:37:39",
"hversion": "EHZBWIFI0v4",
"time": "5F402283",
"gmtime": 1598038659,
"pan": {
"status": "joined",
"nPAN": "00",
"join": "0",
"lqi": "EC"
},
"ets": "2020-08-21 19:37:36",
"error": {
"lastCommand": "00",
"errorCode": "00"
},
"gid": "70B3D521E0003F41"
}
Buried in the json data is an error code, date & time, instantaneous power and energy over a period. And as an aside - this info is neatly provided in the Hildebrand BRIGHT mobile App updating about every 6 secs.
The question is – how to grab the data as Inputs to emoncms?
Using the PowerWall interfacer as an example – it grabs json data via an http/api call and then selects what is relevant from the json to build a data cargo that is finally published as Inputs to emoncms.
Can this approach be adapted? – an Interfacer that does MQTT connect rather than making http/api calls with the update frequency controlled by the source rather than by emon?
Another possible approach is MQTT. My trawl of the Forum has not helped much with other examples even suggesting that it might not be too reliable. And I’ve fallen at the first hurdle trying the simple ‘Hello World’ test suggested in Resources.
The response I get is …
Connection Refused: not authorised.
Error: The connection was refused.
And the mosquito log shows …
1598052121: OpenSSL Error: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Any suggestions would be welcome.