jesserizzo / envoy_reader

MIT License
37 stars 26 forks source link

Add storage data #36

Closed dutchkiwi2 closed 3 years ago

dutchkiwi2 commented 4 years ago

If the Envoy is a PC type, it can support storage devices. Can a check if storage data is available be included and storage details added.

Having data available on the charge / discharge (wNOW) and percentage full (percentFull) are very usefull in HomeAssist.

The production.json files includes the following data when storage is attached:

"storage": [ { "type": "acb", "activeCount": 4, "readingTime": 1595203104, "wNow": -178, "whNow": 285, "state": "charging", "percentFull": 6 }

gtdiehl commented 3 years ago

@dutchkiwi2 are these storage devices the Encharge 3/10 storage systems?

dutchkiwi2 commented 3 years ago

The example is from acb batteries, the predecessor of encharge

On Wed, 4 Nov 2020, 17:49 Greg, notifications@github.com wrote:

@dutchkiwi2 https://github.com/dutchkiwi2 are these storage devices the Encharge 3/10 storage systems?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jesserizzo/envoy_reader/issues/36#issuecomment-721510110, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQIEQW24HAXCTMNYQJV4MOTSODMO3ANCNFSM4PBWFQBA .

gtdiehl commented 3 years ago

Ok great I found the data sheets for that product.

One other question, do you have 4 acb units installed?

dutchkiwi2 commented 3 years ago

Yes we do.

On Thu, 5 Nov 2020, 06:47 Greg, notifications@github.com wrote:

Ok great I found the data sheets for that product.

One other question, do you have 4 acb units installed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jesserizzo/envoy_reader/issues/36#issuecomment-721878876, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQIEQW54OKBOFA24Z3CIH5DSOGHSDANCNFSM4PBWFQBA .

bouyssic commented 3 years ago

Hi team.

I would be interested on this feature too. If you need help with testing let me know.

Cheers

gtdiehl commented 3 years ago

@bouyssic Do you have the ACB or the Encharge 3/10 units?

dutchkiwi2 commented 3 years ago

We have ACB batteries

Johan & Monique sent from my phone

On Fri, 23 Apr 2021, 10:28 Greg, @.***> wrote:

@bouyssic https://github.com/bouyssic Do you have the ACB or the Encharge 3/10 units?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jesserizzo/envoy_reader/issues/36#issuecomment-825223542, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQIEQW2J54Q2YY3TRHGKNSTTKCPKTANCNFSM4PBWFQBA .

gtdiehl commented 3 years ago

I'm working on adding battery data to the envoy_reader API have to test it on other firmwares and such.

Also working on adding it to Home Assistant, this is what I have so far on that side:

Screen Shot 2021-04-22 at 5 41 42 PM
gtdiehl commented 3 years ago

@dutchkiwi2 I just noticed your JSON output contains percentFull. I need to add that attribute. It appears this only appears when you have batteries installed, but I can't confirm this as yours is the only Envoy I've ever seen that has batteries installed

bouyssic commented 3 years ago

Hello @gtdiehl ,

I have ACB also like @dutchkiwi2

Here an example: "storage": [ { "type": "acb", "activeCount": 1, "readingTime": 1619161595, "wNow": -3, "whNow": 0, "state": "idle", "percentFull": 0 }

If you need anything for debugging I can help. Right now I deleted the integration and am gathering all information through Restful Sensors

gtdiehl commented 3 years ago

@bouyssic I have made my changes to the code to retrieve the battery status, only when the percentFull attribute is present. Can you run the envoy_reader.py standalone code against your Envoy? The code is located at envoy_reader.py

You should get an output similar to this:

(venv) C:\Users\Greg\Documents\GitHub\envoy_reader\envoy_reader>envoy_reader.py
Enter the Envoy IP address or host name, or press enter to use 'envoy' as default: 1.1.1.1 
Enter the Username for Inverter data authentication, or press enter to use 'envoy' as default: 
Enter the Password for Inverter data authentication, or press enter to use the default password: 
Reading...
production:              0
consumption:             1197
daily_production:        0
daily_consumption:       430
seven_days_production:   346402
seven_days_consumption:  282719
lifetime_production:     4433226
lifetime_consumption:    14262700
inverters_production:    {...}
battery:                 {'type': 'acb', 'activeCount': 1, 'readingTime': 1619161595, 'wNow': -3, 'whNow': 0, 'state': 'idle', 'percentFull': 0}
bouyssic commented 3 years ago

Here you go sir: EDIT : with proper formatting

bash-5.0# python envoy_reader.py 
Enter the Envoy IP address or host name, or press enter to use 'envoy' as default: 1.1.1.1
Enter the Username for Inverter data authentication, or press enter to use 'envoy' as default: username
Enter the Password for Inverter data authentication, or press enter to use the default password: ******
Reading...
production:              1237
consumption:             558
daily_production:        1286
daily_consumption:       15771
seven_days_production:   108580
seven_days_consumption:  274603
lifetime_production:     3182116
lifetime_consumption:    12788787
inverters_production:    {'122003050569': [118, '2021-04-23 10:36:47'], '122003037804': [121, '2021-04-23 10:36:55'], '122003031864': [117, '2021-04-23 10:36:44'], '122003050565': [121, '2021-04-23 10:36:51'], '122003052183': [122, '2021-04-23 10:36:58'], '122003038059': [117, '2021-04-23 10:37:01'], '121944079829': [121, '2021-04-23 10:37:03'], '122003050079': [116, '2021-04-23 10:36:44'], '122003032003': [117, '2021-04-23 10:36:52'], '122003031789': [115, '2021-04-23 10:36:51'], '122003050570': [119, '2021-04-23 10:36:57']}
battery:                 {'type': 'acb', 'activeCount': 1, 'readingTime': 1619167023, 'wNow': 121, 'whNow': 74, 'state': 'discharging', 'percentFull': 6}
gtdiehl commented 3 years ago

Great! Thank you. I will merge these changes and make a new release. Than I can work on getting the Home Assistant sensor updated.

bouyssic commented 3 years ago

Don't thank me, you did all the heavy lifting

gtdiehl commented 3 years ago

@bouyssic I have to wait for the Home Assistant release that contains the Enphase Envoy config_flow UI change, PR #48517. I'm thinking it will be in the 2021.5 release. I'll reach out once you can test the updated sensor code, that is if you want to upgrade.

Unless you have a Home Assistant development environment already setup? My updated code is located at: https://github.com/gtdiehl/core/tree/envoy_battery_data/homeassistant/components/enphase_envoy