I’m using a reed contact attached to GPIO 18 of my raspi to count the consumption of my gas meter. This works fine, the signal goes from off to on to off during each cycle of the meter. I can see this changing entity in my frontend.
Now I want to start counting the consumption. During each change from off to on, a counter shall be incremented by 0.01. I’ve already configured a counter in configuration.yaml:
Now I’m struggeling to configure an automation for this, to increment the counter?
What is the best option to do that?
And: I want to create a chart that will display my daily/weekly/monthly consumption. Grafana should be the best to do that? Other options?
I’m new to HA, as I was using pimatic before (and still do). So please leave me some good examples, that will be easy to understood for me.
I made a little progress, but still did not reach the target. The automation has been triggered, but the counter is still not updated. Where do I need to look at, to check possible reasons? Is there some logfile or debig mode that I have to check?
I also created a Utility meter, but as the counter seems not to be updated, this is also not working.
And it seems, that I cannot increment the counter by 0.01, as it is an integer value? So I have to multiply by 100 and later (in the display and stats) I have again to divide it by 100? Other possibilities?
Does not work as well. The counter stays at the initial value.
But I found out, that yesterday evening the counter has moved to 31, but reverted to 30 afterwards.
The naming for the counter does not allow an underscore “_” like in my 1st post!
After removing the underscore, the counter is running as expected.
Isn’t there any way to detect this by a debug mode or logfile?
It’s a little bit annoying to search the error that way.