My electricity meter incorporates a LED which flashes once per kWh, and my gas meter has a small magnet in the least significant digit dial, which corresponds to 1/100 m3 per revolution. Using this post as inspiration: https://www.domoticz.com/forum/viewtopi ... 32&t=11315, I am using an opto-sensor like this: https://www.ebay.co.uk/itm/371350785169 ... EBIDX%3AIT and a reed switch sensor like this: https://www.ebay.co.uk/itm/Reed-Sensor- ... Sw6CJbEYRS, connected to the GPIO of a RPi Zero WH, which runs a python script to send meter data to Domoticz.
Below are pictures of the 2 sensors mounted in small plastic cases, and fixed to the meters with Blu Tack (not fallen off yet!):


I have set up devices in the Utility tab in Domoticz to display electricity and gas usage, and I've also created a number of custom and text sensors to display calculated information: energy (in kWh), cost (using rates from my supplier), and meter readings (these last are incremented by the python script, and over the course of a month have remained very close to the actual meter readings which I read periodically to send to my supplier).

By clicking on the Log button on the cost devices, I can view cost history over the last month:

Finally, as the pièce de resistance, I have set up a meter display in ImperiHome (via MyDomoAtHome), which I run on a Samsung Android tablet:
