
template:
  - sensor:
# current calculation missing in DSMR
      - name: reall1
        unique_id: RealIL1
        unit_of_measurement: "A"
        device_class: current
        state: >-
          {% if ( states('sensor.electricity_meter_power_consumption_phase_l1') | float > 0 ) %}
            {{ (states('sensor.electricity_meter_power_consumption_phase_l1') | float / states('sensor.electricity_meter_voltage_phase_l1') | float) *1000 }}
          {% else %}
            {{ (states('sensor.electricity_meter_power_production_phase_l1') | float / states('sensor.electricity_meter_voltage_phase_l1') | float) *-1000 }}
          {% endif %}
      - name: reall2
        unique_id: RealIL2
        unit_of_measurement: "A"
        device_class: current
        state: >-
          {% if ( states('sensor.electricity_meter_power_consumption_phase_l2') | float > 0 ) %}
            {{ (states('sensor.electricity_meter_power_consumption_phase_l2') | float / states('sensor.electricity_meter_voltage_phase_l2') | float) *1000 }}
          {% else %}
            {{ (states('sensor.electricity_meter_power_production_phase_l2') | float / states('sensor.electricity_meter_voltage_phase_l2') | float) *-1000 }}
          {% endif %}
      - name: reall3
        unique_id: RealIL3
        unit_of_measurement: "A"
        device_class: current
        state: >-
          {% if ( states('sensor.electricity_meter_power_consumption_phase_l3') | float > 0 ) %}
            {{ (states('sensor.electricity_meter_power_consumption_phase_l3') | float / states('sensor.electricity_meter_voltage_phase_l3') | float) *1000 }}
          {% else %}
            {{ (states('sensor.electricity_meter_power_production_phase_l3') | float / states('sensor.electricity_meter_voltage_phase_l3') | float) *-1000 }}
          {% endif %}
        
