Skip to content

Commit

Permalink
feat: add support for Sungrow inverters. closes #547
Browse files Browse the repository at this point in the history
locale: add Ukraine translation. closes #535
  • Loading branch information
slipx06 committed Oct 30, 2024
1 parent e709e1d commit 706f6f1
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 5 deletions.
8 changes: 4 additions & 4 deletions dist/sunsynk-power-flow-card.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sunsynk-power-flow-card",
"version": "5.3.2",
"version": "5.4.0",
"description": "A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.",
"main": "sunsynk-power-flow-card.js",
"scripts": {
Expand Down
55 changes: 55 additions & 0 deletions src/inverters/brands/sungrow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import {InverterSettingsDto, InverterStatus} from '../dto/inverter-settings.dto';
import {InverterModel} from '../../types';
import {localize} from '../../localize/localize';

/* Sungrow Status Codes
* source https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant
*
* Running
* Off-grid Charge
* Update Failed
* Maintain mode
* Forced mode
* Off-grid mode
* Un-Initialized
* Initial Standby
* Shutdown
* Standby
* Emergency Stop
* Startup
* AFCI self test shutdown
* Intelligent Station Building Status
* Safe Mode
* Open Loop
* Restarting
* External EMS mode
* Fault
* Stop
* De-rating Running
* Dispatch Run
* Warn Running
* Unknown
*/


export class Sungrow extends InverterSettingsDto {
brand = InverterModel.Sungrow;
statusGroups: InverterStatus = {
standby: {states: ['standby','initial standby'], color: 'blue', message: localize('common.standby')},
selftest: {states: ['startup'], color: 'blue', message: localize('common.selftest')},
running: { states: ['running'], color: 'green', message: localize('common.running')},
offgrid: {states:['off-grid mode'], color: 'orange', message: localize('common.offgrid')},
externalcontrol: {states:['external ems mode','forced mode'], color: 'green', message: localize('common.externalcontrol')},
shutdown: {states: ['shutdown','restarting','afci self test shutdown'], color: 'red', message: localize('common.shutdown')},
normalstop: {states: ['stop'], color: 'yellow', message: localize('common.normalstop')},
alarm: {states: ['warn running'],color: 'orange', message: localize('common.alarm')},
sustain: {states:['de-rating running'], color: 'red', message: localize('common.sustain')},
fault: {
states: ['update failed', 'maintain mode','emergency stop','fault','unknown','un-initialized','open loop','safe mode','dispatch run'],
color: 'red',
message: localize('common.fault')
},

};
image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAABPCAYAAACgaDbUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAA/JSURBVHhezVxdjCRVFb5V1dMzs7s4LCvD6v7MbCJBH4QEFBJETUiMK8RE9AWDxsQAEhPNCg8YEhMTQqI8YEzUB3/ioxoTSHgy/BiDolk2JgbXzSK47g8CK7A77DI7M9314/edc0/Vrerqnu5hlvj1nK5b55577jn3nHvrVnXtRg44cuRIlGf5BztJspC7wpFZFEVUOHcJipcWZOUuRhX4KQ4F5SPwKYYvl0jBZWwJEg0gyruoyFmSrwAxxRJIJBTKi1xsET4QOXaRp3GUQBHOCvDReUZhnIkQLUEpK/IiiooLcRL/7WM3Xf88a6Ljx49Haa//4GXbt98/NTXVoXnqADpDMaaRKKAtFYBPLgXga57DIPYBWfgE46QdQTktsa13KuIR+qQTLUYRjIZkFMFHMjxi8kHSPY48j3PKUKu113IM34s4dmm/10NX9+3Z+74fRYcPH963c+fOf850ux0zChbKSORoxE5pCP0xw0uCRA5ZdsYjqdQhBqie0jEB+TSMRtMhNTKKGCnlqz/4irVOgiiOcZilpgKdS9gA9ahBV6/3+2v74vn5+XS6O92hqhKiMBZBU1ONfwWtG+QrVMcgrJ+wHXnD+LSCaYiZYCpDgkOcKSJD+SK+PE462+Ikii25h4AdIc8kjS4OaACNtgwlMIP5DeIRZsOBhKH03JBqgJ1Zlk3RzXIqisfiddCD8azYQCMx2kTWRVubNp6YyYqA6KvklfjPE7qaSWKXfuhEBmvAMR/mgF3Njeooev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mGOu6886tfmUrym/hqJGY1dt4dN3/5jr/fdc/th7xIDd994DvL+dLZoo8BlJ8VZC4zFVP3yurS6c/ceoP8XwLrYSBiho9cd+P9J189970oWn3rlk9//NoXXzp1/ZEXjv8qwsz83Gc/cSNuFrY++viTT3O/efU1e7/2h6ee/qlv+o7wzDPPdA4c+NZDvV56BW+rEHeMSNrJMM/m5uaeO/jcs4940ZEY6tjBQ6c6jz/x9DW7Fve+/vU7bj756hu9+KGHf3Lt/MLC6r133fqP54+ecL9+7HfXrK10Zm/7ws2H9n/0qslviS8anPsfUHkXqz/biXsAAAAASUVORK5CYII='
}
3 changes: 3 additions & 0 deletions src/inverters/inverter-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {Azzurro} from './brands/azzurro';
import {MPPSolar} from './brands/mpp-solar';
import {SMASolar} from './brands/sma-solar';
import {E3dc} from './brands/e3dc';
import {Sungrow} from './brands/sungrow';



Expand Down Expand Up @@ -73,6 +74,8 @@ export class InverterFactory {
return new MPPSolar();
case InverterModel.SMASolar:
return new SMASolar();
case InverterModel.Sungrow:
return new Sungrow();
case InverterModel.Sunsynk:
default:
return new Sunsynk()
Expand Down
Loading

0 comments on commit 706f6f1

Please sign in to comment.