Frient Electricity Meter Interface2 (EMIZB-141)

Hi HA community,

in my setup ZHA is running with the Conbee II. I managed to pair the device well and a power sensor is created. But the values are completely wrong because my electricity meter works with 10000 imp/kWh. And I can not find the value pulse configuration unfortunately.

Does anyone know how to change the pulse rate?

      "manufacturer": "frient A/S",
      "model": "EMIZB-141"
    },
    "active_coordinator": false,
    "entities": [
      {
        "entity_id": "sensor.powermeter1_battery",
        "name": "frient A/S EMIZB-141"
      },
      {
        "entity_id": "button.powermeter1_identify",
        "name": "frient A/S EMIZB-141"
      },
      {
        "entity_id": "sensor.powermeter1_instantaneous_demand",
        "name": "frient A/S EMIZB-141"
      },
      {
        "entity_id": "sensor.powermeter1_summation_delivered",
        "name": "frient A/S EMIZB-141"
      },
      {
        "entity_id": "switch.powermeter1_switch",
        "name": "frient A/S EMIZB-141"
      }
    ],
    "neighbors": [],
    "routes": [],
    "endpoint_names": [
      {
        "name": "unknown 1 device_type of 0xc0c9 profile id"
      },
      {
        "name": "METER_INTERFACE"
      }
    ],
    "user_given_name": "Powermeter1",
    "device_reg_id": "*******************6088",
    "area_id": "keller",
    "cluster_details": {
      "1": {
        "device_type": {
          "name": "unknown",
          "id": 1
        },
        "profile_id": 49353,
        "in_clusters": {
          "0x0005": {
            "endpoint_attribute": "scenes",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0006": {
            "endpoint_attribute": "on_off",
            "attributes": {},
            "unsupported_attributes": {}
          }
        },
        "out_clusters": {}
      },
      "2": {
        "device_type": {
          "name": "METER_INTERFACE",
          "id": 83
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0000": {
            "endpoint_attribute": "basic",
            "attributes": {
              "0x0004": {
                "attribute_name": "manufacturer",
                "value": "frient A/S"
              },
              "0x0005": {
                "attribute_name": "model",
                "value": "EMIZB-141"
              }
            },
            "unsupported_attributes": {}
          },
          "0x0001": {
            "endpoint_attribute": "power",
            "attributes": {
              "0x003e": {
                "attribute_name": "battery_alarm_state",
                "value": 0
              },
              "0x0021": {
                "attribute_name": "battery_percentage_remaining",
                "value": 200
              },
              "0x0033": {
                "attribute_name": "battery_quantity",
                "value": 2
              },
              "0x0031": {
                "attribute_name": "battery_size",
                "value": 3
              },
              "0x0020": {
                "attribute_name": "battery_voltage",
                "value": 30
              }
            },
            "unsupported_attributes": {}
          },
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0020": {
            "endpoint_attribute": "poll_control",
            "attributes": {
              "0x0000": {
                "attribute_name": "checkin_interval",
                "value": 13200
              }
            },
            "unsupported_attributes": {}
          },
          "0x0702": {
            "endpoint_attribute": "smartenergy_metering",
            "attributes": {
              "0x0000": {
                "attribute_name": "current_summ_delivered",
                "value": 90956
              },
              "0x0304": {
                "attribute_name": "demand_formatting",
                "value": 248
              },
              "0x0302": {
                "attribute_name": "divisor",
                "value": 1000
              },
              "0x0400": {
                "attribute_name": "instantaneous_demand",
                "value": 4826
              },
              "0x0306": {
                "attribute_name": "metering_device_type",
                "value": 0
              },
              "0x0301": {
                "attribute_name": "multiplier",
                "value": 1
              },
              "0x0200": {
                "attribute_name": "status",
                "value": 0
              },
              "0x0303": {
                "attribute_name": "summation_formatting",
                "value": 248
              },
              "0x0300": {
                "attribute_name": "unit_of_measure",
                "value": 0
              }
            },
            "unsupported_attributes": {
              "0x0100": {
                "attribute_name": "current_tier1_summ_delivered"
              },
              "0x0102": {
                "attribute_name": "current_tier2_summ_delivered"
              },
              "0x0104": {
                "attribute_name": "current_tier3_summ_delivered"
              },
              "0x0106": {
                "attribute_name": "current_tier4_summ_delivered"
              },
              "0x0108": {
                "attribute_name": "current_tier5_summ_delivered"
              },
              "0x010a": {
                "attribute_name": "current_tier6_summ_delivered"
              }
            }
          },
          "0x0b01": {
            "endpoint_attribute": "meter_id",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0b05": {
            "endpoint_attribute": "diagnostic",
            "attributes": {},
            "unsupported_attributes": {}
          }
        },
        "out_clusters": {
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x000a": {
            "endpoint_attribute": "time",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0019": {
            "endpoint_attribute": "ota",
            "attributes": {},
            "unsupported_attributes": {}
          }
        }
      }
    }
  }
}
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4117, maximum_buffer_size=82, maximum_incoming_transfer_size=1500, server_mask=11264, maximum_outgoing_transfer_size=1500, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0xc0c9",
      "device_type": "0x0001",
      "input_clusters": [
        "0x0005",
        "0x0006"
      ],
      "output_clusters": []
    },
    "2": {
      "profile_id": "0x0104",
      "device_type": "0x0053",
      "input_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0020",
        "0x0702",
        "0x0b01",
        "0x0b05"
      ],
      "output_clusters": [
        "0x0003",
        "0x000a",
        "0x0019"
      ]
    }
  },
  "manufacturer": "frient A/S",
  "model": "EMIZB-141",
  "class": "zigpy.device.Device"
}

