Page 2 of 3
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Monday 02 January 2023 20:29
by SanderRoelofs
Hi,
If you have createDevices = true then Domoticz will create the micro inverter devices for you. At least if you allow creation of new devices in settings page.
vwstepha wrote: ↑Monday 02 January 2023 20:15
Good evening everyone! Best wishes for this New Year!!!!
I want to monitor my Enphase meter
I put the script available on the 1st page (thanks to the author!!) in the events
I created a Dummy and the idx 16 was assigned by Dz.
in the settings, there is the authorization to create new sensors.
Code: Select all
-- ==============================
-- Your setting here
-- ==============================
-- Change to reflect location of your wget and remove -- ( comment ) in front of the declaration for your OS
-- wgetExecutable = '/usr/bin/wget' -- Linux
-- wgetExecutable = 'c:\\"Program files"\\wget.exe' -- Windows: double back slashes where one is in the path
local Enphase = {
ip = '192.168.1.195', -- IP address of your local enphase hub
password = 'ac6k4732', -- Change to your calculated password. See description above on how to get this.
dummyHardwareIDX = 16, -- Change to ID of your virtual hardware
useProduction = true,
productionDeviceName = 'l***l',
useInverters = true,
inverterDevicePrefix = 'micro inverter: ', -- script use this prefix + serial number of inverter.
createDevices = true, -- Should the script create devices if they are not defined yet.
-- please note that the counter display will only show a rough estimate
-- of the produced energy over the period the device lives in domoticz and the script is active.
-- =========================================
-- == No changes required below this line ==
-- ==========================================
user = 'installer', -- I think this is a fixed username
inverterDeviceType = 'Electric (instant+Counter)', -- script use this type for inverters
productionDeviceType = 'Electric (instant+Counter)', -- script use this type for total production
productionAPI = '/api/v1/production',
invertersAPI = '/api/v1/production/inverters',
}
I filled in my personal info except "micro inverter". I did not understand what I should put?
Do I have to put the serial number of the Micro inverter and therefore create as many scripts as there are micro inverters?
Can you help me?
Thank you
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Monday 02 January 2023 20:41
by vwstepha
Thank you for your reply
I authorized the creation
So I'm going to wait quietly tomorrow morning because, if I understood correctly, it will start when the micro Inverters produce electricity
Thanks again!
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Monday 02 January 2023 20:45
by SanderRoelofs
Hi,
Correct the inverters are offline at the moment because they are not producing power at the moment.
Hopefully tomorrow it will work
vwstepha wrote: ↑Monday 02 January 2023 20:41
Thank you for your reply
I authorized the creation
So I'm going to wait quietly tomorrow morning because, if I understood correctly, it will start when the micro Inverters produce electricity
Thanks again!
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 8:27
by vwstepha
Hi.
I found this morning with an error
Code: Select all
2023-01-03 08:51:00.504 Status: dzVents: Info: Enphase_0.201910122300: ------ Start internal script: Enphase:, trigger: "every 1 minutes between sunrise and 45 minutes after sunset"
2023-01-03 08:51:00.505 Status: dzVents: Info: Enphase_0.201910122300: /usr/bin/wget -T 3 --user installer --password ac6***** -O - 192.168.1.195/api/v1/production
2023-01-03 08:51:00.878 Status: dzVents: Info: Enphase_0.201910122300: ------ Finished Enphase
2023-01-03 08:51:00.877 Error: dzVents: Error: (3.1.8) Enphase_0.201910122300: ReturnCode: 5
2023-01-03 08:51:00.877 commandOutput:
2023-01-03 08:51:00.877
2023-01-03 08:51:00.877 Error: dzVents: Error: (3.1.8) Enphase_0.201910122300: ReturnCode: 5
2023-01-03 08:51:00.877 commandOutput:
2023-01-03 08:51:00.877
2023-01-03 08:51:00.878 Error: dzVents: Error: (3.1.8) Enphase_0.201910122300: An error occurred when calling event handler Enphase
2023-01-03 08:51:00.878 Error: dzVents: Error: (3.1.8) Enphase_0.201910122300: ...i/domoticz/scripts/dzVents/generated_scripts/Enphase.lua:177: attempt to index a nil value (local 'productionTable')
I don't know what to change or check....
Thank you for your help!
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 9:17
by SanderRoelofs
Hi,
Perhaps there is no data yet. In the mean while can you try opening the url
http://192.168.1.195/api/v1/production/ and the url
http://192.168.1.195/api/v1/production/inverters in a browser.
The first one should work like
Code: Select all
{
"wattHoursToday": 2,
"wattHoursSevenDays": 16490,
"wattHoursLifetime": 6170377,
"wattsNow": 36
}
the second one you should enter your username (installer) and password (ac6*****) and should have output like
Code: Select all
[
{
"serialNumber": "482*********",
"lastReportDate": 1672733665,
"devType": 1,
"lastReportWatts": 0,
"maxReportWatts": 260
},
{
"serialNumber": "482*********",
"lastReportDate": 1672733671,
"devType": 1,
"lastReportWatts": 1,
"maxReportWatts": 149
},
{
"serialNumber": "482*********",
"lastReportDate": 1672733660,
"devType": 1,
"lastReportWatts": 1,
"maxReportWatts": 149
}
..... etc ...
vwstepha wrote: ↑Tuesday 03 January 2023 8:27
Hi.
I found this morning with an error
Code: Select all
2023-01-03 08:51:00.504 Status: dzVents: Info: Enphase_0.201910122300: ------ Start internal script: Enphase:, trigger: "every 1 minutes between sunrise and 45 minutes after sunset"
2023-01-03 08:51:00.505 Status: dzVents: Info: Enphase_0.201910122300: /usr/bin/wget -T 3 --user installer --password ac6***** -O - 192.168.1.195/api/v1/production
2023-01-03 08:51:00.878 Status: dzVents: Info: Enphase_0.201910122300: ------ Finished Enphase
2023-01-03 08:51:00.877 Error: dzVents: Error: (3.1.8) Enphase_0.201910122300: ReturnCode: 5
2023-01-03 08:51:00.877 commandOutput:
2023-01-03 08:51:00.877
2023-01-03 08:51:00.877 Error: dzVents: Error: (3.1.8) Enphase_0.201910122300: ReturnCode: 5
2023-01-03 08:51:00.877 commandOutput:
2023-01-03 08:51:00.877
2023-01-03 08:51:00.878 Error: dzVents: Error: (3.1.8) Enphase_0.201910122300: An error occurred when calling event handler Enphase
2023-01-03 08:51:00.878 Error: dzVents: Error: (3.1.8) Enphase_0.201910122300: ...i/domoticz/scripts/dzVents/generated_scripts/Enphase.lua:177: attempt to index a nil value (local 'productionTable')
I don't know what to change or check....
Thank you for your help!
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 9:31
by vwstepha
hi
Your links is ok
Code: Select all
{
"wattHoursToday": 109,
"wattHoursSevenDays": 37273,
"wattHoursLifetime": 114956,
"wattsNow": 473
}
Code: Select all
[
{
"serialNumber": "4822400",
"lastReportDate": 1672733836,
"devType": 1,
"lastReportWatts": 45,
"maxReportWatts": 224
},
{
"serialNumber": "482240",
"lastReportDate": 1672733837,
"devType": 1,
"lastReportWatts": 45,
"maxReportWatts": 219
},
{
"serialNumber": "482240",
"lastReportDate": 1672733838,
"devType": 1,
"lastReportWatts": 17,
"maxReportWatts": 139
},
{
"serialNumber": "482240",
"lastReportDate": 1672733842,
"devType": 1,
"lastReportWatts": 60,
"maxReportWatts": 181
in the script I put the code found thanks to the apk: AC6*****
and the user is 'installer'
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 9:45
by SanderRoelofs
Okay and can you try the run this command on your Domoticz system
Code: Select all
/usr/bin/wget -T 3 --user installer --password ac6***** -O - 192.168.1.195/api/v1/production
vwstepha wrote: ↑Tuesday 03 January 2023 9:31
hi
Your links is ok
Code: Select all
{
"wattHoursToday": 109,
"wattHoursSevenDays": 37273,
"wattHoursLifetime": 114956,
"wattsNow": 473
}
Code: Select all
[
{
"serialNumber": "4822400",
"lastReportDate": 1672733836,
"devType": 1,
"lastReportWatts": 45,
"maxReportWatts": 224
},
{
"serialNumber": "482240",
"lastReportDate": 1672733837,
"devType": 1,
"lastReportWatts": 45,
"maxReportWatts": 219
},
{
"serialNumber": "482240",
"lastReportDate": 1672733838,
"devType": 1,
"lastReportWatts": 17,
"maxReportWatts": 139
},
{
"serialNumber": "482240",
"lastReportDate": 1672733842,
"devType": 1,
"lastReportWatts": 60,
"maxReportWatts": 181
in the script I put the code found thanks to the apk: AC6*****
and the user is 'installer'
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 10:08
by vwstepha
thank you for your help
this time the result is not good
Code: Select all
--2023-01-03 10:05:00-- http://192.168.1.195/api/v1/production
Connecting to 192.168.1.195:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://192.168.1.195/api/v1/production [following]
--2023-01-03 10:05:00-- https://192.168.1.195/api/v1/production
Connecting to 192.168.1.195:443... connected.
ERROR: The certificate of ‘192.168.1.195’ is not trusted.
ERROR: The certificate of ‘192.168.1.195’ doesn't have a known issuer.
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 10:42
by SanderRoelofs
Okay, there is your problem!
Question is now, who is causing the redirect, your system or enphase.
when you open the url
http://192.168.1.195/api/v1/production did it also redirect to https ?
you can also try this
Code: Select all
/usr/bin/wget -T 3 --user installer --password ac6***** --no-check-certificate -O - 192.168.1.195/api/v1/production
I'm almost sure that your enphase has a newer software version with ssl enabled and required.
Mine is at:
Code: Select all
Software Version
D5.0.55 (4f2662)
Software Build Date
10 Dec, 2020 10:15 AM
vwstepha wrote: ↑Tuesday 03 January 2023 10:08
thank you for your help
this time the result is not good
Code: Select all
--2023-01-03 10:05:00-- http://192.168.1.195/api/v1/production
Connecting to 192.168.1.195:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://192.168.1.195/api/v1/production [following]
--2023-01-03 10:05:00-- https://192.168.1.195/api/v1/production
Connecting to 192.168.1.195:443... connected.
ERROR: The certificate of ‘192.168.1.195’ is not trusted.
ERROR: The certificate of ‘192.168.1.195’ doesn't have a known issuer.
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 10:57
by vwstepha
indeed "
http://192.168.1.195/api/v1/production" also redirects to insecure https....
here is the response with --no-check-certificate
Code: Select all
--2023-01-03 10:50:14-- http://192.168.1.195/api/v1/production
Connecting to 192.168.1.195:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://192.168.1.195/api/v1/production [following]
--2023-01-03 10:50:14-- https://192.168.1.195/api/v1/production
Connecting to 192.168.1.195:443... connected.
WARNING: The certificate of ‘192.168.1.195’ is not trusted.
WARNING: The certificate of ‘192.168.1.195’ doesn't have a known issuer.
The certificate's owner does not match hostname ‘192.168.1.195’
HTTP request sent, awaiting response... 401 Unauthorized
Unknown authentication scheme.
Username/Password Authentication Failed.
You are totally right. My software version is newer
Code: Select all
Version logicielle
D7.0.88 (5580b1)
Date de version logicielle
18 jan, 2022 5:42 Matin
my installation is very recent (December 2022!)
So I don't know what to do....
thank you for your help
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 11:18
by SanderRoelofs
In the output i read : Username/Password Authentication Failed.
and secondly Enphase has updated security policies look at
https://support.enphase.com/s/article/I ... ease-Notes
and
https://store-d9.enphase.com/download/t ... 1670332507
instead of using username/password it's using tokens. So once you create a token and update the wget (curl) command it should work.
vwstepha wrote: ↑Tuesday 03 January 2023 10:57
indeed "
http://192.168.1.195/api/v1/production" also redirects to insecure https....
here is the response with --no-check-certificate
Code: Select all
--2023-01-03 10:50:14-- http://192.168.1.195/api/v1/production
Connecting to 192.168.1.195:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://192.168.1.195/api/v1/production [following]
--2023-01-03 10:50:14-- https://192.168.1.195/api/v1/production
Connecting to 192.168.1.195:443... connected.
WARNING: The certificate of ‘192.168.1.195’ is not trusted.
WARNING: The certificate of ‘192.168.1.195’ doesn't have a known issuer.
The certificate's owner does not match hostname ‘192.168.1.195’
HTTP request sent, awaiting response... 401 Unauthorized
Unknown authentication scheme.
Username/Password Authentication Failed.
You are totally right. My software version is newer
Code: Select all
Version logicielle
D7.0.88 (5580b1)
Date de version logicielle
18 jan, 2022 5:42 Matin
my installation is very recent (December 2022!)
So I don't know what to do....
thank you for your help
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 11:40
by vwstepha
I read the pdf and tried to understand.
I have created a token which has a validity of one year.
I stored it in a text file.
access via the token works on the web browser.
I tested with Putty on the raspberry
Code: Select all
curl -f -k -H 'Accept: application/json' -H 'Authorization: Bearer eyJraWQiOiI3ZDEwMDA1ZC03O**** ********’ -X GET https://192.168.1.195/api/v1/production/inverters
no answer from rapsberry....
Code: Select all
pi@raspberrypi:~ $ curl -f -k -H 'Accept: application/json' -H 'Authorization: Bearer eyJraWQiOiI3ZDEwMDA1ZC03ODk5LTRkMG*** *** xWw’ -X GET https://192.168.1.195/api/v1/production/inverters
>
>
>
> ^C
i click on CTRL+C to break
No answeer but no error....
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 11:49
by vwstepha
I tried to integrate this command line in the script
on line 131 I commented out wget....
and so I inserted my order
Code: Select all
local function getEnphaseData(api)
local baseCommand = curl -f -k -H 'Accept: application/json' -H 'Authorization: Bearer eyJraWQiOiI3ZDEw *** **** yxWw’ -X GET https://192.168.1.195/api/v1/production/inverters' -- wgetExecutable .. ' -T 3 --user ' .. Enphase.user .. ' --password ' .. Enphase.password ..' -O - '
local cmd = baseCommand .. Enphase.ip .. api
return osCommand(cmd)
but I have errors in the log
Code: Select all
2023-01-03 11:48:00.270 Error: dzVents: Error: (3.1.8) Enphase_0.201910122300: An error occurred when calling event handler Enphase 2
2023-01-03 11:48:00.270 Error: dzVents: Error: (3.1.8) Enphase_0.201910122300: ...domoticz/scripts/dzVents/generated_scripts/Enphase 2.lua:131: attempt to perform arithmetic on a nil value (global 'curl')
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 12:17
by SanderRoelofs
Sorry, I can't help you now because mine system has a older version.
I suggest that you investigate the curl command with token because you should get the same output as the webversion.
If that works then the complete script should work properly.
vwstepha wrote: ↑Tuesday 03 January 2023 11:40
I read the pdf and tried to understand.
I have created a token which has a validity of one year.
I stored it in a text file.
access via the token works on the web browser.
I tested with Putty on the raspberry
Code: Select all
curl -f -k -H 'Accept: application/json' -H 'Authorization: Bearer eyJraWQiOiI3ZDEwMDA1ZC03O**** ********’ -X GET https://192.168.1.195/api/v1/production/inverters
no answer from rapsberry....
Code: Select all
pi@raspberrypi:~ $ curl -f -k -H 'Accept: application/json' -H 'Authorization: Bearer eyJraWQiOiI3ZDEwMDA1ZC03ODk5LTRkMG*** *** xWw’ -X GET https://192.168.1.195/api/v1/production/inverters
>
>
>
> ^C
i click on CTRL+C to break
No answeer but no error....
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 12:46
by FireWizard
Hi,
Why not use the latest beta release?
It is natevely supported from version 14768.
Regards
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 13:19
by SanderRoelofs
With the native plugin you can read power usage etc but not all the inverters separately. Therefore we are using the script which creating the necessary devices and reading.
I also called Enphase about envoy sw versions. If you are not using IQ8+ inverters the main version remains D5.0.62 instead of v7.x version. That’s why my envoy is still version 5.x.xx.
Once mine envoy is updated I can test the curl/wget command to test communication.
FireWizard wrote: ↑Tuesday 03 January 2023 12:46
Hi,
Why not use the latest beta release?
It is natevely supported from version 14768.
Regards
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 14:23
by FireWizard
Hello @SanderRoelofs,
You wrote:
With the native plugin you can read power usage etc but not all the inverters separately
This is not true anymore. The Enphase "hardware" has been updated with individual read-out of the inverters and it supports now both system firmware D5 and D7
- Screenshot_Enphase_Config.png (208.61 KiB) Viewed 1222 times
See also:
https://github.com/domoticz/domoticz/issues/5377
This is something you might want to read as well, in order to get updated.
If you are not using IQ8+ inverters the main version remains D5.0.62 instead of v7.x version. That’s why my envoy is still version 5.x.xx.
This isn't true either. Of course, if If you install the brand new IQ8+ inverter, you need D7.
but in that case you also have to use a new Enphase Gateway (the new name for Envoy). Unfortunately Enphase Envoy-S (Standard or metered) cannot be used with the new IQ8 series of microinverters.
But your existing Enphase Envoy-S may receive an update from version D5 to D7. Be aware of that, if someday the communication with your Envoy fails.
Also my Envoy is still on D5, but I'm prepared if an update is pushed.
I hope, I have updated you a little.
Regards
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 15:00
by SanderRoelofs
Hi,
Many thanks for your input. I’ve read the github and it seems the new hardware support the same as the old hardware combined with dzVents script. (Power meters, total produced meter and inverter meters). See
- enphase.png (57.27 KiB) Viewed 1210 times
the first 4 are created throught HW and the rest through dzVentz
The support engineer from Enphase informed me wrong about the sw version and hw types. For the time being I’m good on D5xxx and else I know what to change
Hopefully your comment would help vwstepha setting up his enphase with domoticz.
FireWizard wrote: ↑Tuesday 03 January 2023 14:23
Hello @SanderRoelofs,
You wrote:
With the native plugin you can read power usage etc but not all the inverters separately
This is not true anymore. The Enphase "hardware" has been updated with individual read-out of the inverters and it supports now both system firmware D5 and D7
Screenshot_Enphase_Config.png
See also:
https://github.com/domoticz/domoticz/issues/5377
This is something you might want to read as well, in order to get updated.
If you are not using IQ8+ inverters the main version remains D5.0.62 instead of v7.x version. That’s why my envoy is still version 5.x.xx.
This isn't true either. Of course, if you install the brand new IQ8+ inverter, you need D7 but in that case you also have to use a new Enphase Gateway (the new name for Envoy). Unfortunately Enphase Envoy-S (Standard or metered) cannot be used with the new IQ8 series of microinverters.
But your existing Enphase Envoy-S may receive an update from version D5 to D7. Be aware of that, if someday the communication with your Envoy fails.
Also my Envoy is still on D5, but I'm prepared if an update is pushed.
I hope, I have updated you a liitle.
Regards
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 19:52
by vwstepha
Good evening.
I thank you both for your help.
I made a backup then installed the latest build 14905
On the other hand, I don't have anything to put my token or my passwords when I want to add the Enphase hardware?
I do not understand why.........
thanks again
Re: Get local Enphase data from individual solar panels in domoticz
Posted: Tuesday 03 January 2023 20:36
by FireWizard
Hi,
Did you clear your cache?