DAB E.Sybox pump sensors via DAB DConnect

[Edit: the custom integration for DAB Pumps is now the preferred solution over the scripts I initially published under this community topic. See ankohanse/hass-dab-pumps: Home Assistant Custom Integration for DAB Pumps via the DConnect service (github.com)]

Could not find any informatio here about connecting to a DAB E.Sybox pump so publishing my solution here so it may help others.

This pump does not have wifi, zigbee or mqtt by itself, but it can communicate to a DAB specific app and website if you fork out some money for a communication module (DAB DConnect Box2).

I reverse engineered the communication between the box2 and the website to learn how to retrieve data from my pump. Here is my initial solution (will post updates if I make improvements to it):

  1. Under ‘/homeassistant’ (aka ‘/config’), create new folders ‘data’ and ‘shell’
  2. In the new ‘shell’ folder, create a new file ‘dab_dconnect_get.sh’ with contents:\
#!bash
data_usr='username=<dab portal username>'
data_pwd='password=<dab portal password'
login_htm=$(curl -j -c data/dab_cookie1.txt -k -s -L 'https://dconnect.dabpumps.com/')
login_url=$(echo "$login_htm" | grep -E -o 'action=(.*) method=' | sed -e 's/^.*action="//g' -e 's/" method=$//g' -e 's/&amp;/\&/g')

login_res=$(curl -b data/dab_cookie1.txt -c data/dab_cookie1.txt -k -s -L $login_url -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode $data_usr --data-urlencode $data_pwd)
data_inst=$(curl -b data/dab_cookie1.txt -c data/dab_cookie1.txt -k -s -L 'https://dconnect.dabpumps.com/api/v1/gui/installation/list?lang=en')
data_box2=$(curl -b data/dab_cookie1.txt -c data/dab_cookie1.txt -k -s -L 'https://dconnect.dabpumps.com/dumstate/012AB-CDEFG-HIJKL-MNOPQ-RSTUV-WXYZA-BCDE9/')
data_pump=$(curl -b data/dab_cookie1.txt -c data/dab_cookie1.txt -k -s -L 'https://dconnect.dabpumps.com/dumstate/012AB-CDEFG-HIJKL-MNOPQ-RSTUV-WXYZA-BCDE901/')

