Integratie met Home-Assistant

Home Assistant kan op twee manieren gegevens uit de DSMR-logger32 (met de DSMRlogger32 firmware) ophalen.

Via restAPI

Om de gegevens door middel van de restAPI's uit de DSMR-logger32 te halen moet het configuration.yaml bestand er ongeveer als volgt uit zien:

Heeft iemand een werkend YAML bestand dat met restAPI's werkt????

##################################
# uitbreiding configuratie.yaml  #
##################################
# koppeling met de DSMR-logger32 #
# via restAPI's                  #
##################################

Via MQTT:

Om de gegevens via een MQTT broker uit de DSMR-logger32 te halen moet het configuration.yaml bestand er ongeveer zo uit zien:

##################################
# uitbreiding configuratie.yaml  #
##################################
# koppeling met de DSMR-logger32 #
# via MQTT broker                #
##################################

mqtt:
    sensor:
        -  state_topic: "DSMR-ESP32" 
           name: "Gebruik"
           device_class: "energy"
           unit_of_measurement:'kWh'
           value_template: "{{ value_json.power_delivered | round(3) }}"

        -  state_topic: "DSMR-ESP32"
           name: "Gebruik l1"
           device_class: "power"
           unit_of_measurement: 'W'
           value_template: "{{ (value_json.power_delivered_l1 | float * 1000.0) | round(1) }}"

        -   state_topic: "DSMR-ESP32"
            name: "Gebruik l2"
            device_class: "power"
            unit_of_measurement: 'W'
            value_template: "{{ (value_json.power_delivered_l2 | float * 1000.0) | round(1) }}"

        -   state_topic: "DSMR-ESP32"
            name: "Gebruik l3"
            device_class: "power"
            unit_of_measurement: 'W'
            value_template: "{{ (value_json.power_delivered_l3 | float * 1000.0) | round(1) }}"

        -   state_topic: "DSMR-ESP32"
            name: "Gas gebruik"
            device_class: "gas"
            unit_of_measurement: 'm³'
            value_template: "{{ value_json.gas_delivered | round(3) }}"
  
        -   state_topic: "DSMR-ESP32"
            name: "Spanning-L1"
            device_class: "voltage"
            unit_of_measurement: 'V'
            value_template: "{{ value_json.voltage_l1 | round(1) }}"

        -   state_topic: "DSMR-ESP32"
            name: "Spanning-L2"
            device_class: "voltage"
            unit_of_measurement: 'V'
            value_template: "{{ value_json.voltage_l2 | round(1) }}"

        -   state_topic: "DSMR-ESP32"
            name: "Spanning-L3"
            device_class: "voltage"
            unit_of_measurement: 'V'
            value_template: "{{ value_json.voltage_l3 | round(1) }}"
            
        -   state_topic: "DSMR-ESP32"
            name: "Stroom-L1"
            device_class: "current"
            unit_of_measurement: 'A'
            value_template: "{{ value_json.current_l1 | round(1) }}"

        -   state_topic: "DSMR-ESP32"
            name: "Stroom-L2"
            device_class: "current"
            unit_of_measurement: 'A'
            value_template: "{{ value_json.current_l2 | round(1) }}"

        -   state_topic: "DSMR-ESP32"
            name: "Stroom-L3"
            device_class: "current"
            unit_of_measurement: 'A'
            value_template: "{{ value_json.current_l3 | round(1) }}"

(met dank aan Henk Elzing)

Last updated