-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zigbee attribute reporting #5
Comments
Could you solve this in the meantime? |
Hey - I'm not sure if I should post in this issue or create a new one, but I'll start here. I'm also having trouble getting reporting to work (I use Z2M). I have successfully added the device to Z2M, and Z2M discovers the need clusters/attributes without any issue. Pressing the "refresh" button, or reading the attributes work, but when I update a value with If I add a zigbee:
id: "zb"
endpoints:
- num: 1
device_type: SIMPLE_SENSOR
clusters:
- id: OCCUPANCY_SENSING
attributes:
- id: 0x0000
type: 8BITMAP
report: true
- id: 0x0001
type: 8BIT_ENUM
value: 0x0
- id: 0x0002
type: 8BITMAP
value: 0x0
- id: ILLUMINANCE_MEASUREMENT
attributes:
- id: 0x0000
type: U16
report: true
- id: 0x0004
type: U16
value: 0x0
binary_sensor:
- platform: LD2412
has_target:
name: Presence
on_state:
then:
- zigbee.setAttr:
id: zb
endpoint: 1
cluster: OCCUPANCY_SENSING
attribute: 0x0000
value: !lambda "return x;"
- zigbee.report: zb
sensor:
- platform: bh1750
name: Illuminance
address: 0x23
update_interval: 10s
filters:
- delta: 8
on_value:
then:
- zigbee.setAttr:
id: zb
endpoint: 1
cluster: ILLUMINANCE_MEASUREMENT
attribute: 0x0000
value: !lambda "return x;"
- zigbee.report: zb I'm not sure where to go from here, so any help would be appreciated. |
Try to add
Yes, that is only a workaround and would use another reporting mechanism. Is there anything in the logs? |
I just updated to the new syntax (good job with that btw), and get the same behavior as before (with zigbee:
id: "zb"
endpoints:
- num: 1
device_type: SIMPLE_SENSOR
clusters:
- id: OCCUPANCY_SENSING
attributes:
- attribute_id: 0x0000
type: 8BITMAP
report: true
device: occupancy
- attribute_id: 0x0001
type: 8BIT_ENUM
value: 0x0
- attribute_id: 0x0002
type: 8BITMAP
value: 0x0
- id: ILLUMINANCE_MEASUREMENT
attributes:
- attribute_id: 0x0000
type: U16
value: 0
report: true
device: illuminance
- attribute_id: 0x0004
type: U16
value: 0x0
sensor:
- platform: bh1750
id: illuminance
name: Illuminance
address: 0x23
update_interval: 10s
filters:
- delta: 8
binary_sensor:
- platform: LD2412
has_target:
id: occupancy
name: Presence Here's the relevant zigbee logs (I think):
I also see this in the logs at random times:
|
For illuminance: The main issue is that the zigbee attribute value is not in lux. You need to add a lambda I have the same setup working fine. Will add my config once I get back on my PC. I would also change simple_sensor to light_sensor. |
Please do share, maybe I've done something stupid. I tried with light_sensor, and the lambda (before I had a custom extend to handle the lux conversion, I also removed that. It's all default modern extends now), but I still get the same results:
Min rep change in Z2M is 5, so that should have been reported right? If I press refresh I do get the correct values. Update:
|
Thanks for the update/logs. There seems to be a setup specific issue, I also saw some discussions about this in arduino issue reports. You are right I will try to investigate and see how they solved it in arduino. Could you provide more information?
(please remove any sensitive information) |
Coordinator: Sonoff Dongle-P: Full ESP config: esphome:
name: zigbeetest
friendly_name: ZigbeeTest
esp32:
board: esp32-c6-devkitc-1
flash_size: 4MB
partitions: partitions_zb.csv
framework:
type: esp-idf
sdkconfig_options:
CONFIG_ESPTOOLPY_FLASHSIZE_4MB: y
external_components:
- source: github://luar123/zigbee_esphome
components: [ zigbee ]
logger:
level: DEBUG
hardware_uart: USB_SERIAL_JTAG
i2c:
sda: GPIO22
scl: GPIO23
scan: false
zigbee:
id: "zb"
endpoints:
- num: 1
device_type: LIGHT_SENSOR
clusters:
- id: ILLUMINANCE_MEASUREMENT
attributes:
- id: illuminance_attr
attribute_id: 0x0000
type: U16
value: 0x0
report: true
#device: illuminance
- attribute_id: 0x0004
type: U16
value: 0x0
on_join:
then:
- logger.log: "Joined network"
sensor:
- platform: bh1750
id: illuminance
name: Illuminance
address: 0x23
update_interval: 10s
on_value:
then:
- zigbee.setAttr:
id: illuminance_attr
value: !lambda "return 10000*log10(x)+1;"
#- zigbee.report: zb ESP32-C6 boot logs:
Z2M interview logs: Z2M receive logs (Let me know if I missed anything):
Screenshots (sorry about the snow, forgot to disable it for the screenshots): Let me know if I missed anything. As a note I also tried connecting it to the coordinator directly with the same result. |
Thanks, I will look into this, but could take a while. |
Please try the latest commit, might or might not help. I don't really know whats wrong, but there are a couple of things we could try. |
Hello, I did some tests with Z2M some months ago but the results weren't better than ZHA. Coordinator: SMLIGHT SLZB-07 - type EZSP v12 Config: sensor:
- platform: bme280_i2c
address: 0x76
update_interval: 10s
temperature:
id: bme280_temperature
name: "BME280 Temperature"
oversampling: 16x
humidity:
id: bme280_humidity
name: "BME280 Humidity"
pressure:
id: bme280_pressure
name: "BME280 Pressure"
zigbee:
id: "zb"
endpoints:
- device_type: TEMPERATURE_SENSOR
num: 1
clusters:
- id: REL_HUMIDITY_MEASUREMENT
attributes:
- attribute_id: 0
type: U16
report: true
value: 200
device: bme280_humidity
scale: 100
- id: TEMP_MEASUREMENT
attributes:
- attribute_id: 0x0
type: S16
report: true
value: 100
device: bme280_temperature
scale: 100
- id: PRESSURE_MEASUREMENT
attributes:
- attribute_id: 0x0
type: S16
report: true
value: 100
device: bme280_pressure ESP Logs:
Z2M logs:
I'll try to update one a my "production" board to see if it works with ZHA too. |
Sorry for the delayed response. I just tried again using the new commit, but I still see the same pattern. |
I want to update to the latest zigbee sdk 1.6.1 (same as arduino uses). If that doesn't help you could send me your Arduino code, then I can compare. |
@patrickfnielsen: please try esp sdk 1.6.1 version. |
I tried the latest version, but I cant seem to get over a panic now:
It seems to happen after sending. Same YAML as before. |
Sorry, forgot to test the SetAttr action with the latest changes. Should work now. |
@luar123 I did another test, and it seems to work as expected now! Thanks a lot for the help, and the great project! |
Updated to the last version and everything is working fine too 👍 |
This came up in #4:
There are multiple ways of attribute reporting available:
zigbee.report
for all attributes that are written withzigbee.setAttr
report: true
for an attribute with setting: min_interval = 10, max_interval = 0, delta = 0 -> report on every attribute change, but no periodic reporting. This setting is hardcoded at the moment, but can be overwritten by the coordinator (e.g. zigbee2mqtt)esphome_zb_sensor uses the brute-force method: Whenever the attribute is set, a report command is issued. If you want to replicate this (I won't recommend) run
zigbee.report
afterzigbee.setAttr
.Important: If you use z2m with the default settings and either no custom configuration for your device or using the modern extend functions, reporting settings might get overwritten. E.g. for temperature it is set to an interval between 10s and 1h and a difference of 1°C: https://github.com/Koenkk/zigbee-herdsman-converters/blob/41b26f2025b0627f984ccf0da65ca4051bd404f0/src/lib/modernExtend.ts#L561
You can always change these settings through the web frontend.
The text was updated successfully, but these errors were encountered: