Hello, community
I’m not a developer.
However, I’m modifying the edge driver with a little knowledge.
I was going to add capability to the existing edge driver.
the original edge driver is a zigbee-humidity-sensor.
(SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-humidity-sensor at main · SmartThingsCommunity/SmartThingsEdgeDrivers · GitHub)
and the capability I added is atmosphericPressureMeasurement…
But… the capability doesn’t work…
If I check the log, emit_event probably has no problem.
However, the value of capability is not updated…
As a temporary measure, switch to another edge driver… and then switch to my modified edge driver again, it works fine.
But something is definitely wrong…
I can’t sleep because of this problem…
I don’t know what I did wrong…
Please help me.
The process I modified is as follows.
- change profile
- added the capability
- id: atmosphericPressureMeasurement
version: 1
- change “init.lua” file
2-1) add zigbee_handlers
zigbee_handlers = {
attr = {
[PressureMeasurement.ID] = {
[PressureMeasurement.attributes.MeasuredValue.ID] = pressure_report_handler
}
}
},
2-2) add function
local function pressure_report_handler(driver, device, value, zb_rx)
local kPa = value.value/10
device:emit_event(capabilities.atmosphericPressureMeasurement.atmosphericPressure({value = kPa, unit = "kPa"}))
end