hassio-ecoflow icon indicating copy to clipboard operation
hassio-ecoflow copied to clipboard

Support for Delta 2

Open maltetgh opened this issue 3 years ago • 29 comments

Hi,

are there any plans/timeline to support Ecoflow Delta 2?

Is there anything I can help with (I have one).

Thank you :)

maltetgh avatar Sep 22 '22 14:09 maltetgh

I also have a Delta 2 with additional battery device and need to use this cool integration. @vwt12eh8 Let me know, if I can help

emmvaueff avatar Sep 23 '22 09:09 emmvaueff

+1 for this ! Tell me if I can help, my delta 2 is on his way.

replayfactory avatar Sep 27 '22 19:09 replayfactory

+1 here as well... Just got a Delta 2 and would also be willing to help/test/etc.

Ne0-Hack3r avatar Oct 01 '22 21:10 Ne0-Hack3r

+1 again. Waiting for the next realease contains DELTA 2 maybe ...

Cricri6799 avatar Oct 01 '22 22:10 Cricri6799

+1 Just got my Delta 2 today!

onkelcommy avatar Oct 04 '22 15:10 onkelcommy

+1

bozman2021 avatar Oct 10 '22 14:10 bozman2021

+1 from me

nerra0pos avatar Oct 14 '22 14:10 nerra0pos

Instead of spamming with +1 could one who already has the Delta 2 on hand test if 8055/tcp is only open in IOT mode or also when the device is connected to an access point? Please state your firmware version and whether it is the latest fw. I would be interested if the local API has also been "locked down" on the Delta 2, same as with the other Deltas. #60

nxxxse avatar Oct 14 '22 20:10 nxxxse

Instead of spamming with +1 could one who already has the Delta 2 on hand test if 8055/tcp is only open in IOT mode or also when the device is connected to an access point? Please state your firmware version and whether it is the latest fw. I would be interested if the local API has also been "locked down" on the Delta 2, same as with the other Deltas. #60

Delta 2 IOT is always on, no button, and all TCP ports are closed

Cricri6799 avatar Oct 14 '22 21:10 Cricri6799

Instead of spamming with +1 could one who already has the Delta 2 on hand test if 8055/tcp is only open in IOT mode or also when the device is connected to an access point? Please state your firmware version and whether it is the latest fw. I would be interested if the local API has also been "locked down" on the Delta 2, same as with the other Deltas. #60

If you think there is a way to bypass the restrictions of the latest Delta 2 update, I can try to get one to work on.

Otherbright avatar Oct 14 '22 22:10 Otherbright

Instead of spamming with +1 could one who already has the Delta 2 on hand test if 8055/tcp is only open in IOT mode or also when the device is connected to an access point? Please state your firmware version and whether it is the latest fw. I would be interested if the local API has also been "locked down" on the Delta 2, same as with the other Deltas. #60

Delta 2 IOT is always on, no button, and all TCP ports are closed

Confirmed. With Delta Pro I can telnet to 8055 and get a stream of data. With Delta 2, I cannot.

Ne0-Hack3r avatar Oct 16 '22 07:10 Ne0-Hack3r

Sadly I let their support know that I'll return my new Delta Pro as they have chosen to close the comms port. For me it is vital to get/send data from the unit. Without it any integration is kind of crude.

EasyEl avatar Oct 16 '22 08:10 EasyEl

Sadly I let their support know that I'll return my new Delta Pro as they have chosen to close the comms port. For me it is vital to get/send data from the unit. Without it any integration is kind of crude.

Is the service the same when using bluetooth (except that you have to have another bluetooth device in range)?

Otherbright avatar Oct 16 '22 14:10 Otherbright

I got the API data from ECOFLOW for my Delta 2 and it works:

curl -X GET
https://api.ecoflow.com/iot-service/open/api/device/queryDeviceQuota?sn=XXXXX -H 'Content-Type: application/json'
-H 'appKey: xxx'
-H 'secretKey: xxx'

