TWCManager
TWCManager copied to clipboard
some EMS may report consumption as positive, and generation as negative
so automatically negate a negative generation value
Thanks for this. Which EMS module were you seeing the negative values from? Just trying to evaluate whether or not this should be adjusted at the edge or here in the core, as it's possible some EMS modules may need to influence consumption by returning negative generation values (I'm not sure that's the case but vaguely remember something like this somewhere in the code), if this is done by any of the EMS modules then the change in this PR would require those modules to detect negative values and report them as consumption instead.
In fact, I think we had the code you've written in the past and then removed it for this reason but I'm not 100% sure, I'll need to do some research.
My root EMS is IoTaWatt. TWCManager sees it via OpenHAB (because I have multiple sub panels, and no single CT measuring complete house consumption, so OpenHAB dynamically sums the total of each sub panel to get its total usage number).