tuya-local icon indicating copy to clipboard operation
tuya-local copied to clipboard

Request support for EARU Multi-Circuit Power Meter

Open BevDan opened this issue 5 months ago • 5 comments

Log message

2025-06-10 02:29:52.961 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches mypin_6l_videopetfeeder with quality of 10%. DPS: {"updated_at": 1749488377.5722873, "108": "3_phase", "112": "enable", "115": 503, "116": 13, "117": 0, "118": 0, "119": 1, "120": 1, "121": 15, "122": 381, "123": 746, "124": 1497, "125": 10, "126": 536, "127": 1995, "128": 2667, "129": 2405, "130": 2258, "131": 6112, "132": 5088}

The Attached file starting with config in the name shows an actual capture of all the dps and associated value as the string above does not show all the data

Product ID

tehjajiyfp2phy4d

Product Name

EARU Electric EASEM-D Multi-Circuit Power Meter

DPS information

"101":{"code":"phase_a_data","id":"101","mode":"ro","name":"A相数据","property":"{\"maxlen\":128,\"type\":\"raw\"}","type":"raw"}
"102":{"code":"phase_b_data","id":"102","mode":"ro","name":"B相数据","property":"{\"maxlen\":128,\"type\":\"raw\"}","type":"raw"}
"103":{"code":"phase_c_data","id":"103","mode":"ro","name":"C相数据","property":"{\"maxlen\":128,\"type\":\"raw\"}","type":"raw"}
"104":{"code":"phase_t_data","id":"104","mode":"ro","name":"合相数据","property":"{\"maxlen\":128,\"type\":\"raw\"}","type":"raw"}
"105":{"code":"sub_power","id":"105","mode":"ro","name":"子线路功率","property":"{\"maxlen\":128,\"type\":\"raw\"}","type":"raw"}
"106":{"code":"sub_current","id":"106","mode":"ro","name":"子线路电流","property":"{\"maxlen\":128,\"type\":\"raw\"}","type":"raw"}
"107":{"code":"sub_phase","id":"107","mode":"rw","name":"子线路相设置","property":"{\"maxlen\":128,\"type\":\"raw\"}","type":"raw"}
"108":{"code":"meter_type","id":"108","mode":"ro","name":"测量类型","property":"{\"range\":[\"unknow\",\"3_phase\",\"1_phase\",\"1_phase_3_wire\",\"other\"],\"type\":\"enum\"}","schemaType":"enum","type":"obj"}
"109":{"code":"solar_en","id":"109","mode":"rw","name":"太阳能使能","property":"{\"maxlen\":128,\"type\":\"raw\"}","type":"raw"}
"110":{"code":"clear_energy","id":"110","mode":"wr","name":"清除电量","property":"{\"maxlen\":128,\"type\":\"raw\"}","type":"raw"}
"111":{"code":"vol_multi_set","id":"111","mode":"rw","name":"电压倍数设置","property":"{\"maxlen\":128,\"type\":\"raw\"}","type":"raw"}
"112":{"code":"solar_en_total","id":"112","mode":"rw","name":"使能太阳能总开关","property":"{\"range\":[\"unknow\",\"disable\",\"enable\"],\"type\":\"enum\"}","schemaType":"enum","type":"obj"}
"113":{"code":"ct_check","id":"113","mode":"ro","name":"插入CT检测","property":"{\"maxlen\":128,\"type\":\"raw\"}","type":"raw"}
"114":{"code":"refresh","id":"114","mode":"wr","name":"刷新","property":"{\"range\":[\"solar_en\",\"ct_insert\"],\"type\":\"enum\"}","schemaType":"enum","type":"obj"}
"115":{"code":"energy_sub1","id":"115","mode":"ro","name":"子线路1电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"116":{"code":"energy_sub2","id":"116","mode":"ro","name":"子线路2电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"117":{"code":"energy_sub3","id":"117","mode":"ro","name":"子线路3电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"118":{"code":"energy_sub4","id":"118","mode":"ro","name":"子线路4电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"119":{"code":"energy_sub5","id":"119","mode":"ro","name":"子线路5电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"120":{"code":"energy_sub6","id":"120","mode":"ro","name":"子线路6电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"121":{"code":"energy_sub7","id":"121","mode":"ro","name":"子线路7电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"122":{"code":"energy_sub8","id":"122","mode":"ro","name":"子线路8电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"123":{"code":"energy_sub9","id":"123","mode":"ro","name":"子线路9电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"124":{"code":"energy_sub10","id":"124","mode":"ro","name":"子线路10电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"125":{"code":"energy_sub11","id":"125","mode":"ro","name":"子线路11电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"126":{"code":"energy_sub12","id":"126","mode":"ro","name":"子线路12电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"127":{"code":"energy_sub13","id":"127","mode":"ro","name":"子线路13电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"128":{"code":"energy_sub14","id":"128","mode":"ro","name":"子线路14电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"129":{"code":"energy_sub15","id":"129","mode":"ro","name":"子线路15电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"130":{"code":"energy_sub16","id":"130","mode":"ro","name":"子线路16电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"131":{"code":"energy_consumed_total","id":"131","mode":"ro","name":"总消耗电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"}
"132":{"code":"energy_generate_total","id":"132","mode":"ro","name":"总产生电量","property":"{\"max\":2000000000,\"min\":0,\"scale\":2,\"step\":1,\"type\":\"value\",\"unit\":\"kW·h\"}","schemaType":"value","type":"obj"

Information about how the device functions

This device has a total of 19 current clamps, 3 primary ones measuring the incoming grid energy (phase_#_data), and an addition 16 smaller clamps to measure loads from a distribution board (energy_sub#) I have been unsuccessful in setting up iot.tuya.com, however I have been able to get some of the DPS data from the Smart Life app (Attached), hope this helps.

The first 7 DPS (101-107) are "raw" data type, I'm guessing these need to be converted to some meaningful numbers, in the app I can see Phase A/B/C data as either kwh or current, however I would imagine voltage must be included there somewhere to be able to calculate current from power. DPS 108 appears to report the type of metering based on the connection made for voltage measurement,

I suspect the following: DPS 109 solar_en, is the selection of which of the up to 16 sub circuits are used to measure solar inverter output, DPS 111 vol_multi_set, is where you can nominate which of the phases each of the sub clamps are on, the app has a choice of Auto, L1/A, L2/B or L3/C, DPS 112 solar_en_total, is the choice of having solar measurements included,

I haven't been able to determine the use of DPS 110, 113 and 114

DPS 115-132 are kwh accumulation since reset multiplied by 100 ( ie 503 is 5.03kwh on the app)

I have tried to create a yaml file (attached) but not sure how to test it yet or how to handle the "raw" formatted data other than choosing base64 type

I purchased the unit on Ali-express at this url Tuya Smart WiFi Multi-Circuit 19 Channels Bi-Directional Power Energy kWh Meter Monitor AC90-480V 200A 300A with 19PCS CT Clamps there is quite a lot of information about the unit and screen shots of the app

Regards, Bevan

BevDan avatar Jun 09 '25 18:06 BevDan

Missed adding the files

EARU Multi-Circuit Power Meter from Smart Life App.zip

BevDan avatar Jun 09 '25 19:06 BevDan

I think I am close to getting this working, I may have to work out how to indicate the direction of current, here is what I have so far, should I change over to a pull request?

name: EARU Multi-Circuit Power Meter
products:
  - id: tehjajiyfp2phy4d
    manufacturer: EARU Electronic
    model: EASEM-D
entities:
  - entity: sensor
    class: voltage
    translation_key: voltage_x
    translation_placeholders:
      x: A
    category: diagnostic
    dps:
      - id: 101
        optional: true
        type: base64
        unit: V
        class: measurement
        name: sensor
        mask: 000000000000000000FFFFFFFF
        endianness: little
        mapping:
          - scale: 10
  - entity: sensor
    class: voltage
    translation_key: voltage_x
    translation_placeholders:
      x: B
    category: diagnostic
    dps:
      - id: 102
        optional: true
        type: base64
        unit: V
        class: measurement
        name: sensor
        mask: 000000000000000000FFFFFFFF
        endianness: little
        mapping:
          - scale: 10
  - entity: sensor
    class: voltage
    translation_key: voltage_x
    translation_placeholders:
      x: C
    category: diagnostic
    dps:
      - id: 103
        optional: true
        type: base64
        unit: V
        class: measurement
        name: sensor
        mask: 000000000000000000FFFFFFFF
        endianness: little
        mapping:
          - scale: 10
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: A
    category: diagnostic
    dps:
      - id: 101
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 0000000000FFFFFFFF00000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: B
    category: diagnostic
    dps:
      - id: 102
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 0000000000FFFFFFFF00000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: C
    category: diagnostic
    dps:
      - id: 103
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 0000000000FFFFFFFF00000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: Total
    category: diagnostic
    dps:
      - id: 104
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 0000000000FFFFFFFF
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB01
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF0000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB02
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB03
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB04
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF0000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB05
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB06
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB07
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB08
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 00000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB09
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 0000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB10
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 000000000000000000000000000000000000000000000000000000000000FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB11
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 00000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB12
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 0000000000000000000000000000000000000000FFFFFFFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB13
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 000000000000000000000000000000FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB14
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 00000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB15
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: 0000000000FFFFFFFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: current
    translation_key: current_x
    translation_placeholders:
      x: SUB16
    category: diagnostic
    dps:
      - id: 106
        optional: true
        type: base64
        unit: A
        name: sensor
        mask: FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: A
    category: diagnostic
    dps:
      - id: 101
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 00FFFFFFFF0000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: B
    category: diagnostic
    dps:
      - id: 102
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 00FFFFFFFF0000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: C
    category: diagnostic
    dps:
      - id: 103
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 00FFFFFFFF0000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: Total
    category: diagnostic
    dps:
      - id: 104
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 00FFFFFFFF00000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB01
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF0000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB02
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB03
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB04
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF0000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB05
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB06
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB07
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB08
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 00000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB09
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 0000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB10
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 000000000000000000000000000000000000000000000000000000000000FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB11
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 00000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB12
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 0000000000000000000000000000000000000000FFFFFFFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB13
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 000000000000000000000000000000FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB14
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 00000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB15
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: 0000000000FFFFFFFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    class: power
    translation_key: power_x
    translation_placeholders:
      x: SUB16
    category: diagnostic
    dps:
      - id: 105
        optional: true
        type: base64
        unit: kW
        name: sensor
        mask: FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        endianness: little
        mapping:
          - scale: 1000
  - entity: sensor
    name: Energy SUB01
    class: energy
    category: diagnostic
    dps:
      - id: 115
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB02
    class: energy
    category: diagnostic
    dps:
      - id: 116
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB03
    class: energy
    category: diagnostic
    dps:
      - id: 117
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB04
    class: energy
    category: diagnostic
    dps:
      - id: 118
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB05
    class: energy
    category: diagnostic
    dps:
      - id: 119
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB06
    class: energy
    category: diagnostic
    dps:
      - id: 120
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB07
    class: energy
    category: diagnostic
    dps:
      - id: 121
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB08
    class: energy
    category: diagnostic
    dps:
      - id: 122
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB09
    class: energy
    category: diagnostic
    dps:
      - id: 123
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB10
    class: energy
    category: diagnostic
    dps:
      - id: 124
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB11
    class: energy
    category: diagnostic
    dps:
      - id: 125
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB12
    class: energy
    category: diagnostic
    dps:
      - id: 126
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB13
    class: energy
    category: diagnostic
    dps:
      - id: 127
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB14
    class: energy
    category: diagnostic
    dps:
      - id: 128
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB15
    class: energy
    category: diagnostic
    dps:
      - id: 129
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Energy SUB16
    class: energy
    category: diagnostic
    dps:
      - id: 130
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    translation_key: energy_consumed
    class: energy
    dps:
      - id: 131
        type: integer
        optional: true
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    class: energy
    translation_key: energy_produced
    dps:
      - id: 132
        type: integer
        name: sensor
        unit: kWh
        class: total_increasing
        mapping:
          - scale: 100
  - entity: sensor
    name: Meter Type
    category: diagnostic
    dps:
      - id: 108
        type: string
        name: sensor
  - entity: sensor
    name: Solar Total
    category: diagnostic
    dps:
      - id: 112
        type: string
        name: sensor

BevDan avatar Jun 11 '25 17:06 BevDan

@make-all I am so close with getting this to work, the only issue I have is with power and current being exported to the grid, which is indicated by a negative value, the data coming from the device appears to be 2's complemented number, within python I can correctly calculate the number using signed=True as per this code

import base64
import sys
value_phase_a = "PwkAAEHw///p/P//AA=="
value_decoded = base64.b64decode(value_phase_a)
    
# Calculating Voltage from base64-decoded value

value_voltage = round(int.from_bytes(value_decoded[0:4], byteorder='little')*0.1, 1)
print('Voltage: %r' % value_voltage)

# Calculating Current from base64-decoded value
value_current = round(int.from_bytes(value_decoded[4:8], byteorder='little',signed=True)*0.001, 3)
print('Current: %r' % value_current)

# Calculating Power from base64-decoded value
value_power = round(int.from_bytes(value_decoded[8:12], byteorder='little',signed=True)*0.001, 3)
print('Power: %r' % value_power)

I have been able to make use of Base64, Mask, Endianness to get the value out of the raw data for most of the measurement, however for this case with a negative number should I be using format?

Regards, Bevan

BevDan avatar Jun 12 '25 02:06 BevDan

I have created a Pull Request for this device, just advising you here so that you don't waste time on both, I would close this but I have seen my pull request has thrown errors so may have more work to do

BevDan avatar Jun 16 '25 08:06 BevDan

Linked PR #3377

make-all avatar Jun 16 '25 09:06 make-all