This morning 10h were over and the 30sec-timer is not working correctly anymore - imeditate switch-off:
2023-09-16 04:20:26.240 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'i_PIR_EG_Occupancy' changed from CLOSED to OPEN
2023-09-16 04:20:26.245 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'i_SwBtn_Hallway_EG' received command ON
2023-09-16 04:20:26.249 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'i_SwBtn_Hallway_EG' predicted to become ON
2023-09-16 04:20:26.253 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'i_SwBtn_Hallway_EG' changed from OFF to ON
2023-09-16 04:20:26.283 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'i_SwBtn_Hallway_EG' received command ON
2023-09-16 04:20:26.286 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'i_SwBtn_Hallway_EG' predicted to become ON
2023-09-16 04:20:26.406 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'i_SwBtn_Hallway_EG' received command OFF
2023-09-16 04:20:26.410 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'i_SwBtn_Hallway_EG' predicted to become OFF
2023-09-16 04:20:26.413 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'i_SwBtn_Hallway_EG' changed from ON to OFF
2023-09-16 04:20:26.515 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'i_SwBtn_Hallway_EG' changed from OFF to ON
2023-09-16 04:20:41.251 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'i_PIR_EG_Occupancy' changed from OPEN to CLOSED
2023-09-16 04:20:26.283 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'i_SwBtn_Hallway_EG' received command ON
2023-09-16 04:20:26.286 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'i_SwBtn_Hallway_EG' predicted to become ON
2023-09-16 04:20:26.406 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'i_SwBtn_Hallway_EG' received command OFF
2023-09-16 04:20:26.410 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'i_SwBtn_Hallway_EG' predicted to become OFF
2023-09-16 04:20:26.413 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'i_SwBtn_Hallway_EG' changed from ON to OFF
2023-09-16 04:20:26.515 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'i_SwBtn_Hallway_EG' changed from OFF to ON
2023-09-16 04:20:27.550 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'i_SwBtn_Hallway_EG' changed from ON to OFF
After reloading the script it is working correcly again:
2023-09-16 05:05:09.711 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'i_SwBtn_Hallway_EG' received command OFF
2023-09-16 05:05:09.715 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'i_SwBtn_Hallway_EG' predicted to become OFF
2023-09-16 05:05:10.251 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'i_PIR_EG_Occupancy' changed from CLOSED to OPEN
2023-09-16 05:05:10.270 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'i_SwBtn_Hallway_EG' received command ON
2023-09-16 05:05:10.297 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'i_SwBtn_Hallway_EG' predicted to become ON
2023-09-16 05:05:10.306 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'i_SwBtn_Hallway_EG' received command ON
2023-09-16 05:05:10.312 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'i_SwBtn_Hallway_EG' changed from OFF to ON
2023-09-16 05:05:10.316 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'i_SwBtn_Hallway_EG' predicted to become ON
2023-09-16 05:05:25.203 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'i_PIR_EG_Occupancy' changed from OPEN to CLOSED
2023-09-16 05:05:40.307 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'i_SwBtn_Hallway_EG' received command OFF
2023-09-16 05:05:40.310 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'i_SwBtn_Hallway_EG' predicted to become OFF
2023-09-16 05:05:40.315 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'i_SwBtn_Hallway_EG' changed from ON to OFF
I also checked my rules: there is no other rule that is ascessing the switch.
Additionally I found out that sending a command to the switch will cause 2 mqtt commands.
Zigbee2mqtt logs this
Info 2023-09-16 04:28:16MQTT publish: topic 'zigbee2mqtt/PIR_EG', payload '{"battery":97,"device_temperature":30,"illuminance":0,"illuminance_lux":0,"linkquality":87,"occupancy":true,"power_outage_count":20,"voltage":2995}'
Info 2023-09-16 04:28:16MQTT publish: topic 'zigbee2mqtt/PIR_EG', payload '{"battery":97,"device_temperature":30,"illuminance":0,"illuminance_lux":0,"linkquality":91,"occupancy":true,"power_outage_count":20,"voltage":2995}'
Info 2023-09-16 04:28:16MQTT publish: topic 'zigbee2mqtt/SwBtn_EG', payload '{"linkquality":47,"state":"ON"}'
Info 2023-09-16 04:28:16MQTT publish: topic 'zigbee2mqtt/SwBtn_EG', payload '{"linkquality":47,"state":"ON"}'
Info 2023-09-16 04:28:16MQTT publish: topic 'zigbee2mqtt/SwBtn_EG', payload '{"linkquality":36,"state":"ON"}'
Info 2023-09-16 04:28:16MQTT publish: topic 'zigbee2mqtt/SwBtn_EG', payload '{"linkquality":32,"state":"ON"}'
Info 2023-09-16 04:28:17MQTT publish: topic 'zigbee2mqtt/SwBtn_EG', payload '{"linkquality":32,"state":"OFF"}'
Info 2023-09-16 04:28:17MQTT publish: topic 'zigbee2mqtt/SwBtn_EG', payload '{"linkquality":32,"state":"OFF"}'
Info 2023-09-16 04:28:31MQTT publish: topic 'zigbee2mqtt/PIR_EG', payload '{"battery":97,"device_temperature":30,"illuminance":0,"illuminance_lux":0,"linkquality":91,"occupancy":false,"power_outage_count":20,"voltage":2995}'
The respective thing definiton is like tihs
- id: SwBtn_Hallway_EG
channelTypeUID: mqtt:switch
label: SwBtn Hallway EG Channel
description: null
configuration:
commandTopic: zigbee2mqtt/SwBtn_EG/set
stateTopic: zigbee2mqtt/SwBtn_EG
transformationPattern: JSONPATH:$.state
off: OFF
on: ON
This is at least explainingg the higher amount of commands and state changes.
I checked it with my oh3 setup. The double mqqt commands are there as well.
But no issue with timer.
The next step I will do the instrumentation of the code as Rrlkoshak proposed.
Any further idea?
O.