tolwi / hassio-ecoflow-cloud

EcoFlow Cloud Integration for Home Assistant
281 stars 47 forks source link

Ecoflow Power Ocean #251

Open Bombarde16 opened 2 weeks ago

Bombarde16 commented 2 weeks ago

Hello,

I want to use the Integration with Ecoflow Power Ocean. Is there a possibility or will there be an update in near future? Probably I cannot add this device by myself I think.

Thanks a lot!

Markus

foxthefox commented 2 weeks ago

First we have to find the suitable data for integration. I have made a small writup how to connect to the mqtt broker via node-red: https://gist.github.com/foxthefox/11ac35433c228085a8f5e25d5651632a If you can make such a setup, it would be great.

After going to the APP to look at data of the power ocean, something should be logged in debug4 , that should be postet here (needed for displaying values) If there are commands from the APP possible, triggering them would cause messages in debug5, that should be also postet here (needed for commands from HA)

niltrip commented 1 week ago

@foxthefox Output cmdline: jq: parse error: Invalid numeric literal at line 3, column 0 In NodeRed bekomme ich nur "Invalid JSON string" at debug 5 wenn ich die App öffne.

Ich hatte mit der Integration schonmal gespielt. Dabei viel mir auf, das ich keine lesbaren mqtt Werte bekomme (Anmeldung klappt, aber dann Fehler). Ich glaube die Anbindung ist im Moment ähnlich der Powerstream. Wenn ich das richtig verstanden habe kommen dort Bytes an und kein json. Allerdings bin ich bei dem Proto buff stuff ausgestiegen. Wenn man den Pfad für Powerstream erweitert auf das Diagnostic device siehst du es...

Ich helfe gern. Würde gerne meine temporäre Lösung auflösen und gern über eure Integration Daten haben wollen ;-).

foxthefox commented 1 week ago

Immerhin passiert was. Wenn nun kein JSON ankommt, dann im mqtt-in mal auf base64 stellen. Dann kommt auch etwas kryptisches, aber lässt sich dann dekodieren. Einfach mal ein paar unterschiedliche Outputs posten. Damit kann man dann werte interpretieren.

niltrip commented 1 week ago

Screenshot 2024-06-19 220715

Ich habe umgeschaltet auf base64 oder automatische Erkennung. Die große Frage ist ja nur wie man es decodieren kann. Ich habe mir eine Lösung zum Auslesen des Webportals gebaut. Dort kommen die Werte die ich wollte. Hier kenne ich die Codierung nicht. Ich hatte bei der Powerstream etwas von Protobuff gelesen. Das fehlt mir aber der Ansatz...

foxthefox commented 1 week ago

Das sieht doch gut aus. Ich nehme immer gern die base64, weil dort der String direkt kopiert werden kann. Den gibt man in https://protobuf-decoder.netlify.app/ ein und erhält eine decodierung. Es kann mehrere Telegramme in einem stream geben. Erste Hierarchie ist der Header. Erste Stelle sind die Nutzdaten und dann noch cmdSet, cmdFunc… und ggf. auch noch die GeräteID. Die ist bei powerstream drin und beim SHP2 nicht. Sofern die nicht drin sein sollte, dann kannst du den Strieam posten und ich schau ihn mir auch an.

niltrip commented 1 week ago

Hab jetzt aus debug 5 etwas decodiert. property/get_reply : msg.payload : string[3840] Kleinere Pakete kommen alle 10 Sekunden. Das große kommt beim öffnen der App.

Hier mal ein Auszug Screenshot 2024-06-20 103425

Ich kann da noch keine Werte mappen. Der eine String den ich geschwärzt habe scheint eine Seriennummer von meiner Anlage zu sein. Aber wie lese ich die Struktur richtig? Danke.

foxthefox commented 1 week ago

Beim öffnen der App kommt meist ein Gesamtupdate -> „latestQuotas“. Das zyklische sind dann die Daten mit schneller Änderung. Im Bild kann man gut die verschachtelte Struktur erkennen. Die FieldNr ist wichtig für die Definition der Werte. Die Interpretation ist Fummelei und Glückssache. Aber da geht immer etwas, Strom Spannung, Leistung ggf. mit 10er Potenzen multipliziert. Größere Zahlen könnte Energiemenge in, out, Solar etc sein.

foxthefox commented 1 week ago

Wenn Typ ein protobuf ist, dann handelt es sich um eine nächste geschachtelte Struktur. Diese können auch wiederholend sein, z.B. für mehrere Abgänge oder Batterien. 0,1,2 sind meist statuswerte, Fehler sind als Bits codiert, und große Zahlen wie 17xxxxxxxxxx sind höchstwahrscheinlich Zeitangaben im Unixformat.

foxthefox commented 1 week ago

Ich würd auch beim Dekodieren helfen, allerdings weiß leider nicht wie man einen privaten Chat über git machen kann, aber wenn es keine Umstände macht, dann können wir im https://forum.iobroker.net/ Infos austauschen, dort auch als foxthefox.

niltrip commented 1 week ago

Gerne, hab mich gerade mal angemeldet.

Nid01 commented 1 week ago

