After adding the alarm I wanted to reactivate my door or window opening detection scenes.
The problem is that the « Device state change » trigger works backwards for the opening sensor.
That is to say I’m forced to select the text Closed to detect opening!
If I’m not mistaken, the issue is no longer with the icon display (which seems perfectly consistent on my end) but rather concerns scene creation.
I also test the state change of my contact sensors and I have to indicate CLOSED when I want to
The problem comes from devices that return ‹ 1 › for ‹ open › and others that return ‹ 0 › for open…
A feature request to be able to ‹ invert the state ›?
A checkbox (@pierre-gilles is a fan) that would say ‹ my sensor returns inverted data › or…?
How is that handled? Because ultimately Gladys displays exactly what the sensor sends, 0 or 1. I think this logic needs to be inverted at that level, quite simply, so that when Gladys receives an open state from the sensor we treat it as an open window
Totally agree, it’s the device’s logic that doesn’t seem right to me, not the Gladys (gladys) core — it seems more logical to add a feature with a checkbox in the device settings to invert the values it returns and that would be more general (in case one day devices send « open » « closed » instead of 0 and 1!) or maybe it’s in the device integration that should take this behavior into account?
I might say something stupid but since I don’t have a door/contact sensor to test…
Can’t we simply handle the inverted value problem in the sensor settings by inverting the values like this?
I agree with you, the problem is that this will impact all devices, those that send a 0 for open and those that send 1 as @GBoulvin says.
Changing it directly in the integrated device resolves both cases, no?
(I only have MQTT so I can’t answer for the other cases, my idea may not be good indeed)
PS:
It’s the behavior of the sensor that sends 0 for closed that’s not intuitive!!! But in the case, for example, of a relay or a detector where there is NC and NO it makes sense, Gladys just needs to be able to handle these two cases!