I am trying to run a callback whenever an entity is not in a certain state.
This is the entity: input_boolean.debug_switch_3
I want the listen_state to fire whenever it is not in state on (for example).
I have this code:
self.listen_state( self._wait_for_cb, entity=entity, new=lambda x: x != "on" )
I’d expect this to run the callback _wait_for_cb to be called whenever the state of input_boolean.debug_switch_3 changes to something that is not on.
What is happening though is that the callback is called whenever any entity has a statechange to anything but on:
2026-01-16 17:13:42.352969 INFO adsequence: sequencetest: wait_for_callback has been activated for entity sensor.wohnzimmer_aussenschalter_power_b
2026-01-16 17:13:42.357072 INFO adsequence: sequencetest: wait_for_callback has been activated for entity sensor.wohnzimmer_aussenschalter_voltage
2026-01-16 17:13:42.361528 INFO adsequence: sequencetest: wait_for_callback has been activated for entity sensor.wohnzimmer_aussenschalter_frequency
Am I using the lambda wrong? Or is it just not supposed to work the way I expect it to work?
Any help is appreciated! ![]()