jblance / mpp-solar

Python package to communicate to MPP Solar PIP-4048MS inverters (and similar)
MIT License
347 stars 148 forks source link

This entity is no longer being provided by the mqtt integration. If the entity is no longer in use, delete it in settings. #304

Closed Saentist closed 1 year ago

Saentist commented 1 year ago

latest

mpp-solar -p /dev/hidraw2 -o screen -c QID#QDI#QMOD#QPI#QPIGS#QPIRI#QFLAG
Command: QID - Device Serial Number inquiry
--------------------------------------------------------------------------------
Parameter     Value             Unit
serial_number 55355535553555
Command: QDI - Default Settings inquiry
--------------------------------------------------------------------------------
Parameter                      Value            Unit
ac_output_voltage              230.0            V
ac_output_frequency            50.0             Hz
max_ac_charging_current        30               A
battery_under_voltage          42.0             V
battery_float_charge_voltage   54.0             V
battery_bulk_charge_voltage    56.4             V
battery_recharge_voltage       46.0             V
max_charging_current           60               A
input_voltage_range            Appliance
output_source_priority         Utility first
charger_source_priority        Solar + Utility
battery_type                   AGM
buzzer                         enabled
power_saving                   disabled
overload_restart               disabled
over_temperature_restart       disabled
lcd_backlight                  enabled
primary_source_interrupt_alarm enabled
record_fault_code              enabled
overload_bypass                disabled
lcd_reset_to_default           enabled
output_mode                    single machine output
battery_redischarge_voltage    54.0             V
pv_ok_condition                As long as one unit of inverters has connect PV, parallel system will consider PV OK
pv_power_balance               PV input max power will be the sum of the max charged power and loads power
Command: QMOD - Mode inquiry
--------------------------------------------------------------------------------
Parameter   Value               Unit
device_mode Line
Command: QPI - Protocol ID inquiry
--------------------------------------------------------------------------------
Parameter   Value               Unit
protocol_id PI30
Command: QPIGS - General Status Parameters inquiry
--------------------------------------------------------------------------------
Parameter                                   Value               Unit
ac_input_voltage                            214.3               V       {'icon': 'lightning'}
ac_input_frequency                          50.0                Hz
ac_output_voltage                           214.3               V
ac_output_frequency                         50.0                Hz
ac_output_apparent_power                    0                   VA
ac_output_active_power                      0                   W
ac_output_load                              0                   %
bus_voltage                                 362                 V
battery_voltage                             1.0                 V
battery_charging_current                    0                   A
battery_capacity                            0                   %
inverter_heat_sink_temperature              28                  °C
pv_input_current_for_battery                0.0                 A
pv_input_voltage                            0.0                 V
battery_voltage_from_scc                    0.0                 V
battery_discharge_current                   0                   A
is_sbu_priority_version_added               0                   bool
is_configuration_changed                    0                   bool
is_scc_firmware_updated                     0                   bool
is_load_on                                  1                   bool
is_battery_voltage_to_steady_while_charging 0                   bool
is_charging_on                              0                   bool
is_scc_charging_on                          0                   bool
is_ac_charging_on                           0                   bool
rsv1                                        0                   A
rsv2                                        0                   A
pv_input_power                              0                   W
is_charging_to_float                        0                   bool
is_switched_on                              1                   bool
is_reserved                                 0                   bool
Command: QPIRI - Current Settings inquiry
--------------------------------------------------------------------------------
Parameter                    Value              Unit
ac_input_voltage             230.0              V
ac_input_current             21.7               A
ac_output_voltage            230.0              V
ac_output_frequency          50.0               Hz
ac_output_current            21.7               A
ac_output_apparent_power     5000               VA
ac_output_active_power       5000               W
battery_voltage              48.0               V
battery_recharge_voltage     46.0               V
battery_under_voltage        42.0               V
battery_bulk_charge_voltage  56.4               V
battery_float_charge_voltage 54.0               V
battery_type                 AGM
max_ac_charging_current      2                  A
max_charging_current         10                 A
input_voltage_range          UPS
output_source_priority       Utility first
charger_source_priority      Solar first
max_parallel_units           1                  units
machine_type                 Off Grid
topology                     transformerless
output_mode                  single machine output
battery_redischarge_voltage  54.0               V
pv_ok_condition              As long as one unit of inverters has connect PV, parallel system will consider PV OK
pv_power_balance             PV input max power will be the sum of the max charged power and loads power
Command: QFLAG - Flag Status inquiry
--------------------------------------------------------------------------------
Parameter                      Value            Unit
overload_bypass                enabled
over_temperature_restart       enabled
lcd_backlight                  enabled
primary_source_interrupt_alarm enabled
record_fault_code              enabled
buzzer                         disabled
power_saving                   disabled
lcd_reset_to_default           disabled
overload_restart               disabled

