Closed realumhelp closed 2 years ago
Enum sounds great. Would you like to write a PR? I can also get to it in a bit.
It would be very helpful to have the distinction between generation / load passed to HA! It'll be great to use to name the entities (Production / Consumption), but I don't know of anything else it could be used for.
I don't think meter read date will be useful for HA though. With the new-ish total_increasing state class, Home Assistant can figuring out when the meter drops to zero so we no longer need to figure out what exact time the sensor is resetting.
I don't think meter read date will be useful for HA though. With the new-ish total_increasing state class, Home Assistant can figuring out when the meter drops to zero so we no longer need to figure out what exact time the sensor is resetting.
That is good news. It would have been a bit tricky to deal with MTD Avg's otherwise.
After some playing around I found the following values for the magic numbers used in the interface XML:
MTD is based on a billing cycle which starts on the date listed in the Utility Rate Setup -> What is the Meter Read Date? Not sure if HA is expecting this to be based on the 1st of the Month or if it is configurable in HA. You can query the value with:
Configuration/SystemType - Magic number definitions
Configuration/MTUType[1-4] - Magic number definitions
The magic values would probably be better served as a Python Enum. Not sure if the HA interface needs anything special to denote a generated load or not as far as their energy statistics go.