echo "$data_inst" | jq 'walk(if type=="string" and test("^{.*}$") then .|fromjson else . end)' > /config/data/dab_dconnect_installations.json
echo "$data_box2" | jq 'walk(if type=="string" and test("^{.*}$") then .|fromjson else . end)' > /config/data/dab_dconnect_box2.json
echo "$data_pump" | jq 'walk(if type=="string" and test("^{.*}$") then .|fromjson else . end)' > /config/data/dab_dconnect_esybox.json`

Note: lookup the correct identifiers for Box2 controller and E.Sybox pump from the installations json (/config/data/dab_dconnect_installations.json) once the script has run once and adapt the above commands. Look for strings in format ‘012AB-CDEFG-HIJKL-MNOPQ-RSTUV-WXYZA-BCDE9’

  1. In ‘configuration.yaml’, add:
automation: !include automations.yaml
command_line: !include command_line.yaml
shell_command: !include shell_commands.yaml
template: !include templates.yaml
utility_meter: !include utility_meters.yaml
  1. In ‘shell_commands.yaml’, add:
dab_dconnect_get: bash /config/shell/dab_dconnect_get.sh
  1. In ‘automations.yaml’, add:
- id: '1700385045144'
  alias: DAB DConnect Get Data
  description: ''
  trigger:
  - platform: time_pattern
    minutes: /5
  condition: []
  action:
  - service: shell_command.dab_dconnect_get
    data: {}
    response_variable: dab_dconnect_get_response
  mode: single
  1. In ‘command_line.yaml’, add:
###
### DAB DConnect
###
- sensor:
    name: "DAB DConnect Installations"
    unique_id: "dab_dconnect_installations"
    scan_interval: 60
    command: "cat /config/data/dab_dconnect_installations.json"
    value_template: "{{ value_json.stats.start }}"
    json_attributes:
      - res
      - stats
      - data

- sensor:
    name: "DAB DConnect Box2"
    unique_id: "dab_dconnect_box2"
    scan_interval: 60
    command: "cat /config/data/dab_dconnect_box2.json"
    value_template: "{{ value_json.lastreceived }}"
    json_attributes:
      - res
      - result
      - status_validity
      - statusts
      - lastreceived
      - refresh
      - servertime
      - status

- sensor:
    name: "DAB DConnect E.Sybox Pump"
    unique_id: "dab_dconnect_esybox"
    scan_interval: 60
    command: "cat /config/data/dab_dconnect_esybox.json"
    value_template: "{{ value_json.lastreceived }}"
    json_attributes:
      - res
      - result
      - status_validity
      - statusts
      - lastreceived
      - refresh
      - servertime
      - status
  1. In ‘templates.yaml’, add:
###
### Cold Water
###
- sensor:
    name: "Cold Water meter total"
    unique_id: "cold_water_meter_total"
    device_class: water
    icon: mdi:water
    state_class: total_increasing
    unit_of_measurement: 'm³'
    state: >-
      {{ state_attr('sensor.dab_dconnect_esybox', 'status').FCt_Total_Delivered_Flow_mc | float / 1000.0 }}
    attributes:
      updates: "{{ state_attr('sensor.dab_dconnect_esybox', 'statusts') }}"

- sensor:
    name: "Cold Water flow"
    unique_id: "cold_water_flow" 
    device_class: water
    icon: mdi:water
    state_class: measurement
    unit_of_measurement: 'l'
    state: >-
      {{ state_attr('sensor.dab_dconnect_esybox', 'status').VF_FlowLiter | float(0) / 10.0 }}
    attributes:
      updates: "{{ state_attr('sensor.dab_dconnect_esybox', 'statusts') }}"

- sensor:
    name: "Cold Water pressure"
    unique_id: "cold_water_pressure"
    device_class: water
    icon: mdi:water
    state_class: measurement
    unit_of_measurement: 'bar'
    state: >-
      {{ state_attr('sensor.dab_dconnect_esybox', 'status').VP_PressureBar | float(0) / 10.0 }}
    attributes:
      updates: "{{ state_attr('sensor.dab_dconnect_esybox', 'statusts') }}"

- sensor:
    name: "Cold Water pressure target"
    unique_id: "cold_water_pressure target"
    device_class: water
    icon: mdi:water
    state_class: measurement
    unit_of_measurement: 'bar'
    state: >-
      {{ state_attr('sensor.dab_dconnect_esybox', 'status').SP_SetpointPressureBar | float(0) / 10.0 }}
    attributes:
      updates: "{{ state_attr('sensor.dab_dconnect_esybox', 'statusts') }}"

- sensor:
    name: "DAB DConnect E.Sybox Temperature"
    unique_id: "dab_dconnect_esybox_temperature"
    device_class: temperature
    state_class: measurement
    unit_of_measurement: '°C'
    state: >
      {{ state_attr('sensor.dab_dconnect_esybox', 'status').TE_HeatsinkTemperatureC | int }}
      
- sensor:
    name: "DAB DConnect E.Sybox Power On Hours"
    unique_id: "dab_dconnect_esybox_power_on_hours"
    unit_of_measurement: 'h'
    state_class: total_increasing
    state: >
      {{ state_attr('sensor.dab_dconnect_esybox', 'status').HO_PowerOnHours | int }}
      
- sensor:
    name: "DAB DConnect E.Sybox Run Hours"
    unique_id: "dab_dconnect_esybox_run_hours"
    unit_of_measurement: 'h'
    state_class: total_increasing
    state: >
      {{ state_attr('sensor.dab_dconnect_esybox', 'status').HO_PumpRunHours | int }}
      
- sensor:
    name: "DAB DConnect E.Sybox Starts"
    unique_id: "dab_dconnect_esybox_starts"
    state_class: total_increasing
    state: >
      {{ state_attr('sensor.dab_dconnect_esybox', 'status').StartNumber | int }}
      
- binary_sensor:
    name: "DAB DConnect E.Sybox Pump Running"
    unique_id: "dab_dconnect_esybox_pump_running"
    state: >
      {% set status = state_attr('sensor.dab_dconnect_esybox', 'status').PumpStatus | int %}
      {{ 'on' if status==1 else 'off' }}

- sensor:
    name: "DAB DConnect E.Sybox Pump Status"
    unique_id: "dab_dconnect_esybox_pump_status"
    state: >
      {% set status = state_attr('sensor.dab_dconnect_esybox', 'status').SystemStatus | int %}
      {% set errorcode = "Error" + state_attr('sensor.dab_dconnect_esybox', 'status').LatestError %}
      {% set errorlabel = "Error" + state_attr('sensor.dab_dconnect_esybox', 'status').LastErrorOccurrency %}
      {% set errortext =  state_attr('sensor.dab_dconnect_esybox', 'status')[errorlabel] %}
      {% if status==0 %}
        OK
      {% else %}
        Error {{errorcode}} ({{ errorlabel }}: {{errortext}})
      {% endif %}      
  1. In ‘utility_meters.yaml’, add:
###
### Cold Water
###
cold_water_meter_daily:
  name: "Cold Water meter daily"
  unique_id: cold_water_meter_daily
  source: sensor.cold_water_meter_total
  cycle: daily
  periodically_resetting: false

cold_water_meter_monthly:
  name: "Cold Water meter monthly"
  unique_id: cold_water_meter_monthly
  source: sensor.cold_water_meter_total
  cycle: monthly
  periodically_resetting: false

cold_water_meter_yearly:
  name: "Cold Water meter yearly"
  unique_id: cold_water_meter_yearly
  source: sensor.cold_water_meter_total
  cycle: yearly
  periodically_resetting: false
2 Likes

looking forward to trying this. I use alot of these pumps. The d connect box should allow for modbus communication as well. I have heard that They may be offering an open API.

This looks really amazing.
Thank you for sharing such detailed explanation.

Great!! thank you, Do you think that something like this will work for an Esybox mini?
This does not require a Dconnect box2

This is amazing.
Thank you so much <3

I was able to adjust for my configuration, using only the pump.
It’s working like a charm!

@lefgrter I see the Esybox mini listed amonst supported devices for the DConnect web portal, so I would expect this to work for this device.

Note that you should then connect it via the DConnect web portal/app, and not via the DAB Live app.

@Coldness00 Was the system you got working in Home Assistant via my solution with a normal Esybox or a Esybox.Mini?

That is correct. Also, I noticed that I cannot access it via DABLive on my phone anymore. FYI: Esybox3mini.
I just removed the links and template related to esybox and I renamed the sensors.
I learned thank to you to add any sensor I want from the file downloaded. Perfect.

Do you know by any change the refresh rate of the data and if we perform as much request as we want?

@ankoh Wow Thank you.
I have connected it to the portal and I needed a solution to integrate it to HA:)

@Coldness00 As my knowledge on setting this up is limited, is there any chance to help me edit what is needed for integrate my Esybox3mini as well? I would appreciate it :pray:

Hello, of course, I ll send you a tuto like tomorrow :slight_smile:

1 Like

@Coldness00 In my case, the DConnect Box2 has a sample rate of 20 seconds (bust can also be configured to 5 seconds). I do not know what sample rate the ESybox.mini would use by default.

As I do not need that much data, I setup the Home Assistant ‘DAB DConnect Get Data’ automation to only run once every 5 minutes. But you can easily change that to run more often. There is a chance though that the Web requests will just return cached information if you run them too often. I guess you can only try it to see if it does what you want.

Hello my friend, thank you for your willing to help. In the end I have manged to make it work. Everything is showing in my home assistant server like a charm. Thank you all for your time spent to share your work.

1 Like

Hello Coldness00.

Could you share the tuto with me too? Have tha same Esybox3mini as lefgrter.

1 Like

You follow same procedure however in the code do as follow:
in dab_dconnect_get

#!bash
data_usr='[email protected]'
data_pwd='password=whatyouwanttheretobe'
login_htm=$(curl -j -c data/dab_cookie1.txt -k -s -L 'https://dconnect.dabpumps.com/')
login_url=$(echo "$login_htm" | grep -E -o 'action=(.*) method=' | sed -e 's/^.*action="//g' -e 's/" method=$//g' -e 's/&amp;/\&/g')

login_res=$(curl -b data/dab_cookie1.txt -c data/dab_cookie1.txt -k -s -L $login_url -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode $data_usr --data-urlencode $data_pwd)
data_inst=$(curl -b data/dab_cookie1.txt -c data/dab_cookie1.txt -k -s -L 'https://dconnect.dabpumps.com/api/v1/gui/installation/list?lang=en')
data_box2=$(curl -b data/dab_cookie1.txt -c data/dab_cookie1.txt -k -s -L 'https://dconnect.dabpumps.com/dumstate/AAAAA-BBBBB-QQQQQ-EEEEE-GGGGG-DDCFF-DDDDD')

echo "$data_inst" | jq 'walk(if type=="string" and test("^{.*}$") then .|fromjson else . end)' > /config/data/dab_dconnect_installations.json
echo "$data_box2" | jq 'walk(if type=="string" and test("^{.*}$") then .|fromjson else . end)' > /config/data/dab_dconnect_box2.json

then in templates.yaml

  ###
  ### Cold Water and pump
  ###
  - sensor:
    - name: "Cold Water meter total"
      unique_id: "cold_water_meter_total"
      device_class: water
      icon: mdi:water
      state_class: total_increasing
      unit_of_measurement: 'm³'
      state: >-
        {{ state_attr('sensor.dab_dconnect_box2', 'status').FCt_Total_Delivered_Flow_mc | float / 1000.0 }}
      attributes:
        updates: "{{ state_attr('sensor.dab_dconnect_box2', 'statusts') }}"

  - sensor:
    - name: "Cold Water flow"
      unique_id: "cold_water_flow" 
      device_class: water
      icon: mdi:water-pump
      state_class: measurement
      unit_of_measurement: 'l/min'
      state: >-
        {{ state_attr('sensor.dab_dconnect_box2', 'status').VF_FlowLiter | float(0) / 10.0 }}
      attributes:
        updates: "{{ state_attr('sensor.dab_dconnect_box2', 'statusts') }}"

  - sensor:
    - name: "Cold Water pressure"
      unique_id: "cold_water_pressure"
      device_class: water
      icon: mdi:gauge
      state_class: measurement
      unit_of_measurement: 'bar'
      state: >-
        {{ state_attr('sensor.dab_dconnect_box2', 'status').VP_PressureBar | float(0) / 10.0 }}
      attributes:
        updates: "{{ state_attr('sensor.dab_dconnect_box2', 'statusts') }}"

  - sensor:
    - name: "Cold Water pressure target"
      unique_id: "cold_water_pressure target"
      device_class: water
      icon: mdi:gauge-full
      state_class: measurement
      unit_of_measurement: 'bar'
      state: >-
        {{ state_attr('sensor.dab_dconnect_box2', 'status').SP_SetpointPressureBar | float(0) / 10.0 }}
      attributes:
        updates: "{{ state_attr('sensor.dab_dconnect_box2', 'statusts') }}"

  - sensor:
    - name: "Cold Water temperature"
      unique_id: "cold_water_temperature"
      device_class: water
      icon: mdi:thermometer-water
      state_class: measurement
      unit_of_measurement: '°C'
      state: >-
        {{ state_attr('sensor.dab_dconnect_box2', 'status').TE_HeatsinkTemperatureC | float(0) / 10.0 }}
      attributes:
        updates: "{{ state_attr('sensor.dab_dconnect_box2', 'statusts') }}"

then in command_line.yaml

###
### DAB DConnect
###
- sensor:
    name: "DAB DConnect Installations"
    unique_id: "dab_dconnect_installations"
    scan_interval: 10
    command: "cat /config/data/dab_dconnect_installations.json"
    value_template: "{{ value_json.stats.start }}"
    json_attributes:
      - res
      - stats
      - data

- sensor:
    name: "DAB DConnect Box2"
    unique_id: "dab_dconnect_box2"
    scan_interval: 5
    command: "cat /config/data/dab_dconnect_box2.json"
    value_template: "{{ value_json.lastreceived }}"
    json_attributes:
      - res
      - result
      - status_validity
      - statusts
      - lastreceived
      - refresh
      - servertime
      - status

in shell_command.yaml

dab_dconnect_get: bash /config/shell/dab_dconnect_get.sh

utility_meter.yaml

###
### Cold Water
###
cold_water_meter_daily:
  name: "Cold Water meter daily"
  unique_id: cold_water_meter_daily
  source: sensor.cold_water_meter_total
  cycle: daily
  periodically_resetting: false

cold_water_meter_monthly:
  name: "Cold Water meter monthly"
  unique_id: cold_water_meter_monthly
  source: sensor.cold_water_meter_total
  cycle: monthly
  periodically_resetting: false

cold_water_meter_yearly:
  name: "Cold Water meter yearly"
  unique_id: cold_water_meter_yearly
  source: sensor.cold_water_meter_total
  cycle: yearly
  periodically_resetting: false

Furthermore, think to remove form recorder the reccording of installation as it can be a big file for a db
in configuration.yaml you can do (I don’t grab any data from this file so you could even not download if you want by removing the line in dab_dconnect_get):

recorder:
  exclude: #Exclude entities
    domains:
      - automation
    entities:
      - sensor.dab_dconnect_installations

As for the automation, i used a dymanique update depending on the power (if running) to get the fresh data

- id: '1700385045144'
  alias: DAB DConnect Get Data
  description: ''
  trigger:
  - platform: time_pattern
    minutes: /5
  - platform: numeric_state
    entity_id:
    - sensor.sp_surpresseur_power
    above: 5
  condition: []
  action:
  - repeat:
      sequence:
      - service: shell_command.dab_dconnect_get
        data: {}
        response_variable: dab_dconnect_get_response
      - delay:
          hours: 0
          minutes: 0
          seconds: 3
          milliseconds: 0
      while:
      - condition: numeric_state
        entity_id: sensor.sp_surpresseur_power
        above: 5
  - service: shell_command.dab_dconnect_get
    data: {}
    response_variable: dab_dconnect_get_response
  mode: single

I hope this does help you. Good Luck :slight_smile:

1 Like

@Coldness00
I am working on a proper custom integration for DAB Pumps and am very interested in the data returned from the DConnect website fior a ESybox.mini.

Would you mind sharing the json file(s) returned from the website, i.e.

  • /config/data/dab_installations.json
  • /config/data/dab_dconnect_box2.json
    You can send them directly to my email address ‘info at anko dot co dot nz’.
    Anonymize the file contents if you want to.

If I know what to expect for that pump I can immediately add support for it in the custom integration.

Hey,

I just did. Sorry for the late reply.

@Coldness00 @Djavdet @lefgrter
I’ve got a first version of a proper HA integration for DAB Pumps (via DConnect) available for testing. Shows all available properties as individual sensors (read-only, no changing of settings of the pump).

Am awaiting for it to be added to the HACS integrations. Meanwhile you can add it manually:

Option 1, via HACS as custom repository

  • Open the HACS page in HA
  • Click on the three dots on the top right and select ‘Custom repositories’
  • Add “https://github.com/ankohanse/hass-dab-pumps” (with the quotes!) and set category to ‘integration’. Press ‘Add’
  • Continue with the steps shared by options 1 and 2

Option 2, manually copy all files:

Then, for both options 1 and 2:

  • Restart HA
  • Browse to Settings → integrations and choose ‘Add Integration’
  • Search for ‘DAB Pumps’, likely to be at bottom of list
  • Follow the steps of the configuration UI

Note that the DAB Pumps DConnect Website/App is not happy with multiple simultaneous logins from the same account. See my comments about this in the readme in https://github.com/ankohanse/hass-dab-pumps

2 Likes

Thanks for this! I just added my Mini3 via this integration and it seems to be working.

I had added it the pump to D Connect a few months back when I moved in and my free trial has since expired but I notice that with this integration its still able to pull data from the pump. I’m guessing an active paid subscription is not required then? Is this likely to cause issues with DAB?

I have just added the esybox intergration and it is really good, and installed without an issue. Thanks @ankoh .

This is great! Worked right away with my E.syBox Mini. I also don’t have a subscription, I didn’t even realized it required one as I don’t see it in the normal iPhone App.

Thanks for this @ankoh