Lot of entity's are switched to Unavailable, previously working

QDI AC Output Frequency = 50.0 Hz
QDI AC Output Voltage = 230.0 V
QDI Battery Bulk Charge Voltage = 56.4 V
QDI Battery Float Charge Voltage = 54.0 V
QDI Battery Recharge Voltage = 46.0 V
QDI Battery Redischarge Voltage = 54.0 V
QDI Battery Type = AGM
QDI Battery Under Voltage = 42.0 V
QDI Buzzer = Unavailable
QDI Buzzer = On
QDI Charger Source Priority = Solar + Utility
QDI Input Voltage Range = Appliance
QDI LCD Backlight = Unavailable
QDI LCD Backlight = On
QDI LCD reset to default = Unavailable
QDI LCD reset to default = On
QDI Max AC Charging Current = 30 A
QDI Max Charging Current = 60 A
QDI Output mode = single machine output
QDI Output Source Priority = Utility first
QDI Over temperature restart = Unavailable
QDI Over temperature restart = Off
QDI Overload bypass = Unavailable
QDI Overload bypass = Off
QDI Overload restart = Unavailable
QDI Overload restart = Off
QDI Power saving = Unavailable
QDI Power saving = Off
QDI Primary source interrupt alarm = Unavailable
QDI Primary source interrupt alarm = On
QDI PV OK condition = As long as one unit of inverters has connect PV, parallel system will consider PV OK
QDI PV Power Balance = PV input max power will be the sum of the max charged power and loads power
QDI Record fault code = Unavailable
QDI Record fault code = On
QFLAG Buzzer = Unavailable
QFLAG Buzzer = Off
QFLAG LCD Backlight = Unavailable
QFLAG LCD Backlight = On
QFLAG LCD Reset to Default = Unavailable
QFLAG LCD Reset to Default = Off
QFLAG Over Temperature Restart = Unavailable
QFLAG Over Temperature Restart = On
QFLAG Overload Bypass = Unavailable
QFLAG Overload Bypass = On
QFLAG Overload Restart = Unavailable
QFLAG Overload Restart = Off
QFLAG Power Saving = Unavailable
QFLAG Power Saving = Off
QFLAG Primary Source Interrupt Alarm = Unavailable
QFLAG Primary Source Interrupt Alarm = On
QFLAG Record Fault Code = Unavailable
QFLAG Record Fault Code = On
QID Serial Number = 55355535553555
QMOD Device Mode = Line
QPI Protocol ID = PI30
QPIGS AC Input Frequency = 50.0 Hz
QPIGS AC Input Voltage = Unavailable
QPIGS AC Output Active Power = 0 W
QPIGS AC Output Apparent Power = 0 VA
QPIGS AC Output Frequency = 50.0 Hz
QPIGS AC Output Load = 0%
QPIGS AC Output Voltage = 209.4 V
QPIGS Battery Capacity = 0%
QPIGS Battery Charging Current = 0 A
QPIGS Battery Discharge Current = 0 A
QPIGS Battery Voltage = 0.9 V
QPIGS Battery Voltage from SCC = 0.0 V
QPIGS BUS Voltage = 360 V
QPIGS Inverter Heat Sink Temperature = 29 °C
QPIGS Is AC Charging On = Unavailable
QPIGS Is AC Charging On = Off
QPIGS Is Battery Voltage to Steady While Charging = Unavailable
QPIGS Is Battery Voltage to Steady While Charging = Off
QPIGS Is Charging On = Unavailable
QPIGS Is Charging On = Off
QPIGS Is Charging to Float = Unavailable
QPIGS Is Charging to Float = Off
QPIGS Is Configuration Changed = Unavailable
QPIGS Is Configuration Changed = Off
QPIGS Is Load On = Unavailable
QPIGS Is Load On = On
QPIGS Is Reserved = Unavailable
QPIGS Is Reserved = Off
QPIGS Is SBU Priority Version Added = Unavailable
QPIGS Is SBU Priority Version Added = Off
QPIGS Is SCC Charging On = Unavailable
QPIGS Is SCC Charging On = Off
QPIGS Is SCC Firmware Updated = Unavailable
QPIGS Is SCC Firmware Updated = Off
QPIGS Is Switched On = Unavailable
QPIGS Is Switched On = On
QPIGS PV Input Current for Battery = 0.0 A
QPIGS PV Input Power = 0 W
QPIGS PV Input Voltage = 0.0 V
QPIGS RSV1 = 0 A
QPIGS RSV2 = 0 A
QPIRI AC Input Current = 21.7 A
QPIRI AC Input Voltage = 230.0 V
QPIRI AC Output Active Power = 5,000 W
QPIRI AC Output Apparent Power = 5,000 VA
QPIRI AC Output Current = 21.7 A
QPIRI AC Output Frequency = 50.0 Hz
QPIRI AC Output Voltage = 230.0 V
QPIRI Battery Bulk Charge Voltage = 56.4 V
QPIRI Battery Float Charge Voltage = 54.0 V
QPIRI Battery Recharge Voltage = 46.0 V
QPIRI Battery Redischarge Voltage = 54.0 V
QPIRI Battery Type = AGM
QPIRI Battery Under Voltage = 42.0 V
QPIRI Battery Voltage = 48.0 V
QPIRI Charger Source Priority = Solar first
QPIRI Input Voltage Range = UPS
QPIRI Machine Type = Off Grid
QPIRI Max AC Charging Current = 2 A
QPIRI Max Charging Current = 10 A
QPIRI Max Parallel Units = 1 units
QPIRI Output Mode = single machine output
QPIRI Output Source Priority = Utility first
QPIRI PV OK Condition = As long as one unit of inverters has connect PV, parallel system will consider PV OK
QPIRI PV Power Balance = PV input max power will be the sum of the max charged power and loads power
QPIRI Topology = transformerless

