tolwi / hassio-ecoflow-cloud

EcoFlow Cloud Integration for Home Assistant
309 stars 53 forks source link

River 2 Max #32

Open TrilIiard opened 1 year ago

TrilIiard commented 1 year ago

Thank you so much for the integration of this device, will save me a lot of work in the future. I did the same manually the last months and there are some things ecoflow doesnt tell you about the river 2 Max, it can Charge with only 50 Watts and 75 Watts on AC even if the official App just shows 100 Watt starting. Would be great if you can add these two values so it can be controled through Home assistant.

Thanks

nikowait commented 1 year ago

j'avoue ca serai le top!!!

TrilIiard commented 1 year ago

--Discharge Timer only works for AC Out. Charge timer works correct. I used this to get the correct charge/discharge time of my river 2 max:

and the converted it to a human readable time with:

-- USB (2) Out allways shows 0, all 3 USB A ports are together under USB (1) output.

-- Battery Percentage isnt as acurate as it could be. If you use a float instead of an integer you will get values like 88.9% and not only 88% or 89%.

mqtt: sensor:

-- On my side i made a little online Status icon so i can see if the device is powered on and connected to the Wifi using just this simple:

It takes about 20 seconds after turning the device on and about 60 seconds after turning it off to get the correct state.

Hope some of these are good and can help.

Regards

nikowait commented 1 year ago

--Discharge Timer affiche toujours 0 au lieu du temps restant. La minuterie de charge fonctionne correctement. J'ai utilisé ceci pour obtenir le temps de charge/décharge correct de ma rivière 2 max :

  • name : "River Discharge Time" unique_id : "river_discharge_time" state_topic : "ecoflow/r2m/data" unit_of_measurement : "Std" value_template : > {{ value_json['params']['pd.remainTime'] | flotter }}

et l'a converti en une heure lisible par l'homme avec :

  • capteur:

    • nom : "river_calculated_time :" unique_id : "river_calculated_time" état : >- {% set totalMinutes = states('sensor.river_discharge_time') | int(-1) %} {% set totalHeures = (totalMinutes/60) | int(-1) %} {% set days = (totalHours/24) | int(-1) %} {% set minutes = (totalMinutes%60) %} {% set hours = (totalHours%24) %} {% if totalMinutes == -1 %} Indisponible {% else %} {% if jours > 0 %} {{ jours }}D {% endif %} {{ 0 if hours<10 }}{{ hours }} :{{ 0 if minutes<10 }}{{ minutes }} {% endif %}

-- La sortie USB (2) affiche toujours 0, les 3 ports USB A sont réunis sous la sortie USB (1).

-- Le pourcentage de batterie n'est pas aussi précis qu'il pourrait l'être. Si vous utilisez un flottant au lieu d'un entier, vous obtiendrez des valeurs comme 88,9 % et pas seulement 88 % ou 89 %.

mqtt : capteur : - nom : "River Battery percent" unique_id : "river_battery_percentage" state_topic : "ecoflow/r2m/data" state_class : "measurement" unit_of_measurement : "%" value_template : > {{ value_json['params']['bms_emsStatus .f32LcdShowSoc'] | flotter}}

-- De mon côté, j'ai créé une petite icône d'état en ligne pour que je puisse voir si l'appareil est allumé et connecté au Wifi en utilisant simplement ceci :

  • name : "River State" unique_id : river_state state_topic : "ecoflow/r2m/data" payload_on : "1" payload_off : "0" value_template : >- {{ value_json['data']['online'] | entier(0) }}

Il faut environ 20 secondes après avoir allumé l'appareil et environ 60 secondes après l'avoir éteint pour obtenir l'état correct.

J'espère que certains d'entre eux sont bons et peuvent aider.

Salutations

bonjour excellent mais dites moi vous intégrer ca comment je suis noob

TrilIiard commented 1 year ago

Already fixed some of these, made a fork so i can work on it. If you want to i would be happy if you would use my changes

TrilIiard commented 1 year ago