It shows the following output: object code: "0" message: "Success" data: object soc: 74 remainTime: -5939 wattsOutSum: 0 wattsInSum: 0

mattenausohz avatar Oct 17 '22 07:10 mattenausohz

Have you that as well to integrate to HA (in confguration.yaml). You need to request appKey and secretKey from Ecoflow. Please note that there is a bug with soc with an extra battery, the return value is only of the main one, not the average of the 2.

 - platform: rest
   unique_id: ecoflow_time_left
   unit_of_measurement: "min"
   device_class: duration
   name: Ecoflow Time Left
   resource: https://api.ecoflow.com/iot-service/open/api/device/queryDeviceQuota?sn=xxx
   value_template: '{{ "%.1f" | format(value_json.data.remainTime)}}'
   method: GET
   headers:
     content_type:  'application/json'
     appKey: 'xxx'
     secretKey: 'xxx'

 - platform: rest
   unique_id: ecoflow_watt_out
   unit_of_measurement: "W"
   device_class: power
   name: Ecoflow Watt Out
   resource: https://api.ecoflow.com/iot-service/open/api/device/queryDeviceQuota?sn=xxx
   value_template: '{{ "%.1f" | format(value_json.data.wattsOutSum)}}'
   method: GET
   headers:
     content_type:  'application/json'
     appKey: 'xxx'
     secretKey: 'xxx'

 - platform: rest
   unique_id: ecoflow_watt_in
   unit_of_measurement: "W"
   device_class: power
   name: Ecoflow Watt In
   resource: https://api.ecoflow.com/iot-service/open/api/device/queryDeviceQuota?sn=xxx
   value_template: '{{ "%.1f" | format(value_json.data.wattsInSum)}}'
   method: GET
   headers:
     content_type:  'application/json'
     appKey: 'xxx'
     secretKey: 'xxx'

 - platform: rest
   unique_id: ecoflow_soc
   unit_of_measurement: "%"
   device_class: battery
   name: Ecoflow State of Charge
   resource: https://api.ecoflow.com/iot-service/open/api/device/queryDeviceQuota?sn=xxx
   value_template: '{{ "%.1f" | format(value_json.data.soc)}}'
   method: GET
   headers:
     content_type:  'application/json'
     appKey: 'xxx'
     secretKey: 'xxx'