No firmware or etc. changed.

jblance commented 1 year ago

QDI Over temperature restart = Unavailable QDI Over temperature restart = Off

I assume this is in home assistant - the entities look to be duplicated, this might be the first update you've done since the change to move boolean variables to 'binary sensors' can you check the details of an unavailable entity and one that is available with the same name?

If one is a sensor and the other a binary sensor, you will either need to delete the unavailable sensor entities or roll back to an earlier version and remove the binary sensors

jblance commented 1 year ago

QPIGS Is AC Charging On = Unavailable QPIGS Is AC Charging On = Off QPIGS Is Battery Voltage to Steady While Charging = Unavailable QPIGS Is Battery Voltage to Steady While Charging = Off QPIGS Is Charging On = Unavailable QPIGS Is Charging On = Off QPIGS Is Charging to Float = Unavailable QPIGS Is Charging to Float = Off QPIGS Is Configuration Changed = Unavailable QPIGS Is Configuration Changed = Off QPIGS Is Load On = Unavailable QPIGS Is Load On = On QPIGS Is Reserved = Unavailable QPIGS Is Reserved = Off QPIGS Is SBU Priority Version Added = Unavailable QPIGS Is SBU Priority Version Added = Off QPIGS Is SCC Charging On = Unavailable QPIGS Is SCC Charging On = Off QPIGS Is SCC Firmware Updated = Unavailable QPIGS Is SCC Firmware Updated = Off QPIGS Is Switched On = Unavailable QPIGS Is Switched On = On