Entity names

Wouldnt it be nice if the entity id and name would tell you which device the entity is from. Like "sensor.river_2_max_battery_temperature" instead of "sensor.battery_temperature". Some people also have more than one ecoflow device and need to rename every single entity 😉

TrilIiard commented 1 year ago

Type C out allways shows in&output of the type c connection. "pd.typec1Watts" is not only for output "const.TYPEC_1_OUT_POWER". I Was never able to find the correct parameter on my device showing only type c output

TrilIiard commented 1 year ago

If you want to see times between 82 and 99 hours instead of 00:00 you need to change line 48 in sensor.py from

        if ival < 0 or ival > 5000:

to:

        if ival < 0 or ival > 6000:

nikowait commented 1 year ago

thank you I managed to change the time and how and where we change to have the battery stats example 45.8% to have a more precise value with comma

TrilIiard commented 1 year ago

Didnt had time to look into this the last days. Going to next week, after eastern.

I dont know enough to know how to realise it inside this Integration, sorry. Maybe the devs are willing to look into this, shouldnt be that hard because ecoflow Server does allways output the whole value like 21.7%. What we are seeing in the Integration is just rounded up or down. When i made my own configuration without this Integration it was just a question of changing "int" to "float" and change precision inside Home assistant UI.

nikowait commented 1 year ago

Je n'ai pas eu le temps de me pencher dessus ces derniers jours. Passons à la semaine prochaine, après Pâques.

Je n'en sais pas assez pour savoir comment le réaliser à l'intérieur de cette intégration, désolé. Peut-être que les développeurs sont prêts à examiner cela, cela ne devrait pas être si difficile car ecoflow Server produit toujours la valeur totale comme 21,7 %. Ce que nous voyons dans l'intégration est simplement arrondi vers le haut ou vers le bas. Lorsque j'ai créé ma propre configuration sans cette intégration, il s'agissait simplement de changer "int" en "float" et de modifier la précision dans l'interface utilisateur de l'assistant domestique.

jattend de savoir ou tu place ca exactement

name : "River Discharge Time" unique_id : "river_discharge_time" state_topic : "ecoflow/r2m/data" unit_of_measurement : "Std" value_template : > {{ value_json['params']['pd.remainTime'] | flotter }} et l'a converti en une heure lisible par l'homme avec :

capteur :

nom : "river_calculated_time :" unique_id : "river_calculated_time" état : >- {% set totalMinutes = states('sensor.river_discharge_time') | int(-1) %} {% set totalHeures = (totalMinutes/60) | int(-1) %} {% set days = (totalHours/24) | int(-1) %} {% set minutes = (totalMinutes%60) %} {% set hours = (totalHours%24) %} {% if totalMinutes == -1 %} Indisponible {% else %} {% if jours > 0 %} {{ jours }}D {% endif %} {{ 0 if hours<10 }}{{ hours }} :{{ 0 if minutes<10 }}{{ minutes }} {% endif % } -- La sortie USB (2) affiche toujours 0, les 3 ports USB A sont réunis sous la sortie USB (1).

-- Le pourcentage de batterie n'est pas aussi précis qu'il pourrait l'être. Si vous utilisez un flottant au lieu d'un entier, vous résolvez des valeurs comme 88,9 % et pas seulement 88 % ou 89 %.

mqtt : capteur : - nom : "River Battery percent" unique_id : "river_battery_percentage" state_topic : "ecoflow/r2m/data" state_class : "measurement" unit_of_measurement : "%" value_template : > {{ value_json['params']['bms_emsStatus .f32LcdShowSoc'] | flotter}}

-- De mon côté, j'ai créé une petite icône d'état en ligne pour que je puisse voir si l'appareil est allumé et connecté au Wifi en utilisant simplement ceci :

name : "River State" unique_id : river_state state_topic : "ecoflow/r2m/data" payload_on : "1" payload_off : "0" value_template : >- {{ value_json['data']['online'] | entier(0) }}