Costs - following on from #49 #93
Replies: 3 comments 1 reply
-
I think solving the cost tracking feature is the biggest challenge - the GPIOs would be easy to do, especially with the new TOML config format in v0.3.0. I'm not too familiar with the time of use energy rates (as I don't have one myself), but I'm thinking of a config setting to set up specific start/stop times for various energy rates... so in the config, something like:
The Python side would determine which I think this would work for most people that have a fixed time interval time of use... but for your case, it sounds like the off peak just happens whenever it wants.... which brings us to the GPIO subject. Your use case is very specific (and a good one, at that!!), and I'm trying to think of an approach that would ease the general use of the GPIO pins. In other words, I'd prefer to integrate something modular that can be expanded by the user rather than something super specific that only does one thing. |
Beta Was this translation helpful? Give feedback.
-
Hi David Although I haven't looked into the detail, having been introduced to the Influxdb client, it strikes me I could sort out the GPIO tariff detection external to the power_monitor code and insert the tariff status into the database via the client. From there I could use continuous queries to work out the costs. Just a thought; it would actually be very nice to have something like the capability you outlined above in the power_monitor code. Mike |
Beta Was this translation helpful? Give feedback.
-
Hi David - a quick update on the tariff issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been using a modified version of v0.1.0 where I've added tariff costs to config.py and to the database as part of the CT data acquisition. The reason I've done it this way is mainly because I'm on a split tariff scheme where tariffs change during the day. I looked at continuous queries but I struggled to find a way to link them to time.
I'm fortunate that I've got a 240v feed which only becomes active during off-peak hours, so I power a dc PSU from this feed which is connected to GPIO17. My modified power_monitor.py code monitors that GPIO, using it to determine which tariff gets written into the database.
The current tariff data is written to each ct so I can display the cost of individual cts. This is rather profligate but it was much simpler to do it this way(!)
To display the data on Grafana I've created a number of continuous queries, such as:
CREATE CONTINUOUS QUERY "ct1_cost" ON "power_monitor" BEGIN SELECT last("tariff") * integral("power")/3600000 INTO "autogen"."ct1_cost" FROM "power_monitor"."autogen"."raw_cts" WHERE "ct" = '1' GROUP BY time(1m) END
I've ported over the changes to the v0.2.0 code (and anticipate doing the same for the v0.3.0 code) but it would of course be very handy if this functionality were to be available in the released code - is this something worth considering? I admit there probably aren't too many people with an ac feed which becomes live during off/peak periods, so a GPIO read capability is probably too much to ask for but I suppose if you don't ask......
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions