ioBroker / ioBroker.type-detector

Helper module (not adapter) to detect types of devices
MIT License
8 stars 9 forks source link

proposal: remove state for ON_ACTUAL for all light devices #25

Closed Garfonso closed 2 years ago

Garfonso commented 2 years ago

A lot of the different light devices have an ON_ACTUAL / ACTUAL state that is for feedback from the lamp that the light is on (CT was missing this state, this PR will add it to CT, too, for sake of harmonization of light devices).

Currently, these ON_ACTUAL states are quite a mess... the biggest issue is, that the role state is allowed. This leads to a lot of miss detection, because state is so generic. I see them in zigbee and also in shelly lights. They both have some states that match the readOnly criterion and have the state-role. This leads to issue in adapters that try to read the current state from those wrong detected states... :-/

I could not yet find any lamp devices that report its status via a second object. I'd be happy to add testing for such devices. So I could not find out if they really use the role state for those objects. If so, I'd say that should be changed in the affected adapters.

So, in this PR I disallow state for ON_ACTUAL, but allow state.light, switch.light, sensor.light and switch on all light devices.

Additionally, to changing the regex for the ON_ACTUAL state, I also changed the default role. It was switch.light and state.light for different devices. Both are not good default roles, switch does not fit, because it is used to control things (i.e. mismatch for a read only state) and state is generic. For boolean read-only there is the category sensor and the dev docs already explicitly describe sensor.light as 'feedback from lamp, that it is ON' which is exactly what ON_ACTUAL / ACTUAL is for. So I changed default role to sensor.light. But the new regex will still detect the old roles.

GermanBluefox commented 2 years ago

I could not yet find any lamp devices that report its status via a second object.

KNX :(

Garfonso commented 2 years ago

I could not yet find any lamp devices that report its status via a second object.

KNX :(

Yes, KNX is true. I myself have KNX devices. But KNX adapter does not know anything about the devices, so can not apply any useful roles (in context of type detector), so KNX users depend on alias feature, anyway, today... :-/