-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bogus data is collected when gateways go offline/are rebooted, or production CT is disabled #153
Comments
Hi @madbrain76, looks like envoy is still able to share surprises.
|
@catsmanac |
@catsmanac , I debugged my Envoy problem (#122) to a production CT issue . I disabled the production CT for it in Enlighten on Monday in the middle of the day, and then restarted the Envoy integration. It started metering correctly after that, by getting watt and kWh (energy) data from the micro-inverters. However, there is a big bump in them middle of the day for the "Lifetime energy production" counter on monday . As you can see, there is a peak "production" of 228.93 kWh for the Envoy ending 1048 between 15:00 and 16:00 . This is of course bogus. The number comes from the Lifetime Energy Production sensor. When the production CT was turned off, and the integration reloaded, the sensor became non-monotous, ie. the lifetime value decreased. I realized this the way the value in the Envoy wraps around when the production CT is disabled, but this results in bad behavior as I'm seeing. I'm not sure how to fix my statistics given the single sensor in Home Assistant. |
Hi @madbrain76, it's pretty clear that the integration has no real logic for handling changing nature of an Envoy. Looking back in it's history it was build step by step handling ever new types of Envoy and firmwares but no real provisions to handle the case where the mode of the Envoy changes and Envoy has a glitch in the firmware in this new mode. I know that the metered one with CT disabled resets lifetime every ~1.2Mw, but haven't seen reports how that shows up in the energy dashboard, creating a similar peak or not. Technically it's relatively easy to add a configuration option enable these 2 'raw lifetime measurements' but these can't replace the current one sourced from either based on envoy configuration as it would break long term history for everybody. But with these 2 new sensors available, how to handle above change? You can't switch from one to the other in the Energy dashboard since it runs from statistics, so it would switch to history of the raw tags that wasn't correct before and the other way around. You would need to use some HA calculation you can switch between the 2 and use that as input to the Energy dashboard. And as that will be new loose prior history. SO I'm not sure if these 2 new sensors are the simple answer. Brings use to statistics used by Energy dashboard, maybe see: statistics correction if that may solve the effect. Open to any suggestion, but don't have a good feel for best path forward yet. EDIT> I found this on multisensors, maybe it can help with this case and both raw sensors? |
@catsmanac I think some editing of the statistics database will be required to handle this, but I'm struggling to think of what the steps might be. This definitely needs some brainstorming. I envision something where I add both the CT and MI sensors to the Energy dashboard. The MI sensor would always be exposed. The CT sensor would only be exposed when it is enabled. If there is a switchover (CT enabled or disabled) the integration can detect the time at which this happens. And it can then truncate the stats for both sensors before/after that switchover point, so there is no data overlap between the two for a given time. I know this is pretty complicated, but I believe it could work. |
@catsmanac , I tried the statistics correction, but that won't work in this case because it's not a single value that needs to be corrected, but rather a whole stream of values.
|
@madbrain76 there are some limitations to an integration we have to deal with.
With v0.0.18 the state is checked 1/hour. That can be changed (custom setting or always) to every scan, so change would be instantaneous. A CT mode entity could be created to be used in HA as well as these raw entities (custom setting or always, hidden by default or not) . But these would not solve the issue of value differences between the 2 sources. To solve that you need either to process history and feed the dynamic sensor from values changes from either source or you need to calculate difference between current and previous value of each source and use the difference of the active one to add to the running value of the dynamic sensor. The key is you need to detect value changes in the sources to prevent the switch tp the other mode to cause the spike up or down. For using history it requires almost a second custom integration, reading history through the HA api and calculate the resulting values as I haven't found a way to access HA history from inside HA automation. With calculating differences there may be an issue over HA restarts as the status becomes unavailable and I'm not sure what the value would be, if last known value then it's probably ok. Such calculations can be done in HA itself by building a custom sensor, using the CT Mode entity and the difference between current and previous value. Long story short, I think you need to use value change of the source lifetime entity and add that to the dynamic new entity. In that way switching may work flawless, but HA outage may cause some issues. |
Hi @madbrain76, I build a little envoy simulator that can run in CT connected or not connected mode to test this behavior. To finalize it, I could use some data to validate how the envoy sim is behaving. What I'm after is 2 or 3 extracts from the diagnostics file, each taken a bunch of hours separated, so like one at 10 am, one at 4 pm and one next morning again. I'm looking for the 4 endpoint lines in the diagnostics file shown below in below abbreviated example. I 'm looking for the 4 full lines from each sample.
If you have diagnostic files around from before the CT switch then the same extract from those are interesting as well. Trying to observe how the numbers of the non active mode behave. |
Which diagnostic file are we talking about, and where is it located ? |
Go to the envoy device page (settings, devices & services, devices) and select the Envoy device. There you find a download diagnostics button |
I had my installer do some work on my system on Tuesday. During that time, I flipped most of the breakers, including those for all 3 gateways were reset. Wifi also went out. My HAOS is on UPS and kept running.
The HA Energy report for the day showed the following :
The data for gateway ending 7059 (IQ Combiner 4) is bogus, as is the data for gateway ending 1048 (IQ Envoy) .The data for the gateway ending 6209 (Envoy-S Standard) is correct.
I'm wondering two things :
The text was updated successfully, but these errors were encountered: