Why doesn't work 'capability'?

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.

  1. change profile
  • added the capability
      - id: atmosphericPressureMeasurement
        version: 1
  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

Hi @TheLightWay

It’s not your problem, it’s a platform problem.

Something has changed with the management of the caches of the app, hub, …

Wait 30 minutes, clear the app cache.
The capability value will appear and when it appears the first time you will no longer have a problem.

it’s a nightmare!!!?

3 Likes