Report Configuration of a Sleepy device with zha-toolkit

My battery powered temperature sensors are sleepy devices.
That means that they can receive commands only when they are awake, and they are only awake when they are sending data.

Any command provided to the Zigbee network will generally be forgotten after 5-10 seconds. So if the device does not wake up during that time, the configuration command will “Timeout” and not be repeated.

With the custom_component ‘zha_toolkit’ you can repeat the report configuration as many times as you want with just one service call.

The next service call (sent using Development Tool > Services) configures temperature reporting for a Sonoff sensor to report for every 0.10°C change or at least every 5 minutes and no faster than every 5 seconds.

service: zha_toolkit.execute
data:
  ieee: sensor.principal_temperature
  command: conf_report
  endpoint: 1
  cluster: 0x402
  attribute: 0
  min_interval: 5
  max_interval: 300
  reportable_change: 10
  tries: 100
  event_done: zha_done

After launching this, with debug logging enabled for the component, the log shows:

2022-01-26 10:50:18 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] {'cmd_id': None, 'endpoint_id': 1, 'cluster_id': 1026, 'attr_id': 0, 'attr_type': None, 'attr_val': None, 'code': None, 'min_interval': 5, 'max_interval': 300, 'reportable_change': 10, 'dir': 0, 'manf': None, 'tries': 100, 'expect_reply': True, 'args': [], 'state_id': None, 'state_attr': None, 'allow_create': False, 'event_success': None, 'event_fail': None, 'event_done': 'zha_done', 'read_before_write': True, 'read_after_write': True, 'write_if_equal': False}
2022-01-26 10:50:18 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 1/100
2022-01-26 10:50:26 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 2/100
2022-01-26 10:50:34 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 3/100
2022-01-26 10:50:42 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 4/100
2022-01-26 10:50:50 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 5/100
2022-01-26 10:50:58 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 6/100
2022-01-26 10:51:06 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 7/100
2022-01-26 10:51:14 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 8/100
2022-01-26 10:51:22 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 9/100
2022-01-26 10:51:30 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 10/100
2022-01-26 10:51:38 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 11/100
2022-01-26 10:51:46 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 12/100
2022-01-26 10:51:54 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 13/100
2022-01-26 10:52:02 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try configure report(0,5,300,10,None) Try 14/100
2022-01-26 10:52:05 INFO (MainThread) [custom_components.zha_toolkit.zcl_attr] Configure report result: [[ConfigureReportingResponseRecord(status=0)]]
2022-01-26 10:52:05 DEBUG (MainThread) [custom_components.zha_toolkit] event_data {'ieee_org': 'sensor.principal_temperature', 'ieee': '00:12:4b:00:23:b3:ed:f5', 'command': 'conf_report', 'start_time': '2022-01-26T09:50:18.604518+00:00', 'errors': [], 'params': {'cmd_id': None, 'endpoint_id': 1, 'cluster_id': 1026, 'attr_id': 0, 'attr_type': None, 'attr_val': None, 'code': None, 'min_interval': 5, 'max_interval': 300, 'reportable_change': 10, 'dir': 0, 'manf': None, 'tries': 100, 'expect_reply': True, 'args': [], 'state_id': None, 'state_attr': None, 'allow_create': False, 'event_success': None, 'event_fail': None, 'event_done': 'zha_done', 'read_before_write': True, 'read_after_write': True, 'write_if_equal': False}, 'success': True, 'result_conf': [[ConfigureReportingResponseRecord(status=0)]]}
2022-01-26 10:52:05 DEBUG (MainThread) [custom_components.zha_toolkit] Fire zha_done -> {'ieee_org': 'sensor.principal_temperature', 'ieee': '00:12:4b:00:23:b3:ed:f5', 'command': 'conf_report', 'start_time': '2022-01-26T09:50:18.604518+00:00', 'errors': [], 'params': {'cmd_id': None, 'endpoint_id': 1, 'cluster_id': 1026, 'attr_id': 0, 'attr_type': None, 'attr_val': None, 'code': None, 'min_interval': 5, 'max_interval': 300, 'reportable_change': 10, 'dir': 0, 'manf': None, 'tries': 100, 'expect_reply': True, 'args': [], 'state_id': None, 'state_attr': None, 'allow_create': False, 'event_success': None, 'event_fail': None, 'event_done': 'zha_done', 'read_before_write': True, 'read_after_write': True, 'write_if_equal': False}, 'success': True, 'result_conf': [[ConfigureReportingResponseRecord(status=0)]]}

So it was set to try 100 times, but it succeeded on the 14th iteration (after about 2 minutes), so it stopped and fired the zha_done event because that is the event name that I chose to notify that the service ended.

