Why characteristic.readValue could not read real current brightness values of lamps.

I try to get current brightness values of lamps in home.

It collects old values.

If I change brightness of a light in native Home app and come back to my app and use

characteristic.readValue(completionHandler: ...

to collect levels for all lights, I can get true value only for the lamp brightness has been changed in native Home app.

I could not find a way to get current lights brightness values.
Should not readValue  to get values from accessories directly not from data recorded in iPhone.



Replies

I "discovered" that if power state of lightbulb is 0 you can not read or write brightness level.

To get over this issue I read power state and if it was 0 I changed it to 1 first then change brightness level.

When reading brightness level just to show on screen if power state was 0
I just made it 0 in my indication system.

It is a shame that I could not read this in documentation.