Java Runtime Environment: openjdk version “1.8.0_232”
openHAB version: 2.5.0M5
Issue of the topic:
I have two Window Contacts connected to my GPIOs and I can see GPIO value changing as expected using "gpio read ". The command returns 0 for an open and 1 for a closed window. Unfortunately, openHAB does not seem to pick any change of state: When I open a window, there are no updates in the event.log.
events.log related to the issue
2019-12-01 15:22:54.204 [ome.event.ItemUpdatedEvent] - Item 'GF_Kitchen_Window' has been updated.
2019-12-01 15:22:54.206 [ome.event.ItemUpdatedEvent] - Item 'GF_LivingDining_Window' has been updated.
2019-12-01 15:22:56.212 [vent.ItemStateChangedEvent] - GF_Kitchen_Window changed from NULL to UNDEF
2019-12-01 15:22:56.215 [GroupItemStateChangedEvent] - gWindow changed from NULL to CLOSED through GF_Kitchen_Window
2019-12-01 15:22:58.220 [vent.ItemStateChangedEvent] - GF_LivingDining_Window changed from NULL to UNDEF
2019-12-01 15:22:58.718 [vent.ItemStateChangedEvent] - GF_Kitchen_Window changed from UNDEF to CLOSED
2019-12-01 15:22:59.221 [vent.ItemStateChangedEvent] - GF_LivingDining_Window changed from UNDEF to CLOSED
After initializing the new GPIO item, it’s status goes from UNDEF to CLOSED, no matter whether the window is open or not. The gpio command however always gets the expected value (0 for OPEN and 1 for CLOSED).
MQTT would be a workaround, but I’d prefer to work with a built-in solution.
Quite possible, this is my first time connecting external components to GPIO. I’ve built everything according to this howto. I was under the assumption that the 10k resistor is the pull-up/-down resistor you mentioned. But maybe I’m missing something.
You might need either a pullup or a pulldown depending on how your circuit is configured. It’s to ensure a wire connected to an open circuit switch is pulled to a known voltage, not left “floating”. If the resistor pulls to the same voltage as the switch when active … then nothing ever changes.
Get a meter and check voltage at your GPIO pin in both states.
I know little about the binding but this looks relevant