matt-thurling / MMM-EnphaseSolar

Magic Mirror module for display data from Enphase Solar System
MIT License
3 stars 0 forks source link

Getting the access token Aug 2023 #2

Closed Ricand1 closed 1 year ago

Ricand1 commented 1 year ago

This isn't an issue, but I didn't know where to put this info. They changed the access token site and eliminated the free tier, and made it $25-$1500 per month for a token with the link given. It's still looks like its there, but when you choose the Watt plan it says access denied. You can get a free token that lasts for one year here https://enlighten.enphaseenergy.com/entrez-auth-token?serial_num=YourSerialNumber . You can find YourSerialNumber in the phone app under System/Devices/Gateway. Matt, maybe update your instructions to include this info? I so appreciate the hard work you have done and I wanted to give back to others wanting to enjoy it as well.

matt-thurling commented 1 year ago

Thanks for raising the issue and the alternative method of getting a token! I've updated the Readme to include it.

Just checking on what you encountered though when using my original method (listed as Method 1 in the readme now) - I've just tested it again and when I login its taking me to a purpose built app for generating these access tokens. What you've described though sounds more like the enphase developer portal where you need to choose a pricing tier etc to get a key. I just wanted to make sure - are you being redirected to the developer portal using my link? I'm wondering if there's some weird quirk (or if its a regional thing) where some users get redirected straight to the dev portal rather than the token generation app that I'm seeing. If thats the case then I should probably update the Readme again to highlight that.

The only other thing I can think of is maybe you were following the readme for https://github.com/tkrywit/MMM-Solar/ by mistake? I know that one was written back when the developer portal keys were free so that module still has instructions for using the dev portal (and it no longer works on the latest firmware which is what motivated me to write this module).

Ricand1 commented 1 year ago

I think you are right. I may have been on the wrong site and the token from my link isn’t working for me either. It just says loading on your module and doesn’t go farther.

I am having issues with your link since when I put in my system name, it autofills my sn however there are no gateway option. Enphase supports the second technique so I do think my api token is valid. This is my config.js module..

