unlobito / ha-hildebrandglow

PRE-RELEASE. HomeAssistant integration for the Hildebrand Glow smart meter HAN for UK SMETS meters.
MIT License
54 stars 31 forks source link

Use MQTT to get instant updates #14

Open ndfred opened 4 years ago

ndfred commented 4 years ago

This component uses HTTP polling through Async to update values, using MQTT instead would provide more up to date information

ndfred commented 4 years ago

I've been digging and dumped some MQTT connection and parsing code here. We can basically get all the data we need in real time, without worrying about tokens, which I think is a better fit for this component. Next I'll try and see if I can just get away with Home Assistant templates.

ndfred commented 4 years ago

I've continued my research and now have MQTT bridging and templates working! I now gather instant electricity consumption, as well as daily / weekly / monthly electricity and gas consumption and meter readings, in real time. Maybe this is what the HA component should be doing: just maintain an MQTT connection and present the data in a few nice sensors.