The event report (Developer Tools > Events) looked like this:

{
    "event_type": "zha_done",
    "data": {
        "ieee_org": "sensor.principal_temperature",
        "ieee": "00:12:4b:00:23:b3:ed:f5",
        "command": "conf_report",
        "start_time": "2022-01-26T09:50:18.604518+00:00",
        "errors": [],
        "params": {
            "cmd_id": null,
            "endpoint_id": 1,
            "cluster_id": 1026,
            "attr_id": 0,
            "attr_type": null,
            "attr_val": null,
            "code": null,
            "min_interval": 5,
            "max_interval": 300,
            "reportable_change": 10,
            "dir": 0,
            "manf": null,
            "tries": 100,
            "expect_reply": true,
            "args": [],
            "state_id": null,
            "state_attr": null,
            "allow_create": false,
            "event_success": null,
            "event_fail": null,
            "event_done": "zha_done",
            "read_before_write": true,
            "read_after_write": true,
            "write_if_equal": false
        },
        "success": true,
        "result_conf": [
            [
                {
                    "status": 0,
                    "direction": null,
                    "attrid": null
                }
            ]
        ]
    },
    "origin": "LOCAL",
    "time_fired": "2022-01-26T09:52:05.351239+00:00",
    "context": {
        "id": "aa89fcaddd73684fe31a0c98adaf414f",
        "parent_id": null,
        "user_id": null
    }
}

I now have faster reporting on this sensor while I failed to do it manually quite a few times in the past.

In practice it reports at most every 20 seconds because that is the limit set by the developers.

5 Likes

I installed zha-toolkit but i could not understand, where should be this command?

service: zha_toolkit.execute
data:
ieee: sensor.principal_temperature
command: conf_report
endpoint: 1
cluster: 0x402
attribute: 0
min_interval: 5
max_interval: 300
reportable_change: 10
tries: 100
event_done: zha_done

You can click on this link to go to Developer Tools > Services . That is where you can call any service.

zha-toolkit evolved and you can enter (in text mode);

service: zha_toolkit.conf_report
data:
  ieee: sensor.principal_temperature
  endpoint: 1
  cluster: 0x402
  attribute: 0
  min_interval: 5
  max_interval: 300
  reportable_change: 10
  tries: 100
  event_done: zha_done

When you enter it in text mode you can click on “GO TO YAML MODE” and select your device using the drop down menu.

I think like this yes? it should be service: execute or zha_toolkt.conf_report ? How can you see logs? i checked “EVENTS” but i can not see like you

When I forked from zha_custom, there was a single service zha_custom.execute.
Now I created a service for each “command” so that the UI is representative for it - you’ll have the appropriate options in UI MODE.

Both do the same thing in the end - it’s just that “execute” requires “command” as an option .

To see the event results there are two option:

  1. Open another navigator tab, go to EVENTS (second on the right of SERVICES), enter “zha_done” in the field next to “START LISTENING”, then click that button.
    Then, go back to the tab where you have set up the service call and EXECUTE .
    You can return to the navigator TAB and wait until the event data appears.

  2. Enable debug logging for the component (see the documentation), and then look in the home-assistant.log file on your HA instance.

1 Like

At the end of the day, which one would you recommend I use right now? Also, doesn’t updating so frequently affect the battery negatively?

Execute exists mainly for legacy reasons, for you its easier to use the specific services.

Sending more packets requires more energy - you have to decide about the delay depending on your use case.

There is the minimum and maximum delay between reports (the SONOFF uses a minimum of 20s anyway), and there is the maximum change without reporting.

To regulate the temperature, I prefer a small minimum delay, and I have set the change to 0.15°C in the mean time because 0.10°C produced too much noise. A temperature update every 5 minutes is a personal preference which I might increase in the future because 0.15°C is ok.

When I no longer need to heat, I may change these settings to reduce the battery consumption during the warmer days.

1 Like

Thank you so much for details. So i need to create a services with your last shared code. So if in the future i need to cancel it, how to remove this service? By the way Isn’t this a permanent change to the code of the sensor itself? So when I move these sensors to another HA they work in factory data

You call the service only once (if it succeeds). You can check the report configuration with conf_report_read .

The device remembers the report configuration, in principle at least as long as it is in the network, sometimes only until the battery is flat/removed.

Because the device is sleepy, you call the service 1 time, but the “tries” parameter is high so that the command is sent until the device responds. You do the same for conf_report_read.

If the device responds with “Success” for the “conf_report” service, it will likely have the correct configuration, but personally I like to check it (which is why I added conf_report_read).

You can still set up an automation for this to set the autumn/winter configuration at a given date and the spring/summer configuration at another given date. It’s doable with one automation, but you may want to set two automations.

1 Like

