-
Notifications
You must be signed in to change notification settings - Fork 26
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
Envoy S Production data is not read / read incorrectly when current transformers are not enabled/installed [bug] #37
Comments
@lnlp Would it be possible for you to post a copy of your The code currently does a check to see if the attributes of production and consumption exist in the web page. I'm thinking maybe another check of the attribute Also would need to check this behavior on newer firmware such as D5.0.49 (77afa8) to see what happens when metering is not setup and if the |
Currently there are two problems:
Current production Watts (wNow) from either inverters, CTs, or bothI believe there should be the option to get either or both production I'm not sure what would be a good way to name production Watts data elements to allow referencing either or both of them in Home Assistant's configuration. Perhaps for compatibility there should be three available entities for the
Having these three elements would allow the user to override Envoy reader's choice if necessary as well as track both on systems with CTs if the user chooses that. (*) Note: I don't know that Obtaining WH totals/accumulation:From what I have seen on the Envoy IQ it only accumulates WH totals (today and 7 day) in the When CT metering is off you have to look at In other words, without CTs to use the Envoy's accumulation of WH Today and WH Past 7 days, you'd need to be able to get Envoy Reader to poll An alternative to polling @gtdiehl Here is my current production.json from my IQ D5.0.49 (77afa8) with CT metering turned off.
Here is my current http://envoy.local/api/v1/production
|
I have read through everything yet but I want to point out that when polling uses the @rct If you have code changes could you post it to GitHub for a possible merge? |
@gtdiehl - I think the only cases where you'd want to use
I don't have code changes that are worth submitting. I need to understand how the Home Assistant configuration interface interacts with envoy_reader to configure it. |
@rct Those are good points. 😃 I'll look through the code and see what it might take to implement. Or atleast get reporting working for all attributes for each hardware platform. |
I will make a capture tomorrow when it's light and the system is actualually producing.
This is not my experience. I see information in My Fyi: There exist 3 different Envoy-S models:
I have the Envoy-S Metered Multiphase (EU) SKU: ENV-S-WM-230. Envoy-S Metered and Envoy-S Metered Multiphase (IQ Envoy) are both black but the Envoy-S Metered Multiphase has the cover screw on the right side while the Envoy-S Metered has the cover screw on the left side (like Envoy-S Standard). |
Regarding bullet 2: No, not only those two values. When I run envoy_reader from a command prompt, the 4 production values shown are 0. When I modify |
I'm still looking over the code and the different paths taken and the different types of envoy devices with and without features. Though I wonder if something like this would solve the problem Add a function called Then change part of envoy_reader/envoy_reader/envoy_reader.py Lines 50 to 51 in c43704c
To:
So if the Envoy has Metering enabled values will be retrieved from I just wonder is there a configuration of the Envoy where a production CT is installed without a consumption CT? |
Here are captures of
{
"wattHoursToday": 1716,
"wattHoursSevenDays": 53220,
"wattHoursLifetime": 92854,
"wattsNow": 2236
}
{
"production": [
{
"type": "inverters",
"activeCount": 15,
"readingTime": 1604478431,
"wNow": 2235,
"whLifetime": 92854
},
{
"type": "eim",
"activeCount": 0,
"measurementType": "production",
"readingTime": 1604478474,
"wNow": 2.599,
"whLifetime": 0.0,
"varhLeadLifetime": 0.0,
"varhLagLifetime": 0.0,
"vahLifetime": 0.0,
"rmsCurrent": 0.534,
"rmsVoltage": 245.583,
"reactPwr": -0.0,
"apprntPwr": 60.789,
"pwrFactor": 0.01,
"whToday": 0.0,
"whLastSevenDays": 0.0,
"vahToday": 0.0,
"varhLeadToday": 0.0,
"varhLagToday": 0.0
}
],
"consumption": [
{
"type": "eim",
"activeCount": 0,
"measurementType": "total-consumption",
"readingTime": 1604478474,
"wNow": -0.035,
"whLifetime": 0.0,
"varhLeadLifetime": 0.0,
"varhLagLifetime": 0.0,
"vahLifetime": 0.0,
"rmsCurrent": 0.285,
"rmsVoltage": 246.27,
"reactPwr": 0.0,
"apprntPwr": 70.082,
"pwrFactor": -0.0,
"whToday": 0.0,
"whLastSevenDays": 0.0,
"vahToday": 0.0,
"varhLeadToday": 0.0,
"varhLagToday": 0.0
},
{
"type": "eim",
"activeCount": 0,
"measurementType": "net-consumption",
"readingTime": 1604478474,
"wNow": -2.634,
"whLifetime": 0.0,
"varhLeadLifetime": 0.0,
"varhLagLifetime": 0.0,
"vahLifetime": 0.0,
"rmsCurrent": 0.249,
"rmsVoltage": 246.958,
"reactPwr": 0.0,
"apprntPwr": 59.944,
"pwrFactor": -0.12,
"whToday": 0,
"whLastSevenDays": 0,
"vahToday": 0,
"varhLeadToday": 0,
"varhLagToday": 0
}
],
"storage": [
{
"type": "acb",
"activeCount": 0,
"readingTime": 0,
"wNow": 0,
"whNow": 0,
"state": "idle"
}
]
}
[
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478424,
"devType": 1,
"lastReportWatts": 151,
"maxReportWatts": 244
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478408,
"devType": 1,
"lastReportWatts": 152,
"maxReportWatts": 252
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478415,
"devType": 1,
"lastReportWatts": 148,
"maxReportWatts": 246
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478420,
"devType": 1,
"lastReportWatts": 151,
"maxReportWatts": 242
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478411,
"devType": 1,
"lastReportWatts": 149,
"maxReportWatts": 247
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478416,
"devType": 1,
"lastReportWatts": 147,
"maxReportWatts": 246
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478421,
"devType": 1,
"lastReportWatts": 151,
"maxReportWatts": 244
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478428,
"devType": 1,
"lastReportWatts": 148,
"maxReportWatts": 240
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478412,
"devType": 1,
"lastReportWatts": 151,
"maxReportWatts": 250
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478416,
"devType": 1,
"lastReportWatts": 147,
"maxReportWatts": 241
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478424,
"devType": 1,
"lastReportWatts": 147,
"maxReportWatts": 244
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478407,
"devType": 1,
"lastReportWatts": 150,
"maxReportWatts": 252
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478413,
"devType": 1,
"lastReportWatts": 146,
"maxReportWatts": 245
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478420,
"devType": 1,
"lastReportWatts": 148,
"maxReportWatts": 241
},
{
"serialNumber": "12203xxxxxxx",
"lastReportDate": 1604478426,
"devType": 1,
"lastReportWatts": 150,
"maxReportWatts": 239
}
]
Observations:
Questions
|
That should probably do it. Do you know what the "eim" stands for? |
Is that new Envoy firmware? |
What about 3-phase systems? Will there be / shouldn't there be 3 separate "eim" sections, each for one phase? And when envoy_reader reads its data from the "eim" section shouldn't that be done for each phase separately and then summed to get totals for all 3 phases? I'm a bit puzzled here because I have a 3-phase system with no CT's installed, and (only) a single "eim" production section shows up where a single rmsVoltage (and rmsCurrent) are specified while each phase has its own different voltage (which my smart electricity meter shows). |
I agree a better solution would be to have additional parameters. Currently the envoy_reader api returns:
These come from mainly 3 pages (excluding Envoy running <3.9 firmware)
I would propose removing the original consumption parameters and adding additional parameters (lets prepend them in this example with
Then change it so any polling of the original production parameters only come from Currently to minimize api calls between the envoy and home assistant one function is called to gather up all the data (even if the device does not support the parameter) and send it across. Then a question, does the api return the Going down this path means renaming 4
I'm not sure on this one. According to the Envoy-S Metered Multiphase Installation manual there are 3 CTs installed on the Production and Consumption sides. Would have to find a system that has 3Phase with Metering enabled and CTs installed. @jesserizzo What do you think about moving all of the production polling to |
@gtdiehl I would also prefer if the timestamp of when the values were updated can be added, e.g. lastReportDate and readTime (there's little consistency in the different names unfortunately). For And for the nice to have wishlist: |
Question for you or anyone who has CT metering turned on:
I believe Thanks for working on this. |
@lnlp - trying to answer a few of your questions with what I've learned so far.
|
So I've hacked together some code Here is the output of envoy_reader from various Envoys. I removed the inverter data and right now the values are zero due to no sunlight, but you should get an idea of what would be sent to Home Assistant once that sensor code is updated. Envoy-S or IQ running D5.0.49 without Metering Enabled
Envoy-S or IQ running D5.0.49 with Metering Enabled
Envoy-S running D5.0.49 without Metering Enabled and the /production.json page does not contain Production or Consumption keys
Envoy-C running D3.15.7
|
The code is on one of my branches. I would like some input from @jesserizzo and others before opening a PR to merge this change. |
I tested your modified envoy_reader with my Envoy-S Metered Multiphase with metering disabled (no CT's). Observation: metered values get truncated instead of rounded. My Envoy reports tiny metered values while metering is disabled. My Envoy homepage shows "Software version R4.10.35 (6ed292)" is that the Envoy's firmware version? Can you please add the following parameters for reading timestamps?: |
How about simplifying to: "not available" |
@gtdiehl - Here's my Envoy IQ (metering turned off) output using your change_polling_pages branch:
/api/v1/production
production.json
|
Thank you for running the code! I originally had the metered values not being returned when metering is disabled ( They can always filter these values out in Home Assistant by specifying which |
Yes, I do want and think the values for both In my comments above, I was arguing for the case to still be able to get the inverter numbers even if metering is enabled. |
I see where you are coming from but to keep the code simple I'm retrieving inverter production values from It seems the the values are almost the same and they are both updated every 5mins. Other than reducing http calls to the envoy device, is there another benefit to pull the production data from the two pages rather than one? |
Good catch! I'll return values with a decimal |
One case that is not handled, if you want the inverters current production and WH lifetime production, with metering turned on, you can only get that from production.json. In other words, if you explicitly want to access that data for the inverters whether or not metering is on, production[0] is the place to get it. Maybe this is only of interest to me. When metering gets turned on |
@rct I get what you're saying. I'll have to look into this one a bit. |
I know this may seem like a back step but I'm thinking of changing back to the original output of the envoy_reader api, and have the code get the production values based on the activeCount attribute. The rationale is so that the Home Assistant sensor monitored_conditions does not have to change which ultimately does not create a breaking change or force users to change their environment. Like I said I'm still thinking about it and weighing the pros and cons. I really like to give the user all of the data and let them figure out what they want to use. But have to think about current users. |
This status was for me while debugging. It'll be removed from the code.
Can you open a new issue (enhancement) to track adding new parameters?
I'm following the current convention that was previously coded. I would have to look into how to send specific data from the envoy_reader API to Home Assistant. Can you open a new issue (enhancement) to track this one?
Can you open a new issue (enhancement) to track this one?
No Home Assistant will not get fully updated automatically. That's why I'm asking to track the above as separate issues. When I mean fully is that if something can be fixed on the Api side, such as the original bug of the Production values being zero than I can make a change here and request Home Assistant through a PR to update the version of the API being used. That's one line changed on the Home Assistant side and as long as the reviewer is okay with the API side change log the updated API will be included in the next Home Assistant release. Now to change how things are displayed in Home Assistant, or adding/removing sensors that means probably both an API side code change as well as the sensor code change on the Home Assistant side. The review process is greater. I know not a perfect solution but through small changes eventually we will get to a release that meets the needs of Envoy users across all firmwares 😃 So as it stands is your original bug of Production values displaying zero fixed? |
That's an interesting question... I have a 3 phase power system, so I also have 3 CT's which each measure 1 fase, but in the Ephase app the value is shown as a single Power consumption parameter. |
Very interesting indeed. I would expect to see at least three different sets of values, one for each phase. Could there there be another (URL) location on the Envoy where differentiated data for each phase is available? What use are values of e.g. |
Yes the original bug in envoy_reader has been fixed. I hope we can see it being updated in Home Assistant as well soon. |
Done, see #43.
Done, see #42. |
@lnlp I'll release the new version on pypi this weekend and open a PR on the Home Assistant side as well. Yeah hopefully it'll make it into the 0.119 release! |
Thank you for opening those issues. Maybe I should have been a little clearer but Home Assistant is not letting existing integrations to change their |
See my response in #41. |
Data from
From @OllemGit's feedback:
Based on above it appears that @OllemGit |
|
Thanks for checking. That can only mean that all 3 phases are connected, the 4 wires will be: N, L1, L2 and L3. My guess is that data from @OllemGit Would it be possible for you to verify this? My Envoy reports a realistic value for My Envoy also reports a realistic value for The CT (current transformers) are used for measuring current. Theoretically one of the two CT wires could also be used for measuring voltage. Whether this is actually implemented (case B') when CT's are installed or that only the power input lines (left connector) are used ('case A') for voltage measurement I'm not sure. From the 'Envoy-S Metered Multiphase (ENV-S-WM-230) Installation and Operation Manual':
A phase coupler for communication with the inverters is not built-in to the Envoy. From this perspective it is not required to connect all 3 phases to the power connector.
The manual is not clear about why all 3 phases should be connected to the 'power input' connector. For just the powering of the Envoy a single phase would be sufficient. This does not require to connect all 3 phases to the power connector. From above I derive the conclusion that the reason of the presence of all 3 phases on the 'power input' connector must be to measure the voltage of each phase (as there appears no other plausible reason for wiring all 3 phases on this connector). |
Instead of |
Interesting,
Here's my output. Note: my CTs are currently disabled. There isn't any identifying object info inside the two objects in the top-level list. So it looks like you need to join with
I see now that there was mention of these URLs in the Envoy-S data scraping blog that I missed previously |
@rct the scraping blog was where I got that URL. Can you confirm that you can get this without any authentication? If so this may end up being the best solution, although it requires 2 requests. |
I just tested it in Windows Sandbox: No authentication required for both url's. |
Seems like this is the winner for #46 |
I discovered that See following comment in #46 for more information. |
Well sorry to say but there was a bug in the code. It causes Home Assistant to not update after a couple of polls. I have made the change to fix it, actually just removed a single line of code, PR #51. Now I have to get this included in a bugfix-release for Home Assistant as 2020.12.0 includes the envoy_reader with the bug. I'm sorry about this! |
Too bad, but no need to feel sorry. 🙂 I was happy to see it working in 2020.12.0 now but then noticed values reported in HA don't match /api/v1/production. Do you expect to get the fix into the next (bug-fix) release (presumably 2020.12.1)? Mmm, just wondering: will a HA 2020.12.1 bug-fix release automatically become 2021.01.0 if released in January 2021? |
@lnlp Thanks! 😃 The fix was merged into the dev branch yesterday, which usually means it will make it into the next release (2021.01.0). Though this time I had someone add my PR to the list of PRs that should be included in 2020.12.1. Cross your fingers, and I'm hoping it will be included in 2020.12.1. |
I upgraded to HA 2020.12.1 today and the |
|
Problem
Envoy S Production data is not read when not using current transformers which renders reported Production data useless.
This is because envoy_reader assumes that when `envoy/production.json' exists that this is the location to read the Production data from. But that is an incorrect assumption because it is only valid when current transformers (CT) are enabled/installed.
Situation
I use Envoy S but without any CT's installed.
For a 3-phase installation I would need to buy 4 additional CT's while consumption and production data is already provided by my smart electricity meter (via DSMR P1 port). I therefore did not install any CT's.
When using Envoy S without having CT's enabled then production data in
envoy/production.json
is NOT updated.Actual Production that gets updated is available via
envoy/api/v1/production
however.But envoy_reader does not read it. It only reads
envoy/production.json
.As a result the reported Production values are either 0 or some bogus value.
(I have observed bogus values for 'production' and 'consumption' in range between 0 and 2).
An Envoy S (and probably Envoy IQ) without CT's enabled should be handled as 'endpoint_type' "P" instead of 'endpoint_type' "PC".
Details about my Envoy:
Enphase Envoy S 'metered' Multiphase (probably identical to Envoy IQ).
Part number: 800-00554-r03,
Software Version: R4.10.35 (6ed292)
Electrical system: 3-phase 230V.
Solution
Handle Envoy S (and Envoy IQ) without CT's as 'endpoint_type' "P" instead of 'endpoint_type' "PC".
There are 2 options to implement this:
Manual: Add an extra parameter e.g.
ct_enabled
with default value True (requires no changes in existing client code).When True the Envoy should be handled as endpoint_type "PC", when False as endpoint_type "P".
Automatic: When CT's are not enabled this is shown on the
envoy/home
page so it should be possible to automatically scrape the status of whether CT's are enabled or not.By default envoy_reader should automatically determine whether CT's are enabled and act accordingly.
By providing an optional
ct_enabled
parameter the user can override it for testing purposes.This is what is shown on the
envoy/home
page when CT's are not enabled:Let me know if you need more information or help.
The text was updated successfully, but these errors were encountered: