Archerite
New Member
Over the last 12-15 months I have been starting with a solar setup on a balcony. It works great! And over the year I have made upgrades here and there, learned a lot about wires, electricity, amps, watts and all that. It's mostly victron equipment and I use VenusOS on a Raspberry Pi to upload to the VRM dashboard. As said this all works perfectly...but I wanted to make it more "smart" by hooking it into my Home Assistant!
For that I use node-red (not on the rpi) that connects to the MQTT on VenusOS and collect the statistics, reformat the raw values and put them into HomeAssistant. It took me a couple day's to get it right but I can now see total solar production from 4 SCC's and the battery percentage directly in home assistant! And based on these values I can trigger any automation I want! The only useful one right now is turning on the grid-charger when SoC is at 25% and then off at 50%-75%. This all works great and now I don't have to worry about plugging the charger in on time....it's connected on a "Smart plug" that I can turn on-off from HomeAssistant. And having the battery SoC in there to means it all goes automatic now!
Inside Home Assistant there is a "energy dashboard" and for "grid input" I have chosen the smartplug that my charger is plugged into. That works fine as the required kWh counter with history is generated automatically. But since the solar production is coming from node-red entities...I need to do some more work on it. Instead of just giving it the current watt's produced I need to give it a kWh value that is incremented slowly with actual production. I think. Because just dividing by 1000 does not give me the desired results...to say the least.
So that is my situation....now here is my actual question: How do I convert the current total watts from the PV into an accumulated kWh counter?
I am terrible at math...and I have no idea how to effectively search for the answer online or in this forum. Nearly everything I got is related to how to calculate how much an appliance uses over a period of time. That bit I got just fine and is not what I need. I need to keep a counter of the solar production...and therefore convert the watts reported by the SCC's into an accumulated kWh counter.
While my math skills are limited....I can convert "simple" calculations into programming code. On another site more related to gaming....I have talked about my homebrew game project. It's a platform game and the character jumps on platforms and there is gravity and things like that. LOT's of calculations...that I do wrong...but for the most part it's working fine for a prototype. Just mentioning this to make clear I do know a little about programming.
Sorry if this is a stupid beginners question. But it's something you take for granted when using a dashboard like VRM or automatic counters from smart plugs. And I do know if something uses 100 watts it will have used 1 kWh after 10 hours. And that in my small solar system 130 watts of PV for an hour is 0.130 kWh. But I have no idea how to reduce that in case the PV goes to 160 or down to 50 watts for 5 minutes. And then still keep track of the kWh that were produced.
I hope anything above here makes sense to understand my question. Sorry if it's not. ?
Thanks in advance for any helps or tips.
For that I use node-red (not on the rpi) that connects to the MQTT on VenusOS and collect the statistics, reformat the raw values and put them into HomeAssistant. It took me a couple day's to get it right but I can now see total solar production from 4 SCC's and the battery percentage directly in home assistant! And based on these values I can trigger any automation I want! The only useful one right now is turning on the grid-charger when SoC is at 25% and then off at 50%-75%. This all works great and now I don't have to worry about plugging the charger in on time....it's connected on a "Smart plug" that I can turn on-off from HomeAssistant. And having the battery SoC in there to means it all goes automatic now!
Inside Home Assistant there is a "energy dashboard" and for "grid input" I have chosen the smartplug that my charger is plugged into. That works fine as the required kWh counter with history is generated automatically. But since the solar production is coming from node-red entities...I need to do some more work on it. Instead of just giving it the current watt's produced I need to give it a kWh value that is incremented slowly with actual production. I think. Because just dividing by 1000 does not give me the desired results...to say the least.
So that is my situation....now here is my actual question: How do I convert the current total watts from the PV into an accumulated kWh counter?
I am terrible at math...and I have no idea how to effectively search for the answer online or in this forum. Nearly everything I got is related to how to calculate how much an appliance uses over a period of time. That bit I got just fine and is not what I need. I need to keep a counter of the solar production...and therefore convert the watts reported by the SCC's into an accumulated kWh counter.
While my math skills are limited....I can convert "simple" calculations into programming code. On another site more related to gaming....I have talked about my homebrew game project. It's a platform game and the character jumps on platforms and there is gravity and things like that. LOT's of calculations...that I do wrong...but for the most part it's working fine for a prototype. Just mentioning this to make clear I do know a little about programming.
Sorry if this is a stupid beginners question. But it's something you take for granted when using a dashboard like VRM or automatic counters from smart plugs. And I do know if something uses 100 watts it will have used 1 kWh after 10 hours. And that in my small solar system 130 watts of PV for an hour is 0.130 kWh. But I have no idea how to reduce that in case the PV goes to 160 or down to 50 watts for 5 minutes. And then still keep track of the kWh that were produced.
I hope anything above here makes sense to understand my question. Sorry if it's not. ?
Thanks in advance for any helps or tips.