There may be other enhancements for this, including:
- Separate cost per kWh from Shore power ( based on fuel source of the generator )
- Calculating the fuel consumed based on generator load
- Could assume a linear load vs fuel rate ratio from the no-load to 100% load
- Include config params for each of these, along with max load capacity, and which loads can run on the generator.
In one use case, I have HA monitoring power consumption of my motor coach, but on travel days, my generator kicks on when the batteries are low.
It would also be useful for those with home generators during power outages, etc.