module: 'MMM-EnphaseSolar', position: 'middle_center', header: 'CopperCat Solar', config: { gatewayHost: "192.168.1.191", // use ip address if the default doesn't work token: “huge long token", // refreshInterval: 1000 60 1, // 1 minute // displayCurrentProduction: true, // displayCurrentUsage: true, // displayNetOutput: true, // displayTodaysProduction: true, // displayTodaysUsage: true, // displayLastUpdate: true, // displayLastUpdateFormat: "dd - HH:mm:ss", //format to display the last update. See Moment.js documentation for all display possibilities } },

Does this look right? The url definitely goes to my gateway. I get a screen with Metering, Monitoring, Microinverters etc when I put the local ip address in a browser.

Thanks again for your help and efforts toward this module.

Rick

On Aug 14, 2023, at 12:16 AM, Matt @.***> wrote:

Thanks for raising the issue and the alternative method of getting a token! I've updated the Readme to include it.

Just checking on what you encountered though when using my original method (listed as Method 1 in the readme now) - I've just tested it again and when I login its taking me to a purpose built app for generating these access tokens. What you've described though sounds more like the enphase developer portal where you need to choose a pricing tier etc to get a key. I just wanted to make sure - are you being redirected to the developer portal using my link? I'm wondering if there's some weird quirk (or if its a regional thing) where some users get redirected straight to the dev portal rather than the token generation app that I'm seeing. If thats the case then I should probably update the Readme again to highlight that.

The only other thing I can think of is maybe you were following the readme for https://github.com/tkrywit/MMM-Solar/ by mistake? I know that one was written back when the developer portal keys were free so that module still has instructions for using the dev portal (and it no longer works on the latest firmware which is what motivated me to write this module).

— Reply to this email directly, view it on GitHub https://github.com/matt-thurling/MMM-EnphaseSolar/issues/2#issuecomment-1676800862, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZFXSFU7XJVSICIUMD2LGUTXVHGD7ANCNFSM6AAAAAA3OMISDI. You are receiving this because you authored the thread.

Ricand1 commented 1 year ago

I think you are right. I may have been on the wrong site and the token from my link isn’t working for me either. It just says loading on your module and doesn’t go farther.

When I put in my system name in your link, it autofills and includes the last 6 digits of my gateway sn, however there are no gateway option. Enphase supports the second technique so I do think my api token is valid. This is my config.js module

module: 'MMM-EnphaseSolar', position: 'middle_center', header: 'CopperCat Solar', config: { gatewayHost: "192.168.1.191", // use ip address if the default doesn't work token: “huge long token", // refreshInterval: 1000 60 1, // 1 minute // displayCurrentProduction: true, // displayCurrentUsage: true, // displayNetOutput: true, // displayTodaysProduction: true, // displayTodaysUsage: true, // displayLastUpdate: true, // displayLastUpdateFormat: "dd - HH:mm:ss", //format to display the last update. See Moment.js documentation for all display possibilities } },

Does this look right? The url definitely goes to my gateway. I get a screen with Metering, Monitoring, Microinverters etc when I put the local ip address in a browser.

Thanks again for your help and efforts toward this module. I’d buy you a few beers, but I can’t find a way to contribute on Github. Your module is something I want on my MM. Another way maybe?

Rick

On Aug 14, 2023, at 12:16 AM, Matt @.***> wrote:

Thanks for raising the issue and the alternative method of getting a token! I've updated the Readme to include it.

Just checking on what you encountered though when using my original method (listed as Method 1 in the readme now) - I've just tested it again and when I login its taking me to a purpose built app for generating these access tokens. What you've described though sounds more like the enphase developer portal where you need to choose a pricing tier etc to get a key. I just wanted to make sure - are you being redirected to the developer portal using my link? I'm wondering if there's some weird quirk (or if its a regional thing) where some users get redirected straight to the dev portal rather than the token generation app that I'm seeing. If thats the case then I should probably update the Readme again to highlight that.

The only other thing I can think of is maybe you were following the readme for https://github.com/tkrywit/MMM-Solar/ by mistake? I know that one was written back when the developer portal keys were free so that module still has instructions for using the dev portal (and it no longer works on the latest firmware which is what motivated me to write this module).

— Reply to this email directly, view it on GitHub https://github.com/matt-thurling/MMM-EnphaseSolar/issues/2#issuecomment-1676800862, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZFXSFU7XJVSICIUMD2LGUTXVHGD7ANCNFSM6AAAAAA3OMISDI. You are receiving this because you authored the thread.

matt-thurling commented 1 year ago

That config looks okay to me.

I guess the best way to troubleshoot what the problem is would be to look at the magic mirror logs since this module should be putting some errors in there that might help debug it. Where those logs are really depends on how you've installed MagicMirror though.

In my case, I'm running MagicMirror via pm2 which means I can run: pm2 list to find the 'application name' (which for me is just MagicMirror). Then pm2 info MagicMirror (where MagicMirror is the application name from the list command) which will tell me where the log and error files are. Then I can just use less or cat on those files to look for errors. Depending on how many modules you have there could be a lot of noise in there though.

The other thing you could try would be to go to your gateway via web browser and login so that the data shows (you mentioned you can see "Metering, Monitoring, Microinverters etc."). Then change the url in your address bar to https://192.168.1.191/production.json?details1 (I took your gateway's ip address from the config above) and then see what result you get in the browser. It should give you a block of json text with all the values this module needs in it. If that's working then it must be something to do with how this module is attempting to retrieve that data, which I think we'd need the log output above to troubleshoot.

Ricand1 commented 1 year ago

Thanks so much for getting back to me. I’ll try to see some logs..

Rick

On Aug 15, 2023, at 10:29 PM, Matt @.***> wrote:

That config looks okay to me.

I guess the best way to troubleshoot what the problem is would be to look at the magic mirror logs since this module should be putting some errors in there that might help debug it. Where those logs are really depends on how you've installed MagicMirror though.

In my case, I'm running MagicMirror via pm2 which means I can run: pm2 list to find the 'application name' (which for me is just MagicMirror). Then pm2 info MagicMirror (where MagicMirror is the application name from the list command) which will tell me where the log and error files are. Then I can just use less or cat on those files to look for errors. Depending on how many modules you have there could be a lot of noise in there though.

The other thing you could try would be to go to your gateway via web browser and login so that the data shows (you mentioned you can see "Metering, Monitoring, Microinverters etc."). Then change the url in your address bar to https://192.168.1.191/production.json?details1 (I took your gateway's ip address from the config above) and then see what result you get in the browser. It should give you a block of json text with all the values this module needs in it. If that's working then it must be something to do with how this module is attempting to retrieve that data, which I think we'd need the log output above to troubleshoot.

— Reply to this email directly, view it on GitHub https://github.com/matt-thurling/MMM-EnphaseSolar/issues/2#issuecomment-1679986925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZFXSFVD7IWLVU3XC5JIT2DXVRLFJANCNFSM6AAAAAA3OMISDI. You are receiving this because you authored the thread.

Ricand1 commented 1 year ago

So this appears to be a problem I need to work out with Enphase.

0|MagicMir | [16.08.2023 16:03.05.018] [LOG] MMM-EnphaseSolar: Getting a session token 0|MagicMir | [16.08.2023 16:03.05.028] [LOG] Failed to authorize with local gateway! error: Error: connect ECONNREFUSED 192.168.1.191:443 0|MagicMir | [16.08.2023 16:04.05.018] [LOG] MMM-EnphaseSolar: Getting a session token 0|MagicMir | [16.08.2023 16:04.05.079] [LOG] Failed to authorize with local gateway! error: Error: connect ECONNREFUSED 192.168.1.191:443 0|MagicMir | [16.08.2023 16:05.05.018] [LOG] MMM-EnphaseSolar: Getting a session token 0|MagicMir | [16.08.2023 16:05.05.028] [LOG] Failed to authorize with local gateway! error: Error: connect ECONNREFUSED 192.168.1.191:443 0|MagicMir | [16.08.2023 16:06.05.018] [LOG] MMM-EnphaseSolar: Getting a session token 0|MagicMir | [16.08.2023 16:06.05.091] [LOG] Failed to authorize with local gateway! error: Error: connect ECONNREFUSED 192.168.1.191:443 0|MagicMir | [16.08.2023 16:07.05.018] [LOG] MMM-EnphaseSolar: Getting a session token 0|MagicMir | [16.08.2023 16:07.05.028] [LOG] Failed to authorize with local gateway! error: Error: connect ECONNREFUSED 192.168.1.191:443 0|MagicMir | [16.08.2023 16:07.05.491] [INFO] Newsfeed-Fetcher: Broadcasting 26 items. 0|MagicMir | [16.08.2023 16:08.05.018] [LOG] MMM-EnphaseSolar: Getting a session token 0|MagicMir | [16.08.2023 16:08.05.104] [LOG] Failed to authorize with local gateway! error: Error: connect ECONNREFUSED 192.168.1.191:443

0|MagicMirror | [16.08.2023 16:09.05.022] [LOG] MMM-EnphaseSolar: Getting a session token 0|MagicMirror | [16.08.2023 16:09.05.111] [LOG] Failed to authorize with local gateway! error: Error: connect ECONNREFUSED 192.168.1.191:443 0|MagicMirror | [16.08.2023 16:10.05.023] [LOG] MMM-EnphaseSolar: Getting a session token 0|MagicMirror | [16.08.2023 16:10.05.118] [LOG] Failed to authorize with local gateway! error: Error: connect ECONNREFUSED 192.168.1.191:443 0|MagicMirror | [16.08.2023 16:11.05.021] [LOG] MMM-EnphaseSolar: Getting a session token 0|MagicMirror | [16.08.2023 16:11.05.125] [LOG] Failed to authorize with local gateway! error: Error: connect ECONNREFUSED 192.168.1.191:443 0|MagicMirror | [16.08.2023 16:12.05.022] [LOG] MMM-EnphaseSolar: Getting a session token 0|MagicMirror | [16.08.2023 16:12.05.130] [LOG] Failed to authorize with local gateway! error: Error: connect ECONNREFUSED 192.168.1.191:443 0|MagicMirror | [16.08.2023 16:12.05.656] [INFO] Newsfeed-Fetcher: Broadcasting 26 items. 0|MagicMirror | [16.08.2023 16:13.05.020] [LOG] MMM-EnphaseSolar: Getting a session token 0|MagicMirror | [16.08.2023 16:13.05.139] [LOG] Failed to authorize with local gateway! error: Error: connect ECONNREFUSED 192.168.1.191:443

If you have any input it would be welcomed. I’m not asked to log in at that url, but I do get info on my system. What should I ask Enphase support to help me figure it out?

Thanks again dude!! You are awesome to keep trying to help me. How do I support your efforts, there doesn’t seem to be a way on Github?

Rick

On Aug 15, 2023, at 10:29 PM, Matt @.***> wrote:

That config looks okay to me.

I guess the best way to troubleshoot what the problem is would be to look at the magic mirror logs since this module should be putting some errors in there that might help debug it. Where those logs are really depends on how you've installed MagicMirror though.

In my case, I'm running MagicMirror via pm2 which means I can run: pm2 list to find the 'application name' (which for me is just MagicMirror). Then pm2 info MagicMirror (where MagicMirror is the application name from the list command) which will tell me where the log and error files are. Then I can just use less or cat on those files to look for errors. Depending on how many modules you have there could be a lot of noise in there though.

The other thing you could try would be to go to your gateway via web browser and login so that the data shows (you mentioned you can see "Metering, Monitoring, Microinverters etc."). Then change the url in your address bar to https://192.168.1.191/production.json?details1 (I took your gateway's ip address from the config above) and then see what result you get in the browser. It should give you a block of json text with all the values this module needs in it. If that's working then it must be something to do with how this module is attempting to retrieve that data, which I think we'd need the log output above to troubleshoot.

— Reply to this email directly, view it on GitHub https://github.com/matt-thurling/MMM-EnphaseSolar/issues/2#issuecomment-1679986925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZFXSFVD7IWLVU3XC5JIT2DXVRLFJANCNFSM6AAAAAA3OMISDI. You are receiving this because you authored the thread.

matt-thurling commented 1 year ago

How do I support your efforts, there doesn’t seem to be a way on Github?

Don't worry about it, I enjoy figuring this stuff out! Thanks anyway though!

Failed to authorize with local gateway! error: Error: connect ECONNREFUSED 192.168.1.191:443

This error in your log sounds like there is an issue with the device running MagicMirror making a network connection to the gateway - I can replicate that error on mine by putting the wrong IP address in for the gateway but it has to specifically be the IP address of something else on my network that will respond with a 'connection not allowed'. I'm guessing the ip address in your configuration must be correct otherwise you wouldn't be able to connect to your gateway via that ip in your web browser but potentially there may be a connection issue between your MagicMirror device and the gateway. Is the device running MagicMirror connected to the same network as the gateway (with no firewall in between either)?

You could try running the following command from your MagicMirror device to see if it's able to connect to the gateway at least (replace 192.168.1.191 with your gateway's ip address if thats not correct): curl https://192.168.1.191/home -k That command should just return a bunch of html, but if its giving you an error like: curl: (7) Failed to connect to 192.168.1.191 port 443: Connection refused then its actually a network problem between the device that MagicMirror is running on and your gateway.

Another thought that just crossed my mind - do you know what firmware version your gateway is on? I believe from firmware 7.0 upwards they added the https/ssl connection (i.e. thats why its port 443 in the error) so potentially if you're on an older one then thats where the issue comes from. If the command above gives you the connection error, try again but changing the https to http and see if it returns something different. Unfortunately if you are on a firmware older than 7 you might need to look at some of the other modules that people have written for the older firmware because this one won't work. Alternatively I believe Enphase could update your firmware for you to the latest version.

Ricand1 commented 1 year ago

Matt you are awesome. Thanks so much. I’m a maker and I love solving puzzles too. I just don’t have the expertise to solve this problem.

So if I take the https to http I get this response.

@.***:~/MagicMirror $ curl http://192.168.1.191/home -k <!DOCTYPE html>

Envoy 121625059276

It has to be pinging the gateway to get any response, right?

Does the software version of D5xxxxxxxx indicate it’s not on V7 firmware? According to Enphase they automatically update firmware.

My neighbor installed my 54 panels. He just happens to be the best high end solar installer in the county. He’s 2 years out on new customer installations. I’m sure he would come over with his ‘installer app’ if the problem is my gateway not being associated with my account.

Check your Enlighten app out. If you go to menu System, Devices, Gateway and chose Connect Locally do you get a response? Mine does a Searching for gateway… for a few minutes. Then it errors out with Gateway not detected.

Do you think it could be a setup issue when my system was installed? I can get all my current solar info on Enlighten, so something is working.

Thanks again for continuing to help a random internet stranger. I can’t tell you how much I appreciate it.

Rick

On Aug 19, 2023, at 8:20 PM, Matt @.***> wrote:

curl https://192.168.1.191/home -k

matt-thurling commented 1 year ago

Does the software version of D5xxxxxxxx indicate it’s not on V7 firmware? According to Enphase they automatically update firmware.

Ah yes, I think this is probably the cause - my app says my gateway is on D7.6.175. I was under the impression Enphase would automatically update people too so not sure why yours hasn't.

I did have another thought though - you said that when you went to https://192.168.1.191/production.json?details1 it gave you some data about your system? Potentially on the older firmware you don't need to worry about the authentication and you might be able to just get the data this module needs directly.

Would you be okay with sharing the data you get from going directly to that url? Feel free to change the actual values of whatever is there for privacy, I'm more interested in what fields are there that you can see. If it has all the same data fields then I could probably set this module up with a configuration for a "backwards compatibility" mode which will skip the authentication bit and just pull the data directly for people who are on the older firmware.

Ricand1 commented 1 year ago

Wait!! I just tried again and it did return the info. I just needed it to be http:// not https://.

Here it is..

0
type "inverters" activeCount 54 readingTime 1692551711 wNow 2312 whLifetime 93490397 1
type "eim" activeCount 1 measurementType "production" readingTime 1692551930 wNow 2172.072 whLifetime 93014654.166 varhLeadLifetime 1.347 varhLagLifetime 37122078.073 vahLifetime 116592417.555 rmsCurrent 18.434 rmsVoltage 247.119 reactPwr 660.114 apprntPwr 2278.624 pwrFactor 0.96 whToday 3434.166 whLastSevenDays 61155.166 vahToday 8292.555 varhLeadToday 1.347 varhLagToday 6194.073 consumption 0
type "eim" activeCount 1 measurementType "total-consumption" readingTime 1692551930 wNow 3349.932 whLifetime 172319027.466 varhLeadLifetime 12141697.968 varhLagLifetime 56347494.374 vahLifetime 178083243.887 rmsCurrent 35.688 rmsVoltage 247.095 reactPwr -912.963 apprntPwr 8818.266 pwrFactor 0.38 whToday 20687.466 whLastSevenDays 90783.466 vahToday 20232.887 varhLeadToday 2942.968 varhLagToday 8248.374 1
type "eim" activeCount 1 measurementType "net-consumption" readingTime 1692551930 wNow 1177.86 whLifetime 121517472.214 varhLeadLifetime 12141696.62 varhLagLifetime 19225416.301 vahLifetime 178083243.887 rmsCurrent 17.254 rmsVoltage 247.071 reactPwr -252.849 apprntPwr 2127.746 pwrFactor 0.55 whToday 0 whLastSevenDays 0 vahToday 0 varhLeadToday 0 varhLagToday 0 storage 0
type "acb" activeCount 0 readingTime 0 wNow 0 whNow 0 state "idle"

Woohoo.. maybe I don’t need the solar guys?

Rick

On Aug 20, 2023, at 12:28 AM, Matt @.***> wrote:

Does the software version of D5xxxxxxxx indicate it’s not on V7 firmware? According to Enphase they automatically update firmware.

Ah yes, I think this is probably the cause - my app says my gateway is on D7.6.175. I was under the impression Enphase would automatically update people too so not sure why yours hasn't.

I did have another thought though - you said that when you went to https://192.168.1.191/production.json?details1 it gave you some data about your system? Potentially on the older firmware you don't need to worry about the authentication and you might be able to just get the data this module needs directly.

Would you be okay with sharing the data you get from going directly to that url? Feel free to change the actual values of whatever is there for privacy, I'm more interested in what fields are there that you can see. If it has all the same data fields then I could probably set this module up with a configuration for a "backwards compatibility" mode which will skip the authentication bit and just pull the data directly for people who are on the older firmware.

— Reply to this email directly, view it on GitHub https://github.com/matt-thurling/MMM-EnphaseSolar/issues/2#issuecomment-1685209918, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZFXSFQWPK5BLP7WT66UT43XWG4B5ANCNFSM6AAAAAA3OMISDI. You are receiving this because you authored the thread.

Ricand1 commented 1 year ago

Hey Matt,

When I put the IP address in config.js file does it automatically append the https:// prefix? If I could alter that to http:// and the return info is the same format, maybe it would work? Specifically if it ignores the ’token’ field. It would allow your module to work with older software versions.

Let me know what you think, and thanks again for your help. I’m getting an estimate from the new owner of the company that installed my solar system to upgrade the gateway software to D7.

Rick

On Aug 20, 2023, at 10:25 AM, Richard Page @.***> wrote:

Wait!! I just tried again and it did return the info. I just needed it to be http:// not https://.

Here it is..

0 type "inverters" activeCount 54 readingTime 1692551711 wNow 2312 whLifetime 93490397 1 type "eim" activeCount 1 measurementType "production" readingTime 1692551930 wNow 2172.072 whLifetime 93014654.166 varhLeadLifetime 1.347 varhLagLifetime 37122078.073 vahLifetime 116592417.555 rmsCurrent 18.434 rmsVoltage 247.119 reactPwr 660.114 apprntPwr 2278.624 pwrFactor 0.96 whToday 3434.166 whLastSevenDays 61155.166 vahToday 8292.555 varhLeadToday 1.347 varhLagToday 6194.073 consumption
0 type "eim" activeCount 1 measurementType "total-consumption" readingTime 1692551930 wNow 3349.932 whLifetime 172319027.466 varhLeadLifetime 12141697.968 varhLagLifetime 56347494.374 vahLifetime 178083243.887 rmsCurrent 35.688 rmsVoltage 247.095 reactPwr -912.963 apprntPwr 8818.266 pwrFactor 0.38 whToday 20687.466 whLastSevenDays 90783.466 vahToday 20232.887 varhLeadToday 2942.968 varhLagToday 8248.374 1 type "eim" activeCount 1 measurementType "net-consumption" readingTime 1692551930 wNow 1177.86 whLifetime 121517472.214 varhLeadLifetime 12141696.62 varhLagLifetime 19225416.301 vahLifetime 178083243.887 rmsCurrent 17.254 rmsVoltage 247.071 reactPwr -252.849 apprntPwr 2127.746 pwrFactor 0.55 whToday 0 whLastSevenDays 0 vahToday 0 varhLeadToday 0 varhLagToday 0 storage
0 type "acb" activeCount 0 readingTime 0 wNow 0 whNow 0 state "idle"

Woohoo.. maybe I don’t need the solar guys?

Rick

On Aug 20, 2023, at 12:28 AM, Matt @.***> wrote:

Does the software version of D5xxxxxxxx indicate it’s not on V7 firmware? According to Enphase they automatically update firmware.

Ah yes, I think this is probably the cause - my app says my gateway is on D7.6.175. I was under the impression Enphase would automatically update people too so not sure why yours hasn't.

I did have another thought though - you said that when you went to https://192.168.1.191/production.json?details1 it gave you some data about your system? Potentially on the older firmware you don't need to worry about the authentication and you might be able to just get the data this module needs directly.

Would you be okay with sharing the data you get from going directly to that url? Feel free to change the actual values of whatever is there for privacy, I'm more interested in what fields are there that you can see. If it has all the same data fields then I could probably set this module up with a configuration for a "backwards compatibility" mode which will skip the authentication bit and just pull the data directly for people who are on the older firmware.

— Reply to this email directly, view it on GitHub https://github.com/matt-thurling/MMM-EnphaseSolar/issues/2#issuecomment-1685209918, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZFXSFQWPK5BLP7WT66UT43XWG4B5ANCNFSM6AAAAAA3OMISDI. You are receiving this because you authored the thread.

matt-thurling commented 1 year ago

Hey Rick,

Yeah, the code will always use https at the moment. I had the same thought as you though - maybe switch it to use http and ignore the token authentication for older firmwares. Unfortunately it looks like the data yours is returning is similar (same field names) but a little different (yours is a list while firmware 7+ is formatted as json with the curly brackets etc) so might need a bit more effort to get it to work. For example this is what my system returns, which has mostly the same data as yours but presented differently:

{"production":[{"type":"inverters","activeCount":17,"readingTime":1692609850,"wNow":0,"whLifetime":428234},{"type":"eim","activeCount":1,"measurementType":"production","readingTime":1692610048,"wNow":-5.784,"whLifetime":2713314.542,"varhLeadLifetime":860036.454,"varhLagLifetime":536328.477,"vahLifetime":3416963.084,"rmsCurrent":1.301,"rmsVoltage":239.804,"reactPwr":302.154,"apprntPwr":312.241,"pwrFactor":-0.02,"whToday":20855.542,"whLastSevenDays":160012.542,"vahToday":25538.084,"varhLeadToday":7860.454,"varhLagToday":3077.477}],"consumption":[{"type":"eim","activeCount":1,"measurementType":"total-consumption","readingTime":1692610048,"wNow":3578.043,"whLifetime":2309236.703,"varhLeadLifetime":250573.761,"varhLagLifetime":17841.616,"vahLifetime":4906052.967,"rmsCurrent":17.006,"rmsVoltage":239.923,"reactPwr":222.648,"apprntPwr":4080.212,"pwrFactor":0.88,"whToday":13065.703,"whLastSevenDays":129439.703,"vahToday":34898.967,"varhLeadToday":7.761,"varhLagToday":1901.0},{"type":"eim","activeCount":1,"measurementType":"net-consumption","readingTime":1692610048,"wNow":3583.827,"whLifetime":-403759.383,"varhLeadLifetime":1110610.215,"varhLagLifetime":554170.092,"vahLifetime":4906052.967,"rmsCurrent":15.705,"rmsVoltage":239.923,"reactPwr":-79.505,"apprntPwr":3768.092,"pwrFactor":0.95,"whToday":0,"whLastSevenDays":0,"vahToday":0,"varhLeadToday":0,"varhLagToday":0}],"storage":[{"type":"acb","activeCount":0,"readingTime":0,"wNow":0,"whNow":0,"state":"idle"}]}
Ricand1 commented 1 year ago

The simplest thing is to update my Envoy gateway software. I’ve created a ticket with Enphase and hopefully they will remote in and update it. It is definitely supposed to be auto updated. It was offline for a few months when I changed routers.

Thanks again for all your help. I will let you know how it works out.

Rick

On Aug 21, 2023, at 2:39 AM, Matt @. @.>> wrote:

Hey Rick,

Yeah, the code will always use https at the moment. I had the same thought as you though - maybe switch it to use http and ignore the token authentication for older firmwares. Unfortunately it looks like the data yours is returning is similar (same field names) but a little different (yours is a list while firmware 7+ is formatted as json with the curly brackets etc) so might need a bit more effort to get it to work. For example this is what my system returns, which has mostly the same data as yours but presented differently:

matt-thurling commented 1 year ago

Hey Rick,

No worries, hopefully they can update it and it will all be straightforward after that.

-Matt

Ricand1 commented 1 year ago

It took less than 24 hours to update the Envoy Gateway software. Your module is returning data and working great. I guess they changed the data format with the D6.xx update. It’s free and quick to update though, once you figure out how to do it.

Thanks again for all your help troubleshooting!

Rick

On Aug 21, 2023, at 11:07 PM, Matt @.***> wrote:

Hey Rick,

No worries, hopefully they can update it and it will all be straightforward after that.

-Matt

— Reply to this email directly, view it on GitHub https://github.com/matt-thurling/MMM-EnphaseSolar/issues/2#issuecomment-1687499525, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZFXSFW6SQLYTW6M6OLCD7TXWREA5ANCNFSM6AAAAAA3OMISDI. You are receiving this because you authored the thread.

matt-thurling commented 1 year ago

Ah awesome! Glad to hear it all worked out!