@le_top I have successfully configured my SONOFF sensor and now wanted to read it out again with conf_report_read.
Unfortunately it will not work. After first try it sends event “zha_done” but without any result.
I used the following yaml:

service: zha_toolkit.conf_report_read
data:
  ieee: sensor.ewelink_th01_2dc82025_temperature
  endpoint: 1
  cluster: 1026
  event_done: zha_done
  tries: 100
  attribute: 0

Result is:

{
    "event_type": "zha_done",
    "data": {
        "zha_toolkit_version": "v0.7.27",
        "zigpy_version": "0.43.0",
        "zigpy_rf_version": "0.14.0",
        "ieee_org": "sensor.ewelink_th01_2dc82025_temperature",
        "ieee": "00:12:4b:00:25:20:c8:2d",
        "command": null,
        "command_data": null,
        "start_time": "2022-03-25T17:44:29.266003+00:00",
        "errors": [],
        "params": {
            "endpoint_id": 1,
            "cluster_id": 1026,
            "attr_id": 0,
            "dir": 0,
            "tries": 100,
            "expect_reply": true,
            "args": [],
            "event_done": "zha_done",
            "read_before_write": true,
            "read_after_write": true
        },
        "success": false,
        "result_conf": []
    },
    "origin": "LOCAL",
    "time_fired": "2022-03-25T17:44:57.290981+00:00",
    "context": {
        "id": "4eb37eba98dbf03d37738ea6b8b66db7",
        "parent_id": null,
        "user_id": null
    }
}

What I’m doing wrong?

I tried it myself - it turned out (as we can see in your event log due to the difference between start and end time) that only one request was made.

I fixed that in release 0.8.0 - however, on my own thermometers I am not getting a reply after 100 times now. The requests are sent though (I can see them on my sniffer). I hope you have more luck.

100 requests take about 8 minutes.

1 Like

Thank you for the fix! :slightly_smiling_face: I tried it out and it is requesting several times. There is an answer on try 3 and try 16. Event “zha_done” is not fired and answer cannot be decoded. See my log.

2022-03-26 09:25:38 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 1/100: read report configuration ([0],None)
2022-03-26 09:25:38 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:25:38 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:25:38 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:25:50 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not found: switch.schedule_f0503a
2022-03-26 09:26:06 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 2/100: read report configuration ([0],None)
2022-03-26 09:26:06 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:26:06 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:26:06 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:26:34 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 3/100: read report configuration ([0],None)
2022-03-26 09:26:34 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:26:34 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:26:34 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:26:51 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not found: switch.schedule_5fecde
2022-03-26 09:27:02 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 4/100: read report configuration ([0],None)
2022-03-26 09:27:02 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:27:02 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:27:02 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:27:20 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not found: switch.schedule_f0503a
2022-03-26 09:27:30 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 5/100: read report configuration ([0],None)
2022-03-26 09:27:30 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:27:30 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:27:30 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:27:58 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 6/100: read report configuration ([0],None)
2022-03-26 09:27:58 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:27:58 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:27:58 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:28:00 ERROR (MainThread) [zigpy.device] Failed to parse message (b'180409000000002905002c010a00') on cluster 1026, because Data is too short to contain 2 bytes
2022-03-26 09:28:26 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 7/100: read report configuration ([0],None)
2022-03-26 09:28:26 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:28:26 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:28:26 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:28:49 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not found: switch.schedule_b5e47d
2022-03-26 09:28:54 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 8/100: read report configuration ([0],None)
2022-03-26 09:28:54 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:28:54 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:28:54 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:29:06 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not found: switch.schedule_5fecde
2022-03-26 09:29:11 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not found: switch.mf_ffh_wi_fi_mf_home
2022-03-26 09:29:22 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 9/100: read report configuration ([0],None)
2022-03-26 09:29:22 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:29:22 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:29:22 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:29:50 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 10/100: read report configuration ([0],None)
2022-03-26 09:29:50 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:29:50 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:29:50 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:30:18 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 11/100: read report configuration ([0],None)
2022-03-26 09:30:18 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:30:18 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:30:18 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:30:46 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 12/100: read report configuration ([0],None)
2022-03-26 09:30:46 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:30:46 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:30:46 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:31:14 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 13/100: read report configuration ([0],None)
2022-03-26 09:31:14 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:31:14 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:31:14 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:31:42 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 14/100: read report configuration ([0],None)
2022-03-26 09:31:42 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:31:42 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:31:42 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:32:10 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 15/100: read report configuration ([0],None)
2022-03-26 09:32:10 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:32:10 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:32:10 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:32:38 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 16/100: read report configuration ([0],None)
2022-03-26 09:32:38 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:32:38 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:32:38 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:32:41 ERROR (MainThread) [zigpy.device] Failed to parse message (b'181a09000000002905002c010a00') on cluster 1026, because Data is too short to contain 2 bytes
2022-03-26 09:33:06 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 17/100: read report configuration ([0],None)
2022-03-26 09:33:06 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:33:06 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:33:06 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:33:11 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not found: switch.mf_ffh_wi_fi_mf_home
2022-03-26 09:33:14 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not found: switch.schedule_b5e47d
2022-03-26 09:33:22 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not found: switch.schedule_f0503a
2022-03-26 09:33:34 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 18/100: read report configuration ([0],None)
2022-03-26 09:33:34 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:33:34 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:33:34 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:34:02 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 19/100: read report configuration ([0],None)
2022-03-26 09:34:02 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:34:02 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:34:02 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:34:30 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 20/100: read report configuration ([0],None)
2022-03-26 09:34:30 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:34:30 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:34:30 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]
2022-03-26 09:34:58 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Try 21/100: read report configuration ([0],None)
2022-03-26 09:34:58 DEBUG (MainThread) [custom_components.zha_toolkit.zcl_attr] Before call
2022-03-26 09:34:58 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Record 0 0
2022-03-26 09:34:58 WARNING (MainThread) [custom_components.zha_toolkit.zcl_attr] Read reporting with [ReadReportingConfigRecord(direction=0, attrid=0)]

