[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):
- Under ‘/homeassistant’ (aka ‘/config’), create new folders ‘data’ and ‘shell’
- 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/&/\&/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’
- 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
- In ‘shell_commands.yaml’, add:
dab_dconnect_get: bash /config/shell/dab_dconnect_get.sh
- 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
- 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
- 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 %}
- 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