zha-device-handlers: [BUG] INNR SP 240 "summation delivered" kWh value is 100x expected value
Bug description
Upon inclusion of the INNR SP 240 in ZHA, among others a “Summation delivered” sensor gets created. The value returned for this sensor is however 100x larger than expected: I ran a filament dryer for 5 hours of the SP 240 and the device measured 17kWh instead of the expected 0,17 kWh as measured using a Fibaro wall plug V2.
When I requested help from INNR support they responded that ZHA probably has incorrectly interpreted the configuration their device returned. My translation of their response: “An attribute “SummationFormatting” on the Metering cluster has the value 0x2A, which designates: 2 digits to the right of the decimal point, 5 digits to the left of the decimal point, don’t suppress leading zeroes”. Looks like his system (red: my ZHA integration in HA)) doesn’t interpret or incorrectly interprets the value of the “SummationFormatting” attribute."
The full mail text I got from INNR support (in Dutch, sorry):
Beste Richard,
(This message is in Dutch because I assume based on your name and e-mail address that you also speak Dutch.)
Ik heb de vraag even bij één van onze engineers gelegd, en dit was zijn reactie:
Wat betreft Watt meting die op 0 decimalen wordt afgerond:
De waarde wordt opgeslagen en gecommuniceerd in een “int16” type, wat een bereik heeft van -32768 tot 32767. Als we op 1 decimaal zouden afronden zou het maximum slechts 3276.7 W zijn, maar de plug kan 3680 W aan dus de keuze was simpel. De afronding dynamisch maken (meer decimalen bij lagere waarden) is geen optie want dat ondersteunen de meeste systemen niet (voor zover ik weet geen enkel systeem).
Wat betreft de kWh formatting: het “SummationFormatting” attribuut van het Metering cluster heeft waarde 0x2A, wat betekent: 2 digits to the right of the decimal point, 5 digits to the left of the decimal point, don’t suppress leading zeroes. Lijkt er dus op dat zijn systeem de waarde van het “SummationFormatting” attribuut van het Metering cluster niet of verkeerd interpreteert.
Hopelijk heb je iets aan deze uitleg.
Met vriendelijke groet,
REDACTED
Innr Servicedesk Innr Lighting | Innr.com
Innr Lighting BV | Catharina van Renneslaan 20 | 1217 CX Hilversum
@TheJulianJES requested me to tag him in here.
Steps to reproduce
Include the INNR SP 240 into the network using ZHA, plug in a filament dryer of 145W, Run the dryer for 5 hours, Watt history graph shows a peak at the beginning, then dropping to roughly 30 Watt. Multiply the measured Watt value with the number of hours: 5 * roughly 30 Watt = roughly 170 Wh, or 0,17 kWh. See how the actual sensor in ZHA however shows 17kWh.
Expected behavior
The summation delivered sensor should have shown a usage of 0,170 kWh
Screenshots/Video
Screenshots/Video
Device signature
Device signature
{
"node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4454, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
"endpoints": {
"1": {
"profile_id": "0x0104",
"device_type": "0x010a",
"input_clusters": [
"0x0000",
"0x0003",
"0x0004",
"0x0005",
"0x0006",
"0x0008",
"0x0702",
"0x0b04",
"0x1000",
"0xe001"
],
"output_clusters": [
"0x000a",
"0x0019"
]
},
"242": {
"profile_id": "0xa1e0",
"device_type": "0x0061",
"input_clusters": [],
"output_clusters": [
"0x0021"
]
}
},
"manufacturer": "innr",
"model": "SP 240",
"class": "zigpy.device.Device"
}
Diagnostic information
Diagnostic information
{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2023.11.3",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.11.6",
"docker": true,
"arch": "x86_64",
"timezone": "Europe/Amsterdam",
"os_name": "Linux",
"os_version": "6.1.59",
"supervisor": "2023.11.3",
"host_os": "Home Assistant OS 11.1",
"docker_version": "24.0.6",
"chassis": "embedded",
"run_as_root": true
},
"custom_components": {
"battery_consumption": {
"version": "1.0.4",
"requirements": []
},
"spook": {
"version": "1.3.2",
"requirements": []
},
"chime_tts": {
"version": "v0.8.0",
"requirements": [
"pydub"
]
},
"battery_sim": {
"version": "1.0",
"requirements": []
},
"google_fit": {
"version": "v2.1.2",
"requirements": [
"oauth2client==4.1.3",
"google-api-python-client==2.82.0"
]
},
"hacs": {
"version": "1.33.0",
"requirements": [
"aiogithubapi>=22.10.1"
]
},
"energy_meter": {
"version": "1.0.1",
"requirements": []
},
"adaptive_lighting": {
"version": "1.19.0",
"requirements": [
"ulid-transform"
]
},
"smart_irrigation": {
"version": "0.0.81",
"requirements": []
},
"hass_agent": {
"version": "2022.11.9",
"requirements": []
},
"var": {
"version": "0.15.0",
"requirements": []
},
"presence_simulation": {
"version": "3.2",
"requirements": []
},
"grad_vol": {
"version": "1.0.0",
"requirements": []
},
"better_thermostat": {
"version": "1.4.0",
"requirements": []
},
"xiaomi_cloud_map_extractor": {
"version": "v2.2.0",
"requirements": [
"pillow",
"pybase64",
"python-miio",
"requests",
"pycryptodome"
]
},
"powercalc": {
"version": "v1.9.7",
"requirements": [
"numpy>=1.21.1"
]
},
"spook_inverse": {
"version": "1.3.2",
"requirements": []
}
},
"integration_manifest": {
"domain": "zha",
"name": "Zigbee Home Automation",
"after_dependencies": [
"onboarding",
"usb"
],
"codeowners": [
"@dmulcahey",
"@adminiuga",
"@puddly"
],
"config_flow": true,
"dependencies": [
"file_upload"
],
"documentation": "https://www.home-assistant.io/integrations/zha",
"iot_class": "local_polling",
"loggers": [
"aiosqlite",
"bellows",
"crccheck",
"pure_pcapy3",
"zhaquirks",
"zigpy",
"zigpy_deconz",
"zigpy_xbee",
"zigpy_zigate",
"zigpy_znp",
"universal_silabs_flasher"
],
"requirements": [
"bellows==0.36.8",
"pyserial==3.5",
"pyserial-asyncio==0.6",
"zha-quirks==0.0.106",
"zigpy-deconz==0.21.1",
"zigpy==0.59.0",
"zigpy-xbee==0.19.0",
"zigpy-zigate==0.11.0",
"zigpy-znp==0.11.6",
"universal-silabs-flasher==0.0.14",
"pyserial-asyncio-fast==0.11"
],
"usb": [
{
"vid": "10C4",
"pid": "EA60",
"description": "*2652*",
"known_devices": [
"slae.sh cc2652rb stick"
]
},
{
"vid": "1A86",
"pid": "55D4",
"description": "*sonoff*plus*",
"known_devices": [
"sonoff zigbee dongle plus v2"
]
},
{
"vid": "10C4",
"pid": "EA60",
"description": "*sonoff*plus*",
"known_devices": [
"sonoff zigbee dongle plus"
]
},
{
"vid": "10C4",
"pid": "EA60",
"description": "*tubeszb*",
"known_devices": [
"TubesZB Coordinator"
]
},
{
"vid": "1A86",
"pid": "7523",
"description": "*tubeszb*",
"known_devices": [
"TubesZB Coordinator"
]
},
{
"vid": "1A86",
"pid": "7523",
"description": "*zigstar*",
"known_devices": [
"ZigStar Coordinators"
]
},
{
"vid": "1CF1",
"pid": "0030",
"description": "*conbee*",
"known_devices": [
"Conbee II"
]
},
{
"vid": "10C4",
"pid": "8A2A",
"description": "*zigbee*",
"known_devices": [
"Nortek HUSBZB-1"
]
},
{
"vid": "0403",
"pid": "6015",
"description": "*zigate*",
"known_devices": [
"ZiGate+"
]
},
{
"vid": "10C4",
"pid": "EA60",
"description": "*zigate*",
"known_devices": [
"ZiGate"
]
},
{
"vid": "10C4",
"pid": "8B34",
"description": "*bv 2010/10*",
"known_devices": [
"Bitron Video AV2010/10"
]
}
],
"zeroconf": [
{
"type": "_esphomelib._tcp.local.",
"name": "tube*"
},
{
"type": "_zigate-zigbee-gateway._tcp.local.",
"name": "*zigate*"
},
{
"type": "_zigstar_gw._tcp.local.",
"name": "*zigstar*"
},
{
"type": "_uzg-01._tcp.local.",
"name": "uzg-01*"
},
{
"type": "_slzb-06._tcp.local.",
"name": "slzb-06*"
}
],
"is_built_in": true
},
"data": {
"ieee": "**REDACTED**",
"nwk": 12957,
"manufacturer": "innr",
"model": "SP 240",
"name": "innr SP 240",
"quirk_applied": false,
"quirk_class": "zigpy.device.Device",
"quirk_id": null,
"manufacturer_code": 4454,
"power_source": "Mains",
"lqi": 123,
"rssi": null,
"last_seen": "2023-11-26T21:32:06",
"available": true,
"device_type": "Router",
"signature": {
"node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4454, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
"endpoints": {
"1": {
"profile_id": "0x0104",
"device_type": "0x010a",
"input_clusters": [
"0x0000",
"0x0003",
"0x0004",
"0x0005",
"0x0006",
"0x0008",
"0x0702",
"0x0b04",
"0x1000",
"0xe001"
],
"output_clusters": [
"0x000a",
"0x0019"
]
},
"242": {
"profile_id": "0xa1e0",
"device_type": "0x0061",
"input_clusters": [],
"output_clusters": [
"0x0021"
]
}
},
"manufacturer": "innr",
"model": "SP 240"
},
"active_coordinator": false,
"entities": [
{
"entity_id": "button.woonkamer_innr_sp240_identify",
"name": "innr SP 240"
},
{
"entity_id": "select.woonkamer_innr_sp240_start_up_behavior",
"name": "innr SP 240"
},
{
"entity_id": "sensor.woonkamer_innr_sp240_current",
"name": "innr SP 240"
},
{
"entity_id": "sensor.woonkamer_innr_sp240_voltage",
"name": "innr SP 240"
},
{
"entity_id": "sensor.woonkamer_innr_sp240_electric_consumption_w",
"name": "innr SP 240"
},
{
"entity_id": "sensor.woonkamer_innr_sp240_electric_consumption_kwh",
"name": "innr SP 240"
},
{
"entity_id": "switch.woonkamer_kerstverlichting_3",
"name": "innr SP 240"
}
],
"neighbors": [
{
"device_type": "Coordinator",
"rx_on_when_idle": "On",
"relationship": "Parent",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x0000",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "48"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xA795",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "62"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xF80E",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "223"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x0316",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "88"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xFF73",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "80"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x2415",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "45"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xA16F",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "0"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x6D36",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "53"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xF373",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "103"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xF608",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "47"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xC07F",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "118"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xB58E",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "16"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x3242",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "66"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xA1BB",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "29"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x8A77",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "15"
}
],
"routes": [],
"endpoint_names": [
{
"name": "ON_OFF_PLUG_IN_UNIT"
},
{
"name": "PROXY_BASIC"
}
],
"user_given_name": "Woonkamer: innr sp240",
"device_reg_id": "7fa8dcff82a4c9d75905608870c6f7ef",
"area_id": "woonkamer",
"cluster_details": {
"1": {
"device_type": {
"name": "ON_OFF_PLUG_IN_UNIT",
"id": 266
},
"profile_id": 260,
"in_clusters": {
"0x0000": {
"endpoint_attribute": "basic",
"attributes": {
"0x0004": {
"attribute_name": "manufacturer",
"value": "innr"
},
"0x0005": {
"attribute_name": "model",
"value": "SP 240"
}
},
"unsupported_attributes": {}
},
"0x0003": {
"endpoint_attribute": "identify",
"attributes": {},
"unsupported_attributes": {}
},
"0x0004": {
"endpoint_attribute": "groups",
"attributes": {},
"unsupported_attributes": {}
},
"0x0005": {
"endpoint_attribute": "scenes",
"attributes": {},
"unsupported_attributes": {}
},
"0x0006": {
"endpoint_attribute": "on_off",
"attributes": {
"0x0000": {
"attribute_name": "on_off",
"value": 1
},
"0x4003": {
"attribute_name": "start_up_on_off",
"value": 255
}
},
"unsupported_attributes": {}
},
"0x0008": {
"endpoint_attribute": "level",
"attributes": {
"0x0000": {
"attribute_name": "current_level",
"value": 1
}
},
"unsupported_attributes": {
"0x4000": {
"attribute_name": "start_up_current_level"
},
"0x0012": {
"attribute_name": "on_transition_time"
},
"0x0010": {
"attribute_name": "on_off_transition_time"
},
"0x0011": {
"attribute_name": "on_level"
},
"0x0013": {
"attribute_name": "off_transition_time"
},
"0x0014": {
"attribute_name": "default_move_rate"
}
}
},
"0x1000": {
"endpoint_attribute": "lightlink",
"attributes": {},
"unsupported_attributes": {}
},
"0x0702": {
"endpoint_attribute": "smartenergy_metering",
"attributes": {
"0x0000": {
"attribute_name": "current_summ_delivered",
"value": 17
},
"0x0306": {
"attribute_name": "metering_device_type",
"value": 0
},
"0x0200": {
"attribute_name": "status",
"value": 0
},
"0x0303": {
"attribute_name": "summation_formatting",
"value": 42
},
"0x0300": {
"attribute_name": "unit_of_measure",
"value": 0
}
},
"unsupported_attributes": {
"0x0400": {
"attribute_name": "instantaneous_demand"
},
"0x0100": {
"attribute_name": "current_tier1_summ_delivered"
},
"0x0302": {
"attribute_name": "divisor"
},
"0x0301": {
"attribute_name": "multiplier"
},
"0x0304": {
"attribute_name": "demand_formatting"
},
"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"
}
}
},
"0x0b04": {
"endpoint_attribute": "electrical_measurement",
"attributes": {
"0x0603": {
"attribute_name": "ac_current_divisor",
"value": 1000
},
"0x0602": {
"attribute_name": "ac_current_multiplier",
"value": 1
},
"0x0605": {
"attribute_name": "ac_power_divisor",
"value": 1
},
"0x0604": {
"attribute_name": "ac_power_multiplier",
"value": 1
},
"0x0601": {
"attribute_name": "ac_voltage_divisor",
"value": 1
},
"0x0600": {
"attribute_name": "ac_voltage_multiplier",
"value": 1
},
"0x050b": {
"attribute_name": "active_power",
"value": 2
},
"0x0000": {
"attribute_name": "measurement_type",
"value": 3221762439
},
"0x0508": {
"attribute_name": "rms_current",
"value": 14
},
"0x0505": {
"attribute_name": "rms_voltage",
"value": 236
}
},
"unsupported_attributes": {
"0x0300": {
"attribute_name": "ac_frequency"
},
"0x0401": {
"attribute_name": "ac_frequency_divisor"
},
"0x0302": {
"attribute_name": "ac_frequency_max"
},
"0x0400": {
"attribute_name": "ac_frequency_multiplier"
},
"0x0403": {
"attribute_name": "power_divisor"
},
"0x0402": {
"attribute_name": "power_multiplier"
},
"0x0507": {
"attribute_name": "rms_voltage_max"
},
"0x050a": {
"attribute_name": "rms_current_max"
},
"0x050d": {
"attribute_name": "active_power_max"
},
"0x050f": {
"attribute_name": "apparent_power"
},
"0x0510": {
"attribute_name": "power_factor"
}
}
},
"0xe001": {
"endpoint_attribute": null,
"attributes": {},
"unsupported_attributes": {}
}
},
"out_clusters": {
"0x000a": {
"endpoint_attribute": "time",
"attributes": {},
"unsupported_attributes": {}
},
"0x0019": {
"endpoint_attribute": "ota",
"attributes": {},
"unsupported_attributes": {}
}
}
},
"242": {
"device_type": {
"name": "PROXY_BASIC",
"id": 97
},
"profile_id": 41440,
"in_clusters": {},
"out_clusters": {
"0x0021": {
"endpoint_attribute": "green_power",
"attributes": {},
"unsupported_attributes": {}
}
}
}
}
}
}
Logs
Logs
[Paste the logs here]
Additional information
No response
About this issue
- Original URL
- State: open
- Created 7 months ago
- Comments: 17 (5 by maintainers)
Commits related to this issue
- Also use modified `MeteringClusterInnr` for SP234 See comment in #2781 https://github.com/zigpy/zha-device-handlers/issues/2781#issuecomment-1831044084 — committed to TheJulianJES/zha-device-handlers by TheJulianJES 7 months ago
- Fix energy and current divisors for Innr plugs, clean up (#2782) * Fix Metering divisor for Innr SP240 plug * Use `CustomCluster` for Innr 0xE001 manufacturer cluster This is to avoid test fail... — committed to zigpy/zha-device-handlers by TheJulianJES 7 months ago
- Fix energy and current divisors for Innr plugs, clean up (#2782) * Fix Metering divisor for Innr SP240 plug * Use `CustomCluster` for Innr 0xE001 manufacturer cluster This is to avoid test fail... — committed to elupus/zha-device-handlers by TheJulianJES 7 months ago
This is also an issue for the SP 242
My SP 234 was already on latest fw, so everything seems working with the modified one as I have been testing over last day or so.
SP 234 quirk changes have been working well.
Interesting I missed that fact that innr had fw updates posted. so I guess the quick need to be adjusted for that… I’m pulling it down and will update. @TheJulianJES should we move the SP 234 to a new issue sorry fop combining it with the SP 240!
Good to see the issue is resolved. Just for info: the SP 234 US plug had an issue in the first firmware with an incorrect divider that was fixed in a firmware update. That update also fixes a number of other issues and is available on https://github.com/Koenkk/zigbee-OTA/tree/master/images/Innr.
Amperage seems okay to me:
ac_current_divisor is 1000:
zha-e29ceebf7c284fe6a18d61622537f595-innr SP 234-bd4503f7c2ae9e99b0befd345d61ad65.json.txt
@tube0013 I’ve pushed some changes to:
To install the SP234 quirk easily as a custom quirk, use this:
SP234 custom quirk test code (click to exapnd)
Let me know if all your plug measurements are correct then.