Interface script between 123solar api and Domoticz
Posted: Wednesday 18 May 2016 9:17
On request, here is my script which calls Solar data from multiple solar-inverters using the 123solar api (Jean-Marc Louviaux) and put it to the Domoticz api
If you are using a smart-meter with P1 interface it will also calculate you'r reale Power Consumption
Instructions are also in the script:
# put this in the crontab on the Domoticz host:
# */5 * * * * /usr/local/bin/get_solar_data -d >/dev/null 2>&1
# call parameters:
# -d : debug
# -t : test mode, this is a dry run, it won't update domoticz
#
# you should change the IDX=<number> rows to your id in Domoticz,
# find the right idx number in the Devices list in Domoticz
# if you don't have some values, simple set IDX=0
# in this example inverter 1 have 2 strings, while inverter 2 only has 1
# in Domoticz you first need to create Virtual Sensors:
#
# for kWh you should use "Electric Instant+Counter" note that values are stored in Wh, not in kWh
#
# idx Name Type SubType Data
# 154 Solar_Power General kWh 12769.776 kWh
# 155 Solar_Power_invt_1 General kWh 8549.873 kWh
# 156 Solar_Power_invt_2 General kWh 4219.903 kWh
# 114 Solar_invt_2_Eff General Percentage 81.50%
# 97 Solar_invt_2_W Usage Electric 100.5 Watt
# 103 Solar_invt_2_V General Voltage 170.000 V
# 106 Solar_invt_2_A General Current 0.600 A
# 110 Solar_invt_2_Grid_V General Voltage 231.400 V
# 112 Solar_invt_2_Grid_A General Current 0.400 A
# 109 Solar_invt_1_Grid_V General Voltage 232.500 V
# 111 Solar_invt_1_Grid_A General Current 0.600 A
# 113 Solar_invt_1_Eff General Percentage 93.10%
# 95 Solar_invt_1-1_W Usage Electric 72.2 Watt
# 96 Solar_invt_1-2_W Usage Electric 76.4 Watt
# 101 Solar_invt_1-1_V General Voltage 121.900 V
# 102 Solar_invt_1-2_V General Voltage 127.700 V
# 104 Solar_invt_1-1_A General Current 0.600 A
# 105 Solar_invt_1-2_A General Current 0.600 A
# 153 Power_Consumption RFXMeter counter 16257.239 kWh
#
# Solar_invt_1-2 means 2nd string of the 1st inverter
# Power Consumption is only possible if you use a smart-meter with P1 interface, see in the scripa
# If you only have 1 inverter, you can unvcomment all lines with W_TOT, WH_TOT and INVT_2 in it
# If you have 3 or more invertes add everywhere INVT_3 stuff etc
hope this will help you
If you are using a smart-meter with P1 interface it will also calculate you'r reale Power Consumption
Instructions are also in the script:
# put this in the crontab on the Domoticz host:
# */5 * * * * /usr/local/bin/get_solar_data -d >/dev/null 2>&1
# call parameters:
# -d : debug
# -t : test mode, this is a dry run, it won't update domoticz
#
# you should change the IDX=<number> rows to your id in Domoticz,
# find the right idx number in the Devices list in Domoticz
# if you don't have some values, simple set IDX=0
# in this example inverter 1 have 2 strings, while inverter 2 only has 1
# in Domoticz you first need to create Virtual Sensors:
#
# for kWh you should use "Electric Instant+Counter" note that values are stored in Wh, not in kWh
#
# idx Name Type SubType Data
# 154 Solar_Power General kWh 12769.776 kWh
# 155 Solar_Power_invt_1 General kWh 8549.873 kWh
# 156 Solar_Power_invt_2 General kWh 4219.903 kWh
# 114 Solar_invt_2_Eff General Percentage 81.50%
# 97 Solar_invt_2_W Usage Electric 100.5 Watt
# 103 Solar_invt_2_V General Voltage 170.000 V
# 106 Solar_invt_2_A General Current 0.600 A
# 110 Solar_invt_2_Grid_V General Voltage 231.400 V
# 112 Solar_invt_2_Grid_A General Current 0.400 A
# 109 Solar_invt_1_Grid_V General Voltage 232.500 V
# 111 Solar_invt_1_Grid_A General Current 0.600 A
# 113 Solar_invt_1_Eff General Percentage 93.10%
# 95 Solar_invt_1-1_W Usage Electric 72.2 Watt
# 96 Solar_invt_1-2_W Usage Electric 76.4 Watt
# 101 Solar_invt_1-1_V General Voltage 121.900 V
# 102 Solar_invt_1-2_V General Voltage 127.700 V
# 104 Solar_invt_1-1_A General Current 0.600 A
# 105 Solar_invt_1-2_A General Current 0.600 A
# 153 Power_Consumption RFXMeter counter 16257.239 kWh
#
# Solar_invt_1-2 means 2nd string of the 1st inverter
# Power Consumption is only possible if you use a smart-meter with P1 interface, see in the scripa
# If you only have 1 inverter, you can unvcomment all lines with W_TOT, WH_TOT and INVT_2 in it
# If you have 3 or more invertes add everywhere INVT_3 stuff etc
hope this will help you