SONOFF-SNZB-02-Temperature-and-humidity-sensor
SONOFF-SNZB-02-Temperature-and-humidity-sensor copied to clipboard
Maximum report_delay is only 60 seconds with latest firmware
Values higher than 60 seconds are not accepted. Error in zigbee2mqtt log (example 120 seconds): error 2023-04-17 23:30:31: Publish 'set' 'report_delay' to '0x00124b00290f7b50' failed: 'Error: Write 0x00124b00290f7b50/1 genPowerCfg({"513":{"value":120,"type":33}}, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Data request failed with error: 'MAC transaction expired' (240))'
After sending a command from zigbee2mqtt to the sensor, I suppose the sensor itself should be woken up by pressing a button on it. After all, it's a sleeping device.
The message from zigbee2mqtt occurs exactly after the device wakes up. The delay seems to be ignored most of the time. It is reported as 30 seconds, but data comes very irregularly. Right now data was reported every 900 seconds, which is what I wanted, but I did not change anything during the last hours.
Here are some entries of the mqtt log:
info 2023-04-18 05:54:55: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":49.6,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":3,"low_hum":35,"low_temp":22,"report_delay":900,"temperature":19.2,"temperature_offset":0,"voltage":3500}' info 2023-04-18 05:57:55: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":45.4,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":3,"low_hum":35,"low_temp":22,"report_delay":900,"temperature":19.2,"temperature_offset":0,"voltage":3500}' info 2023-04-18 06:00:55: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":44.4,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":0,"low_hum":35,"low_temp":22,"report_delay":900,"temperature":19.2,"temperature_offset":0,"voltage":3500}' info 2023-04-18 06:03:55: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":43.8,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":0,"low_hum":35,"low_temp":22,"report_delay":900,"temperature":19.2,"temperature_offset":0,"voltage":3500}' info 2023-04-18 06:07:25: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":43.8,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":0,"low_hum":35,"low_temp":22,"report_delay":900,"temperature":19.1,"temperature_offset":0,"voltage":3500}' info 2023-04-18 06:09:55: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":43.2,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":0,"low_hum":35,"low_temp":22,"report_delay":900,"temperature":19.1,"temperature_offset":0,"voltage":3500}' info 2023-04-18 06:12:25: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":43.2,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":0,"low_hum":35,"low_temp":22,"report_delay":900,"temperature":19.1,"temperature_offset":0,"voltage":3500}' info 2023-04-18 06:12:26: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":43.2,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":0,"low_hum":35,"low_temp":22,"report_delay":900,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 06:12:26: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":43.2,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":3,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 06:12:26: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":43.2,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":0,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 06:12:26: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":43.2,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":3,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 06:18:54: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":42.7,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":3,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 06:36:54: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":42.3,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":0,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 06:45:54: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":41.9,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":0,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 07:12:24: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":41.9,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":3,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 07:18:53: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":42.3,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":0,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 07:21:53: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":43,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":3,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 07:27:53: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":44.4,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":14,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 07:30:53: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":42.8,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":7,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 07:33:53: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":46.8,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":7,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 07:36:53: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":40.9,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":18,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 07:37:23: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":40.9,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":7,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19,"temperature_offset":0,"voltage":3200}' info 2023-04-18 07:40:14: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":42.9,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":10,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19,"temperature_offset":0,"voltage":3200}' info 2023-04-18 07:43:14: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":43.9,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":25,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19,"temperature_offset":0,"voltage":3200}' info 2023-04-18 07:46:14: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":44.3,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":10,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19,"temperature_offset":0,"voltage":3200}' info 2023-04-18 07:52:14: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":44.8,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":10,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:10:14: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":46.8,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":0,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:10:44: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":46.8,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":0,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:12:44: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":46.8,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":3,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:16:14: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":46.4,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":3,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.1,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:19:43: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":46.4,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":3,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.2,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:22:13: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":46.4,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":7,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.3,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:22:13: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":54.2,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":3,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.3,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:25:13: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":46.1,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":21,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.3,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:29:43: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":46.1,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":18,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.2,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:34:13: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":46.6,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":25,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.2,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:37:13: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":47.3,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":21,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.2,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:40:13: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":47.8,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":14,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.2,"temperature_offset":0,"voltage":3200}' info 2023-04-18 08:46:13: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":48.3,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":21,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.2,"temperature_offset":0,"voltage":3200}' info 2023-04-18 09:12:43: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":48.3,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":18,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.2,"temperature_offset":0,"voltage":3200}' info 2023-04-18 09:19:13: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":47.9,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":18,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.2,"temperature_offset":0,"voltage":3200}' info 2023-04-18 09:34:12: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":47.4,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":21,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.2,"temperature_offset":0,"voltage":3200}' info 2023-04-18 09:46:12: MQTT publish: topic 'zigbee2mqtt/Temp1', payload '{"battery":100,"battery_low":false,"comparison_previous_data":"ON","enable_hum":"OFF","enable_temp":"OFF","high_hum":75,"high_temp":33,"humidity":47,"humidity_offset":-8.1,"invert_logic_hum":"OFF","invert_logic_temp":"OFF","linkquality":21,"low_hum":35,"low_temp":22,"report_delay":30,"temperature":19.2,"temperature_offset":0,"voltage":3200}'
In your prevoius version, the report_delay works as expected. The new version shows the correct value in mqtt, but does not really use it. Do you want to share your new code?
I can confirm peteho's observation: I have installed SNZB-02_EFEKTA_H.hex and set the report delay to 120 seconds:
Nevertheless the device (0xeed4) regularly wakes up every 55 seconds and sends reports to the coordinator as you can see in the wireshark trace:
BTW: I am also a developer. So would you mind to upload the source code in your repository to version SNZB-02_EFEKTA_H? I then can help to find the reason and contribute to further improve your excellent product.
I have done some more tests and now found the relation between
- what I setup with report_delay and
- the resulting interval for wakeup the chip and sending reports is
interval = report_delay mod 65
Example: report_delay 120 results in 55 seconds
Probably you use an internal variable (e.g. uint16 msReportDelay
) which takes the ReportDelay in seconds (as received from and sent to Zigbee) multiplied by 1000 (for milliseconds).
Because the variable is uint16
the maximum value is 65.536 so the multiplication result is modulo 65.536.
For scheduling the wakeup and report I assume you use
uint8 osal_start_timerEx( uint8 taskID, uint16 event_id, uint32 timeout_value )
which can take an uint32
.
Making sure that all variables involved in the interval calculation are uint32, would probaly solve the error.
I have also installed the latest version of your firmware SNZB-02_EFEKTA_H.hex, but the issue still persists. For example a report delay of 900 seconds, causes a delay of about 50 seconds. This behaviour will drain the battery. I have also noticed another issue, that settings do not survive a power loss (battery change). Also the default humidity offset is not 0, but -8.1. Maybe you can have a look at your code again and / or update the source in github. If you need more information or logs from my system, please feel free to ask.
900 seconds mod 65 = 55. That is what you see, too ("about 50 seconds"). You can only get a little bit more, see formula above.
To avoid draining the battery just enable comparison_previous_data
Don't forget to press the button every time you write new settings.
Reports then are only sent when either temperature or humidity changes. The battery is reported every 8 hours anyway. With those settings my battery has still 3100 mV after 2 months. (which is a value just as good as with original sonoff firmware).
@smartboxchannel Of course I'd appreciate it, if you could fix both issues
- max report delay (this)
- humidity control (#7)
Then the firmware cound be used for the purpose I wiped the original Sonoff for: "Having a hygrostat feature with direct binding to the dehumidifier relay".
Saving the settings in nvram is optional im my opinion. (BTW: An example how to do this can be found here: diyruz/freepad)
I can confirm, that enabling comparison_previous_data triggers reports after temperature or humidity changes. I cannot find the code for this attribute in the published source and I did not find any official description for it. It seems, that the "precision" setting has no effect on the compare algorithm, which could also help to avoid battery drain. @smartboxchannel still I would appreciate to have a look at the new source code.
Hi everyone, i have the same issue with the report interval, after some time the sensor stop comunnicate, can anyone solve this, or have the original firmware to remplace?
thank you