Ran into all the same issues as @Han_Solo. Got it up and running.
Commented out the the unreasonable Watts check, as it goes unreasonable when I’m producing and pushing back to the grid (negative Watts).
In that case, negative Watts is input_value-16777216.
So I have a check if input_value is > 8388608
, if true I perform the negative watts calc and publish that, otherwise we’re positive and just publish input value.
As for energy, when I’m pushing back to the grid the kWh reported from the Emporia does not reduce. Apparently the reported value is only energy pulled FROM grid so if you’re pushing back, it just stays constant until you start pulling again when the sun goes down. According to Emporia, the meter isn’t spinning backwards, and there doesn’t appear to be a separate report for energy pushed to the grid. Somehow my meter is accounting for this as the digital display is a bit lower than the reported kWh from the Emporia but I guess it’s not transmitted wirelessly?
My workaround was to report energy pushed back to the grid based on calculation using the reported negative Watt and the time interval it was measured over. So I calculate this in the ESPHome code and publish it over MQTT and then pump it into a utility meter integration in HASS where I account for it on its own energy-TO-grid meter. I’ve got a separate meter for energy-FROM-grid using the reported kWh from Emporia. A sensor with template to calculate the difference will get you net. Separate meters for daily and monthly (or whatever other time interval you like), all taken care of by HASS. Set “delta_value” attribute to true for the energy-TO-grid meter as this needs to be accumulated, whereas the default delta_value of false is appropriate for the energy-FROM-grid meter which is just receiving absolute meter readings.