Ok,

  1. I forgot that this is subject to a zigpy “bug” which is fixed but not tagged yet in a zigpy release. The highest tag is 0.42.0 .
  2. In some cases the response is more or less decoded and I guess that this is what happened when I last used it.
  3. b’181a09000000002905002c010a00’ is of course a reply.

A “hack” could be done to adjust zigpy, but I was actually hoping that the fix will be in HA in reasonable time.

Hi,
I assume following decoding info:

b’181a09000000002905002c010a00’ 0a00 (dec. 10) equal to “reportable_change”
b’181a09000000002905002c010a00’ 2c01 (dec. 300) equal to “max_interval”
b’181a09000000002905002c010a00’ 0500 (dec. 5) equal to “min_interval”

Is my assumption correct?

The rest is unknown.

  • 18 → FrameControl
  • 1a → TSN (Sequence number)
  • 09 → Read Reporting Configuration Response
  • 00 → success
  • 00 → direction 0
  • 0000 → attrid 0
  • 29 → Datatype 0x29 - Signed 16bit int
  • 0500 → 0x0005 - Min report interval
  • 2c01 → 0x012c - Max report interval
  • 0a00 → 0x000a - Reportable change
1 Like

Thank you very much for your help and also creating zha-toolkit :slightly_smiling_face:

Hi le_top,

I wanted to read out config again. But now it is not working anymore:

service: zha_toolkit.conf_report_read
data:
  ieee: sensor.ewelink_th01_2dc82025_temperature
  endpoint: 1
  cluster: 1026
  event_done: zha_done
  tries: 100
  attribute: 0

Response:

{
    "event_type": "zha_done",
    "data": {
        "zha_toolkit_version": "v0.8.4",
        "zigpy_version": "0.44.2",
        "zigpy_rf_version": "0.14.0",
        "ieee_org": "sensor.ewelink_th01_2dc82025_temperature",
        "ieee": "00:12:4b:00:25:20:c8:2d",
        "command": null,
        "command_data": null,
        "start_time": "2022-04-22T08:15:19.211072+00:00",
        "errors": [
            "TypeError(\"'str' object is not callable\")"
        ],
        "params": {
            "endpoint_id": 1,
            "cluster_id": 1026,
            "attr_id": 0,
            "dir": 0,
            "tries": 20,
            "expect_reply": true,
            "args": [],
            "event_done": "zha_done",
            "read_before_write": true,
            "read_after_write": true
        },
        "success": false
    },
    "origin": "LOCAL",
    "time_fired": "2022-04-22T08:15:19.219134+00:00",
    "context": {
        "id": "bcc0183a12aef9eff2ed5daccd694abe",
        "parent_id": null,
        "user_id": null
    }
}

Can you please help?

Thanks!

This is more something for an issue on github.
Any, I have the same sensor type so it was easy to reproduce.

To fix it I need to find out how the zigpy changes affect this. This part of the code did not change, but zigpy did undergo important changes.

I updated to v0.8.5 - my TH01’s are not responding right now, but I got rid of the error and my Zigbee Packet sniffer shows that the Read configuration requests are really sent by the coordinator.

Now everthing is working fine for me. Thanks!

I have a question regarding zha_toolkit.conf_report(_read) for SONOFF SNZB02. Is the min/max _interval and reportable_change valid for temperature and humidity sensor?