Skip to content

HomeAssistant integration

Rocky edited this page Jan 17, 2024 · 17 revisions

The integration of Daly2MQTT in HomeAssistant has changed fundamentally. SoftWareCrash and Jarnsen did a Discover together. This means that no entries are required in the configuration.yaml to create the sensors.

Requirements:

1. MQTT broker installed in HomeAssistant

Watch the video

2. Daly2MQTT must be installed and MQTT must be configured. 285599502-69f46345-8cbe-42f4-8cad-253fe70b6003 285599519-ab4b21bc-165e-43c0-9a23-e7072516b8a8

3. There must be data in the WebUI.

285599407-0187832d-3519-4345-9a91-1be729ddd52a

Integration in HomeAssistant:

1. Check whether data is available in the WebUI!!

285599407-0187832d-3519-4345-9a91-1be729ddd52a

2. Go to Settings

285599619-d9b4440b-bcd1-4c74-a9c6-162ec3190f36

3. Go to Configure and click HA Discovery on

285599695-4e3eb596-0e10-4515-b3e0-cd590984c38f

4. Click Save settings, the ESP will do a reboot 285600140-07547bd2-6d9d-47fa-84d8-c7485a7422f2

285599997-d59387c0-05c5-4d4b-b7ba-d26d52124b56

Display in HomeAssistant

1. As a device in MQTT list

273700547-f1279c9b-e5de-4b1a-a34b-9e52644412ae

2. The device itself

285600241-b9fbe9a3-2575-40ac-9549-de28e991f565 285600281-b7c8ab03-291e-4206-99d9-a1f889d2c42d 285600299-84f7c646-b8ca-4adc-bebb-3d64f328e86e

3. In the dashboard

285600503-0f729f3e-8cc0-4cfb-a3b5-f8239f9de432 285600532-16333dbe-aa9e-4a9f-8523-c5366e844af0 285600558-41c3349c-3f63-453a-8ee7-7618740526b9

If there no data in the dashboard, reboot Home Assistant!!!

Daly does not provide charged and discharged energy sensors. But we can do this ourselves very quickly.

1. Go to the configuration.yaml and create the following template sensors. Adapt it to your circumstances. The sensor you are accessing is Pack_Power. From this you create charged and discharged in W

DISCHARGE

template:
  - sensor:
    - name: "energypack_pack_power_export"
      unique_id: energypack_pack_power_export
      unit_of_measurement: 'W'
      device_class: power
      state_class: measurement
      state: >-
        {% if (states('sensor.energypack_pack_power'))|float(0) < 0 %}
        {{ (states('sensor.energypack_pack_power'))|float(0) * -1 }}
        {% else %}
        {{ 0 }}
        {% endif %}
      availability: "{{
            [ states('sensor.energypack_pack_power')
            ] | map('is_number') | min
          }}"

CHARGE

- name: "energypack_pack_power_import"
      unique_id: energypack_pack_power_import
      unit_of_measurement: 'W'
      device_class: power
      state_class: measurement
      state: >-
          {% if (states('sensor.energypack_pack_power'))|float(0) > 0 %}
            {{ states('sensor.energypack_pack_power')|float(0) }}
          {% else %}
            {{ 0 }}
          {% endif %}
      availability: "{{
            [ states('sensor.energypack_pack_power')
            ] | map('is_number') | min
          }}"

2. Go to settings, devices, helper and create one for charge and one for discharge 285601843-098eb164-f1a4-4bf2-b31e-d9089e4f003a

The sensors created by the helpers are only created when power has flowed in the respective direction. Once both are created you can add them to the energy dashboard as a battery

thanks to @Jarnsen for the work!!!