How it looks (minutes have been converted to H:M:

Screenshot 2022-10-17 at 09 42 48

raphaelsavina avatar Oct 17 '22 07:10 raphaelsavina

@raphaelsavina I think your use of the REST Platform is very unfriendly to the Ecoflow API.

If you would use RESTful (https://www.home-assistant.io/integrations/rest/) I believe the same sensors/result could be archived with just one API call. For each update your HA instance will execute four API calls!

maltetgh avatar Oct 18 '22 10:10 maltetgh

I agree - e.g. something like this

sensor:
  - platform: rest
    name: ecoflow_xxxx
    resource: https://api.ecoflow.com/iot-service/open/api/device/queryDeviceQuota?sn=xxxxxxxxxxxxxxx
    scan_interval: 5
    timeout: 30
    authentication: digest
    headers:
      User-Agent: Home Assistant
      Content-Type: application/json
      Accept: application/json
      appKey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      secretKey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    json_attributes_path: '$.data'
    json_attributes:
      - soc
      - remainTime
      - wattsOutSum
      - wattsInSum    
template:
  - sensor:
    - name: "EcoFlow xxxx - State of charge"
      unit_of_measurement: "min"
      device_class: battery
      state: >
         {% if state_attr('sensor.ecoflow_xxx', 'soc') == None %}
           0
         {% else %}
           {{ state_attr('sensor.ecoflow_xxx', 'soc') }}
         {% endif %}
  - sensor:
    - name: "EcoFlow xxx - Remain time"
      unit_of_measurement: "%"
      device_class: duration
      state: >
         {% if state_attr('sensor.ecoflow_xxx', 'remainTime') == None %}
           0
         {% else %}
           {{ state_attr('sensor.ecoflow_xxx', 'remainTime') }}
         {% endif %}
  - sensor:
    - name: "EcoFlow xxx - Watts Out Sum"
      unit_of_measurement: "W"
      device_class: power
      state: >
         {% if state_attr('sensor.ecoflow_xxx', 'wattsOutSum') == None %}
           0
         {% else %}
           {{ state_attr('sensor.ecoflow_xxx', 'wattsOutSum') }}
         {% endif %}
  - sensor:
    - name: "EcoFlow xxx - Watts In Sum"
      unit_of_measurement: "W"
      device_class: power
      state: >
         {% if state_attr('sensor.ecoflow_xxx', 'wattsInSum') == None %}
           0
         {% else %}
           {{ state_attr('sensor.ecoflow_xxx', 'wattsInSum') }}
         {% endif %}

Jenda987 avatar Oct 18 '22 10:10 Jenda987

Thank you @maltetgh and @Jenda987 for the tip! I've updated that in my HA. Though one would argue that hammering Ecoflow APi could make them give us access locally to our Delta2 (or close the API completly!).

raphaelsavina avatar Oct 18 '22 12:10 raphaelsavina

Can you only read or also write to that API? Especially setting the AC in Watts like in the App?

EasyEl avatar Oct 18 '22 12:10 EasyEl

Can you only read or also write to that API? Especially setting the AC in Watts like in the App?

Nope, only read, sadly...

raphaelsavina avatar Oct 18 '22 12:10 raphaelsavina

i have made like this (inspired by this thread)

sensor:

  • platform: rest name: ecoflow_xxxxxxxxxxxxxxxxxx resource: https://api.ecoflow.com/iot-service/open/api/device/queryDeviceQuota?sn=xxxxxxxxxxxxxxxxxx scan_interval: 5 timeout: 30 authentication: digest headers: User-Agent: Home Assistant Content-Type: application/json Accept: application/json appKey: yyyyyyyyyyyyyyyyyyyy secretKey: zzzzzzzzzzzzzzzzzzzzz json_attributes_path: '$.data' json_attributes:
    • soc
    • remainTime
    • wattsOutSum
    • wattsInSum

template: - sensors: ecoflow_xxxxxxxxxxxxxxxxxx_in: unique_id: 'ecoflow_xxxxxxxxxxxxxxxxxx_in' device_class: power unit_of_measurement: "W" value_template: '{{int(state_attr("sensor.ecoflow_xxxxxxxxxxxxxxxxxx", "wattsInSum"))}}' ecoflow_xxxxxxxxxxxxxxxxxx_out: unique_id: 'ecoflow_xxxxxxxxxxxxxxxxxx_out' device_class: power unit_of_measurement: "W" value_template: '{{int(state_attr("sensor.ecoflow_xxxxxxxxxxxxxxxxxx", "wattsOutSum"))}}' ecoflow_xxxxxxxxxxxxxxxxxx_remain: unique_id: 'ecoflow_xxxxxxxxxxxxxxxxxx_remain' device_class: duration unit_of_measurement: "min" value_template: '{{int(state_attr("sensor.ecoflow_xxxxxxxxxxxxxxxxxx", "remainTime"))}}' ecoflow_xxxxxxxxxxxxxxxxxx_bat: unique_id: 'ecoflow_xxxxxxxxxxxxxxxxxx_bat' device_class: battery unit_of_measurement: "%" value_template: '{{int(state_attr("sensor.ecoflow_xxxxxxxxxxxxxxxxxx", "soc"))}}'

    ecoflow_delta_solar_in:
        unique_id: 'ecoflow_delta_solar_in'
        value_template: '{% if states("switch.sonoff_10013a7d14") == "on" %}0{% else %}{{ states("sensor.ecoflow_xxxxxxxxxxxxxxxxxx2_in")}}{% endif %}'
        device_class: power
        unit_of_measurement: "W"
    ecoflow_delta_power_in:
        unique_id: 'ecoflow_delta_power_in'
        value_template: '{% if states("switch.sonoff_10013a7d14") == "on" %}{{ states("sensor.ecoflow_xxxxxxxxxxxxxxxxxx_in")}}{% else %}0{% endif %}'
        device_class: power
        unit_of_measurement: "W"

then if my sonoff plug is on (power from grid) i push watts in in power grid fake sensor else in solar fake sensor by this way i can have a "solar input" like value , if someone have an idea to make a fake sensor (calculated) to have a kwh value (input/output, solar/grid) to let us use it in energy tab it could be great

beboxos avatar Oct 19 '22 06:10 beboxos

WhatsApp Image 2022-10-19 at 15 11 31

beboxos avatar Oct 19 '22 13:10 beboxos

WhatsApp Image 2022-10-19 at 15 11 31

Could you send me your yaml code for using EF api, because with my delta 2 the sources above do not work? Thanks

Cricri6799 avatar Oct 19 '22 13:10 Cricri6799

to put in configuration.yml.txt

this is for configuration.yml for visual i use a custom plugin (on HACS) custom tesla style power card

with code below (serial removed replaced by xxx)

type: custom:tesla-style-solar-power-card show_w_not_kw: 1 speed_factor: 0.2 hide_inactive_lines: 1 show_gap: true change_house_bubble_color_with_flow: 0 energy_flow_diagramm_line_factor: 2 battery_extra_entity: sensor.ecoflow_xxx_bat grid_to_battery_entity: sensor.ecoflow_delta_power_in generation_to_battery_entity: sensor.ecoflow_delta_solar_in battery_to_house_entity: sensor.ecoflow_xxx_out generation_extra_entity: null grid_extra_entity: switch.sonoff_xxx

beboxos avatar Oct 19 '22 13:10 beboxos

to put in configuration.yml.txt

this is for configuration.yml for visual i use a custom plugin (on HACS) custom tesla style power card

with code below (serial removed replaced by xxx)

type: custom:tesla-style-solar-power-card show_w_not_kw: 1 speed_factor: 0.2 hide_inactive_lines: 1 show_gap: true change_house_bubble_color_with_flow: 0 energy_flow_diagramm_line_factor: 2 battery_extra_entity: sensor.ecoflow_xxx_bat grid_to_battery_entity: sensor.ecoflow_delta_power_in generation_to_battery_entity: sensor.ecoflow_delta_solar_in battery_to_house_entity: sensor.ecoflow_xxx_out generation_extra_entity: null grid_extra_entity: switch.sonoff_xxx

Works, tks you.

Cricri6799 avatar Oct 19 '22 21:10 Cricri6799

I've implemented basic support for Delta 2 and River 2 Max.

tolwi avatar Jan 24 '23 09:01 tolwi

I've implemented basic support for Delta 2 and River 2 Max.

I can confirm this working on my Delta 2

ALERTua avatar Jan 24 '23 09:01 ALERTua

Fantastic! Works perfectly with my Delta 2. Thank you for the super job.

mimangold avatar Feb 09 '23 20:02 mimangold

After send disable wifi mqqt command, this ports opening. Any wrong command (agressive scan) - closed. + private message on mastadon :)

PORT STATE SERVICE VERSION 340/tcp filtered unknown 1062/tcp filtered veracity 1216/tcp filtered etebac5 1600/tcp filtered issd 2030/tcp filtered device2 3333/tcp filtered dec-notes 4006/tcp filtered pxc-spvr 5051/tcp filtered ida-agent 5432/tcp filtered postgresql 6543/tcp filtered mythtv 9968/tcp filtered unknown 10002/tcp filtered documentum 10617/tcp filtered unknown 50000/tcp filtered ibm-db2 52869/tcp filtered unknown

  • 9110 port

ipalchuk avatar Mar 23 '23 13:03 ipalchuk