Sonoff SNZB-02 only reporting on 0.5 degrees change or after 15 Minutes

I bought an Sonoff SNZB-02 and noticed it only reported, when temperature changed > 0.5 degrees or after 15 minutes.

That is way too much, and the reporting interval for the humidity is too high.

Is there any way to change this ?

I tried it with the cluster Command tolerance but it didn’t work (I was also missing the Manufacturer Code Override)

I heard there is a Setting in Zigbee2Mqtt, but I’d rather stay on ZHA.

Is there any way to set this ?

Edit I found out that it apparrently it is possible to do so while reconfiguring, if someone could point me in the direction where this is done in code, I could look into it.

Ok I found the line that should be responsible for this in zigpy

Now unfortunately I am not quite sure how this is called or where I would change/configure Zigpy to change this Setting.

IMHO this is set in core/ at 3d0d0385976f76ee173df681c90aa05a9732c359 · home-assistant/core · GitHub .

It would be nice to have at least a Service allowing to configure reporting of ZHA devices.

You are absolutely corrct, I sshed into the corehost and changed the file with vi, now my TH1 reports when it changes 0.1 degrees.

How is this not a variable that we can set in ZHA ?

Gonna start an Issue in Github right now.

Edit: not sure where to start the Issue tbh, since “Feature Requests” are on the Forum, however is this really a feature request ?

Might just have to write the code myself and start a PR, but I got no Idea how to access the config from the core code

That’s how it works.

Do you have a ressource handy where I can check out how to get Data from the configuration.yaml into the module ?

So far I figured data is loaded in with voluptuous and then stored in, but I am not quite sure.

That seems to be handling UI Input if I understand that correctly, for the start it would be easier to get the data from the configuration.yaml instead :slight_smile:

EDIT: just read that YAML Config is no longer being accepted.

I still don’t quite get all the Strings with config_flow, but I think I am getting into it.

OK I got as far as using async_get_zha_config_value to get the Value from the Configuration,
Unfortunately, I need the data in the file, however async_get_zha_config_value needs the config entry from the gateway, in the other components like they can just call zha_device.gateway.config_entry.
However, I have not found a way to get to the config_entry in the file.

I think after I find that out it should be good to go.

The most generic implementation would be to add a service into zha (services.yaml, and related python files) so that a reporting configuration can be sent to any cluster for any attribute. This is available from Developer Tools and can as far as I understand it be used as an action (in automations, etc
I think that the report configuration is only sent when the device is added to the zigbee network or when you explicitly request to reconfigure it. So setting it manually later on should do the trick and one could create an automation to revive the setting if needed.

I just came accross the “zha_custom” component: GitHub - Adminiuga/zha_custom: "zha_custom" component for Home Assistant. Zigpy commands service wrapper after finding information about it on the “zigpy” page.

I haven’t checked it out yet, but it looks like a good starting place to add missing “services” with regards to Zigbee. The ‘services.yaml’ looks rather empty though.

I cloned the repository to add a version number to the manifest, start a readme with some examples, and made some tests.

From the developer tools, one can call a command in developer mode, using yaml.

service: zha_custom.execute
  ieee: 00:15:8d:00:04:7b:83:69
  command: bind_ieee
  command_data: 00:12:4b:00:22:08:ed:1a

The available commands can be found in (they start with command_handler) and the implementations are in the accompanying python files.
So this is a good start, but needs tuning and extra commands.

I updated the zha_custom component I mentioned above and I was able to change the temperature reporting configuration on a SonOff Temperature sensor by calling the service from the “Developer Tools > Services”.