https://www.develcoproducts.com/media/5110/emizb-141-technical-manual.pdf

Mine is working correctly (1000 pulses pr. kWh). But I had a look around, and if you go to Manage Zigbee Device, select “Clusters”, then “Metering” in the first drop-down, there’s an attribute called “divisor”. It’s 1000 on mine. It seems you can change it there.

thank you for your support but unfortunately i already tried that and i can’t change the attribute. if i set the value to 10000 it returns to 1000 after reopening to check the value.

I have found the following detailed data sheet: https://www.develcoproducts.com/media/5110/emizb-141-technical-manual.pdf. According to this data sheet, the pulse configuration is done in manufacturer specific attributes.

With zha_toolkit, I managed to read and edit the pulse configuration.

read:

service: zha_toolkit.attr_read
data:
  ieee: <your address>
  cluster: 0x0702
  attribute: 0x0300
  manf: 0x1015

write (to 500):

service: zha_toolkit.attr_write
data:
  ieee: <your address>
  cluster: 0x0702
  attribute: 0x0300
  attr_type: 0x21
  manf: 0x1015
  attr_val: 500

But now the meter is always sending 0 as instantaneous demand…

The solution I settled for is to have some template sensors which calculate the correct values. I have to multiply by two, since I get 500 pulses/kWh. This sensors can then be integrated into energy dashboard and wherever else you want to have it.

Adapt and add to your configuration.yaml

template:
  - sensor:
    - name: "Instantaneous demand fixed"
      state_class: "measurement"
      device_class: "power"
      unit_of_measurement: "W"
      state: "{{ states('sensor.original_power_meter_instantaneous_demand')|float * 2 }}"
      availability: "{{ is_number(states('sensor.original_power_meter_instantaneous_demand')) }}"
  - sensor:
    - name: "Summation fixed"
      device_class: "energy"
      state_class: "total_increasing"
      unit_of_measurement: "kWh"
      state: "{{ states('sensor.original_power_meter_summation_delivered')|float * 2 }}"
      availability: "{{ is_number(states('sensor.original_power_meter_summation_delivered')) }}"

2 Likes

I’m not the original poster, but I used the template above with minor changes and IT WORKS!
I’m very glad I can now track my consumption even though my meter LED is 10000 imp/kWh.
THANK YOU @charno.
Here’s the final code:

template:
  - sensor:
    - name: "Instantaneous demand fixed"
      unique_id: "ydwRwMattmg"
      state_class: "measurement"
      device_class: "power"
      unit_of_measurement: "W"
      state: "{{ states('sensor.frient_a_s_emizb_141_instantaneous_demand')|float / 10 }}"
      availability: "{{ is_number(states('sensor.frient_a_s_emizb_141_instantaneous_demand')) }}"
  - sensor:
    - name: "Summation fixed"
      unique_id: "aByI8S9eMlU"
      device_class: "energy"
      state_class: "total_increasing"
      unit_of_measurement: "kWh"
      state: "{{ states('sensor.frient_a_s_emizb_141_summation_delivered')|float / 10 }}"
      availability: "{{ is_number(states('sensor.frient_a_s_emizb_141_summation_delivered')) }}"

2 Likes

Hope I’m not necroposting here but if anyone’s interested in setting the appropriate pulse rate parameter you can do so using the services provided by zha_toolkit:

For example, to write the Pulse Configuration option:

service: zha_toolkit.attr_write
data:
  ieee: ZIGBEE_IEEE_ADDRESS_HERE
  manf: 4117
  endpoint: 2
  cluster: 1794
  attribute: 768
  attr_val: "4000"

Unfortunately this didn’t work, it messed up my data :frowning: I am getting only 1.00, 2.00,etc on Instantaneous demand.
Does anyone have setup 10 000 pulses running on ZHA?

Yes, I was able to set the pluse correctly as described with zha_toolkit. But at first my instantaneous wattage sensor showed only 0 and my total_increasing where skyrocketing by 2000+ kwh. I then went back to the ZHA integration and read the attributes once more from there, no luck. Finally a wrote the divisor again with zha_toolkit and restarted home assistant and took the batteries out of the frient and after that it shows now me correct values:

But if I read the divisor attribute again over zha integration it still shows “1000”. On the other hand on the zha_toolkit it its displayed correctly:

zha_toolkit_version: v1.1.8
zigpy_version: 0.62.3
zigpy_rf_version: 0.38.0
ieee_org: sensor.stromzahler_zusammenfassung_geliefert
ieee: 00:15:bc:XX:XX:XX:XX:X
command: attr_read
command_data: null
start_time: "2024-02-13T09:23:57.475612+00:00"
errors: []
params:
  endpoint_id: 2
  cluster_id: 1794
  attr_id: 768
  dir: 0
  manf: 4117
  tries: 1
  expect_reply: true
  args: []
  read_before_write: true
  read_after_write: true
attr_type: "0x21"
write_is_equal: false
result_read:
  - "768": 10000
  - {}
success: true

But for me its reboot safe and stable so far.