Also note that some of these might change names in the future as I get a better understanding of the inverters (particularly in PI30 and related protocols

eg Is SCC Charging On = Off would be better as SCC Charging = Off or Solar Charge Controller Charging = Off in my opinion

the code is still very beta (hence the 0.xx.y version numbering) and so is likely to have breaking changes from time to time

Im relying on pip/pypi for package distribution currently so have not really gone with release notes or the like

Saentist commented 1 year ago

There is a logic, but what about QPIGS AC Input Voltage

mpp-solar -p /dev/hidraw2 -o screen -c QPIGS
Command: QPIGS - General Status Parameters inquiry
--------------------------------------------------------------------------------
Parameter                                   Value               Unit
ac_input_voltage                            220.8               V       {'icon': 'lightning'}
ac_input_frequency                          50.0                Hz
ac_output_voltage                           220.8               V
ac_output_frequency                         50.0                Hz
ac_output_apparent_power                    0                   VA
ac_output_active_power                      0                   W
ac_output_load                              0                   %
bus_voltage                                 362                 V
battery_voltage                             0.9                 V
battery_charging_current                    0                   A
battery_capacity                            0                   %
inverter_heat_sink_temperature              37                  °C
pv_input_current_for_battery                0.0                 A
pv_input_voltage                            0.0                 V
battery_voltage_from_scc                    0.0                 V
battery_discharge_current                   0                   A
is_sbu_priority_version_added               0                   bool
is_configuration_changed                    0                   bool
is_scc_firmware_updated                     0                   bool
is_load_on                                  1                   bool
is_battery_voltage_to_steady_while_charging 0                   bool
is_charging_on                              0                   bool
is_scc_charging_on                          0                   bool
is_ac_charging_on                           0                   bool
rsv1                                        0                   A
rsv2                                        0                   A
pv_input_power                              0                   W
is_charging_to_float                        0                   bool
is_switched_on                              1                   bool
is_reserved                                 0                   bool
jblance commented 1 year ago

what about it? has it disappeared?

Saentist commented 1 year ago

Yes, all with return "icon" I also use hassd_mqtt to send data to HA

jblance commented 1 year ago

yes thats new development, device classes and icons are being added to protocols to improve home assistant support - its a work in progress and will likely change Has it caused a problem?

Saentist commented 1 year ago

Minimal, but is bug, hope fixed soon.

jblance commented 1 year ago

how so? the print to screen is used as debug - do you have a use case for the screen output that is needed to not show the extra info?

The PI30MAX protocol has even more info added

~/src/mpp-solar $ mpp-solar -p test -c QPIGS -P PI30MAX

Command: QPIGS - General Status Parameters inquiry
--------------------------------------------------------------------------------
Parameter                                   Value               Unit
ac_input_voltage                            227.2               V       {'icon': 'mdi:transmission-tower-export'}
ac_input_frequency                          50.0                Hz      {'icon': 'mdi:current-ac', 'device-class': 'frequency'}
ac_output_voltage                           230.3               V       {'icon': 'mdi:power-plug', 'device-class': 'voltage'}
ac_output_frequency                         50.0                Hz      {'icon': 'mdi:current-ac', 'device-class': 'frequency'}
ac_output_apparent_power                    829                 VA      {'icon': 'mdi:power-plug', 'device-class': 'apparent_power'}
ac_output_active_power                      751                 W       {'icon': 'mdi:power-plug', 'device-class': 'power'}
ac_output_load                              10                  %       {'icon': 'mdi:brightness-percent'}
bus_voltage                                 447                 V       {'icon': 'mdi:details', 'device-class': 'voltage'}
battery_voltage                             54.5                V       {'icon': 'mdi:battery-outline', 'device-class': 'voltage'}
battery_charging_current                    20                  A       {'icon': 'mdi:current-dc', 'device-class': 'current'}
battery_capacity                            83                  %       {'device-class': 'battery'}
inverter_heat_sink_temperature              54                  °C      {'icon': 'mdi:details', 'device-class': 'temperature'}
pv1_input_current                           2.7                 A       {'icon': 'mdi:solar-power', 'device-class': 'current'}
pv1_input_voltage                           323.6               V       {'icon': 'mdi:solar-power', 'device-class': 'voltage'}
battery_voltage_from_scc                    0.0                 V       {'icon': 'mdi:battery-outline', 'device-class': 'voltage'}
battery_discharge_current                   0                   A       {'icon': 'mdi:battery-negative', 'device-class': 'current'}
is_sbu_priority_version_added               0                   bool
is_configuration_changed                    0                   bool
is_scc_firmware_updated                     0                   bool
is_load_on                                  1                   bool
is_battery_voltage_to_steady_while_charging 0                   bool
is_charging_on                              1                   bool
is_scc_charging_on                          1                   bool
is_ac_charging_on                           0                   bool
battery_voltage_offset_for_fans_on          0                   10mV
eeprom_version                              0                       
pv1_charging_power                          879                 W       {'icon': 'mdi:solar-power', 'device-class': 'power'}
is_charging_to_float                        0                   bool
is_switched_on                              1                   bool
is_dustproof_installed                      0                   bool
Saentist commented 1 year ago

PI30MAX work but not correctly with all commands.

Command: QID - No description found
--------------------------------------------------------------------------------
Parameter Value                 Unit
warning   No definition for command QID in protocol b'PI30MAX'
response    53555355535552ý

Is there a way no mater protocol, commands response values to be decoded?

jblance commented 1 year ago

oh thats a bug I'll get a fix in the next release (its in github now) Also try QSID

Is there a way no mater protocol, commands response values to be decoded?

No, because the protocol 'defines' how to decode, and it differs by inverter and command

Saentist commented 1 year ago
 mpp-solar -p /dev/hidraw2 -c QSID -P PI30MAX
Command: QSID - Device Serial Number inquiry
--------------------------------------------------------------------------------
Parameter     Value             Unit
serial_number 1455355535553555355535

by spec this is:

QSID<cr>: The device serial number inquiry (the length is more than 14)
Computer: QSID<CRC><cr>
Device: (NNXXXXXXXXXXXXXXXXXXXX <CRC><cr>
NN: Serial number valid length, X: Serial number, invalid part is filled as ‘0’, total X is 20. 

MAX Communication Protocol for HV7.2k LV5k V00 20200717.pdf

there mus be a table of devices and it's command capability's something as

mpp-solar -p /dev/hidraw2 -o screen -c QMN#QGMN
Command: QMN - Model Name Inquiry
--------------------------------------------------------------------------------
Parameter  Value                Unit
model_name VMIII-5000
Command: QGMN - General Model Name Inquiry
--------------------------------------------------------------------------------
Parameter          Value                Unit
general_model_name 037

Axpert KS&MKS&V&KING RS232 Protocol 20180104.pdf page 22 QGMN With model and sub model can have nice database of supported protocol and commands.

jblance commented 1 year ago

yes, although need to get all that info and determine which protocol is relevant also this only works for PI30 protocol

jblance commented 1 year ago

yes, although need to get all that info and determine which protocol is relevant also this only works for PI30 protocol

My inverter has

QMN: MKS2-8000
QGMN: 044

Maybe QPI and QGMN together works, eg PI30-044 for my inverter and PI30-037 for yours The page 22 you linked to only has values to 024

Saentist commented 1 year ago

yes, although need to get all that info and determine which protocol is relevant also this only works for PI30 protocol Maybe QPI and QGMN together works, eg PI30-044 for my inverter and PI30-037 for yours The page 22 you linked to only has values to 024

Document is older (year 2018) and not provided to end users. QPI#QMN#QGMN Enable Wiki in repo to make this database, and move documentation there.

jblance commented 1 year ago

Good idea Wiki enabled Doc move a really good idea, will take me some time tho

Saentist commented 1 year ago

Wiki not enabled yet.

QPI (Protocol ID distribution): 30 for PIP series QMN: VMIII QGMN: 023 PIP-5048MK PIP-5048MK 024 PIP-3024MK PIP-3024MK

King_product-application_pdf-20190724092401-8519-pip-gk-mk-protocol.pdf some more

Communication Protocol. PIP-HS_MS_MSX & HYBRID V Communication Protocol.pdf

! NO QID command supported

QMN<cr>: Query model name(Just for Hybrid V Series)
Computer: QMN<CRC><cr>
Inverter: (MMMM-NNNN-BB-VV-SSSS<CRC><cr> if Inverter accepts this command, otherwise,
responds (NAK<cr>
MMMM: model name, NNNN: Rated output VA, BB: Battery voltage, VV: HV/LV, SSSS:
Special flag
Note: The length of MMMM&NNNN&SSSS may be different for different models
1 PIP-HSE 5K
2 PIP-MSE 5K
3 PIP-HSE 3K
4 PIP-MSE 3K
5 PIP-1648MSX (LV)
QGMN
001 PIP-HSE 5K
002 PIP-MSE 5K
003 PIP-HSE 3K
004 PIP-MSE 3K
005 PIP-1648MSX (LV)
006 PIP-2424LV-MSD PIP-2424LV-MSD
007 PIP-2424LV-HS PIP-2424LV-HS
008 PIP2424MSP PIP2424MSP
009 PIP2424HSP PIP2424HSP
010 PIP4024mSP PIP4024MSP
011 PIP4024HSP PIP4024HSP
012 PIP5048MS 64V PIP5048MS 64V
013 PIP5048HS 64V PIP5048HS 64V
014 PIP5048MS PIP5048MS
015 PIP5048HS PIP5048HS
016 ALFA M-5000 ALFA M-5000
017 ALFA P-5000 ALFA P-5000
018 PIP5048MSD/MST PIP5048MSD/MST
jblance commented 1 year ago

Can you still not get into the wiki? Ive added some pages including the start of a protocol recommendations etc page https://github.com/jblance/mpp-solar/wiki/Protocol-Recommendations I will add a command to build an identifier across a bunch of different protocols this built up of a few different commands to make it easier to build the database

jblance commented 1 year ago

Inverter: (MMMM-NNNN-BB-VV-SSSS if Inverter accepts this command, otherwise, responds (NAK MMMM: model name, NNNN: Rated output VA, BB: Battery voltage, VV: HV/LV, SSSS: Special flag

I love how none of the items in the table actually follow this spec

jblance commented 1 year ago

Are there any outstanding issues for this item now? Do you need a 'screen' output without the extra info (like icons)?

Saentist commented 1 year ago

after run one with P30MAX protocol all icons was set and data function with regular P30

Saentist commented 1 year ago

Reopening After restart of HA, again do not want to receive values with icon on P30 protocol. In terminal with screen output all seems OK, but in hassd_mqtt output there is something weird.


https://github.com/jblance/mpp-solar/wiki/Detailed-Usage#list-available-output-processors need correction about hassd_mqtt

jblance commented 1 year ago

the icons are in pi30max only atm - is your inverter not best with pi30max?

Saentist commented 1 year ago

there is in PI30 https://github.com/jblance/mpp-solar/blob/5a90dd874fe137956f7493b0a5721f73eae4c600/mppsolar/protocols/pi30.py#L328 https://github.com/jblance/mpp-solar/blob/5a90dd874fe137956f7493b0a5721f73eae4c600/mppsolar/protocols/pi30.py#L336

jblance commented 1 year ago

yes but way fewer that pi30max - do you use the Q1 command? is the icons working there?

Saentist commented 1 year ago

QID#QDI#QMOD#QPI#QPIGS#QPIRI#QFLAG just this one. 91 valid entities

jblance commented 1 year ago

completed i think - let me know if there is still an issue outstanding