You could try the newer API https://developer-eu.ecoflow.com/us/document/generalInfo and maybe get the data you are looking for via the endpoints iot-open/sign/device/list and iot-open/sign/device/quota. I have no experience with sharing devices so I guess you have to register yourself for the developer API and wait about a week for approval, so you can try it yourself.

nielshh commented 3 days ago

I also would like to see this integration supporting the PowerOcean DC Fit. Anything I can do to help?

foxthefox commented 2 days ago

You could try the newer API https://developer-eu.ecoflow.com/us/document/generalInfo and maybe get the data you are looking for via the endpoints iot-open/sign/device/list and iot-open/sign/device/quota. I have no experience with sharing devices so I guess you have to register yourself for the developer API and wait about a week for approval, so you can try it yourself.

I am not sure if the new API is of any advantage. At least from the website I can not see that the power ocean is supported and described.

foxthefox commented 2 days ago

I also would like to see this integration supporting the PowerOcean DC Fit. Anything I can do to help?

Right now I have enough information to work with. Thanks to @niltrip I got some captures of the live telegrams as well as a JSON recording from the webportal communication. So I am progressing with mapping the protobuf decodes and the datapoints from the JSON. The first educated guessed schema is:

message bpStaReport {
    optional float bpPwr =1;
    optional int32 bpSoc =2;
    optional int32 bpSoh =3;
    repeated float bpTemp = 5 [packed=true];
    optional int32 bpMaxCellVol = 6;
    optional int32 bpMinCellVol = 7;
    optional int32 bpRunSta = 8;  // 1=RUNSTA_RUN
    optional float bpVol = 9;
    optional float bpAmp = 10;
    optional float bpBusVol =11;
    optional int32 bpErrCode =13;
    repeated float bpCellVol = 14 [packed=true];
    optional int32 bpDsrc =15;
    optional string bpSn = 16;
    optional int32 bpCycles = 17;
    optional int32 bpBalanceState = 18;
    optional float bpHvMosTemp = 19;
    optional float bpLvMosTemp = 20;
    optional float bpPtcTemp= 21;
    optional float bpHtsTemp = 22;
    optional float bpBusNegTemp = 23;
    optional float bpBusPosTemp = 24;
    optional float bpEnvTemp = 25; 
    optional int32 bpAccuChgCap = 26;
    optional int32 bpAccuDsgCap = 27;
    optional int32 bpDesignCap = 28;
    optional int32 bpFullCap = 29;
    optional float bpMaxCellTemp = 30;
    optional float bpMinCellTemp = 31;
    optional float bpMaxMosTemp = 32;
    optional float bpMinMosTemp = 33;
    optional int32 bpBmsFault = 34;
    optional int32 bpEcloundSoc = 35;
    optional int32 bpHeartbeatVer = 36;
    optional int32 bpTimestamp = 37;
    optional float bpRealSoc = 38;
    optional float bpRealSoh = 39;
    optional int32 bpGlobalProtect = 40;
    optional int32 bpDownLimitSoc = 41;
    optional int32 bpUpLimitSoc = 42;
    optional int32 bpActiveCalReqStat = 43;
    optional int32 bpActiveCalRunStat = 44;
    optional int32 moduleProductInfo = 45;
    optional int32 moduleProgramSta = 46;
    optional int32 moduleAplSwVer = 47;
    optional int32 moduleLoaderSwVer = 48;
    optional int32 bmsRunSta = 49; // 1= PB_BMS_STATE_NORMAL
    optional int32 bmsChgDsgSta = 50; // 0=PB_DSG_STATE
    optional int32 dabModSta = 51; // 0= PB_MOD_STA_NORMAL
    optional int32 bpChgSop = 52;
    optional int32 bpDsgSop = 53;
    optional float bpRemainWatth = 54;
    optional float bpTargetSoc = 55;
    optional float bpDiffSoc = 56;
    optional float bpMaxSoc = 57;
    optional float bpMinSoc = 58;
    optional float bpLimitSoc = 59;
    optional float bpCalendarSoh = 60;
    optional float bpCycleSoh = 61;
    optional int32 bpAcRechargeFlag = 62;
    optional int32 bpPtcHeatFlag = 63;
    optional int32 bpPtcExitEvent = 64; // 0=PB_PTC_OT_STATE
    optional int32 bpAccuChgEnergy = 65;
    optional int32 bpAccuDsgEnergy = 66;
    optional float bpPtcTemp2 =67;
    optional int32 bpSysState = 68; // 2=NORMAL_STATE
}
message JTS1_BP_STA_REPORT {
    repeated bpStaReport bpSta = 1;
}
Nid01 commented 2 days ago

You could try the newer API https://developer-eu.ecoflow.com/us/document/generalInfo and maybe get the data you are looking for via the endpoints iot-open/sign/device/list and iot-open/sign/device/quota. I have no experience with sharing devices so I guess you have to register yourself for the developer API and wait about a week for approval, so you can try it yourself.

I am not sure if the new API is of any advantage. At least from the website I can not see that the power ocean is supported and described.

The single axis solar tracker are also not listed in the documentation but I can retrieve the data via the new API, so at least for reading values that still might be an option worth trying.