Apparently, the status of item haard_eetkamer_winter_OFF never changes to ON (unless “auto-update” is enabled), and later doesn’t get an update to OFF (which I would expect from switch.template.publish).
2024-11-04 23:32:02.808 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'haard_salon_winter_OFF' received command ON
2024-11-04 23:32:02.917 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'haard_salon_IN3' changed from OFF to ON
2024-11-04 23:32:10.924 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'haard_salon_IN3' changed from ON to OFF
These are the DEBUG logs:
2024-11-04 23:32:02.834 [DEBUG] [me.internal.comm.AbstractFrameHelper] - [haard-salon] Sending message type SwitchCommandRequest with content 'key: 2499407148
state: true'
2024-11-04 23:32:02.834 [TRACE] [home.internal.comm.ESPHomeConnection] - [haard-salon] Writing data 30 bytes
2024-11-04 23:32:02.915 [TRACE] [ome.internal.comm.ConnectionSelector] - Num selected keys: 1
2024-11-04 23:32:02.915 [TRACE] [ome.internal.comm.ConnectionSelector] - Processing key readable=true
2024-11-04 23:32:02.915 [TRACE] [ome.internal.comm.ConnectionSelector] - Received data
2024-11-04 23:32:02.915 [TRACE] [me.internal.comm.AbstractFrameHelper] - [haard-salon] Received packet of type 26 with data [13, -9, 110, -120, 31, 16, 1]
2024-11-04 23:32:02.916 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Received message type SwitchStateResponse with content 'key: 529034999
state: true'
2024-11-04 23:32:03.299 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Sending ping
2024-11-04 23:32:03.300 [DEBUG] [me.internal.comm.AbstractFrameHelper] - [haard-salon] Sending message type PingRequest with content ''
2024-11-04 23:32:03.300 [TRACE] [home.internal.comm.ESPHomeConnection] - [haard-salon] Writing data 23 bytes
2024-11-04 23:32:03.325 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-eetkamer] Sending ping
2024-11-04 23:32:03.326 [DEBUG] [me.internal.comm.AbstractFrameHelper] - [haard-eetkamer] Sending message type PingRequest with content ''
2024-11-04 23:32:03.326 [TRACE] [home.internal.comm.ESPHomeConnection] - [haard-eetkamer] Writing data 23 bytes
2024-11-04 23:32:03.435 [TRACE] [ome.internal.comm.ConnectionSelector] - Num selected keys: 1
2024-11-04 23:32:03.435 [TRACE] [ome.internal.comm.ConnectionSelector] - Processing key readable=true
2024-11-04 23:32:03.435 [TRACE] [ome.internal.comm.ConnectionSelector] - Received data
2024-11-04 23:32:03.436 [TRACE] [me.internal.comm.AbstractFrameHelper] - [haard-eetkamer] Received packet of type 8 with data []
2024-11-04 23:32:03.436 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-eetkamer] Received message type PingResponse with content ''
2024-11-04 23:32:03.436 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-eetkamer] Received ping response
2024-11-04 23:32:03.436 [TRACE] [ome.internal.comm.ConnectionSelector] - Num selected keys: 1
2024-11-04 23:32:03.436 [TRACE] [ome.internal.comm.ConnectionSelector] - Processing key readable=true
2024-11-04 23:32:03.436 [TRACE] [ome.internal.comm.ConnectionSelector] - Received data
2024-11-04 23:32:03.437 [TRACE] [me.internal.comm.AbstractFrameHelper] - [haard-salon] Received packet of type 8 with data []
2024-11-04 23:32:03.437 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Received message type PingResponse with content ''
2024-11-04 23:32:03.437 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Received ping response
2024-11-04 23:32:10.921 [TRACE] [ome.internal.comm.ConnectionSelector] - Num selected keys: 1
2024-11-04 23:32:10.921 [TRACE] [ome.internal.comm.ConnectionSelector] - Processing key readable=true
2024-11-04 23:32:10.921 [TRACE] [ome.internal.comm.ConnectionSelector] - Received data
2024-11-04 23:32:10.922 [TRACE] [me.internal.comm.AbstractFrameHelper] - [haard-salon] Received packet of type 26 with data [13, -9, 110, -120, 31]
2024-11-04 23:32:10.922 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Received message type SwitchStateResponse with content 'key: 529034999'
2024-11-04 23:32:13.299 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Sending ping
2024-11-04 23:32:13.300 [DEBUG] [me.internal.comm.AbstractFrameHelper] - [haard-salon] Sending message type PingRequest with content ''
2024-11-04 23:32:13.300 [TRACE] [home.internal.comm.ESPHomeConnection] - [haard-salon] Writing data 23 bytes
2024-11-04 23:32:13.325 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-eetkamer] Sending ping
2024-11-04 23:32:13.325 [DEBUG] [me.internal.comm.AbstractFrameHelper] - [haard-eetkamer] Sending message type PingRequest with content ''
2024-11-04 23:32:13.326 [TRACE] [home.internal.comm.ESPHomeConnection] - [haard-eetkamer] Writing data 23 bytes
2024-11-04 23:32:13.359 [TRACE] [ome.internal.comm.ConnectionSelector] - Num selected keys: 1
2024-11-04 23:32:13.359 [TRACE] [ome.internal.comm.ConnectionSelector] - Processing key readable=true
2024-11-04 23:32:13.359 [TRACE] [ome.internal.comm.ConnectionSelector] - Received data
2024-11-04 23:32:13.359 [TRACE] [me.internal.comm.AbstractFrameHelper] - [haard-salon] Received packet of type 8 with data []
2024-11-04 23:32:13.359 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Received message type PingResponse with content ''
2024-11-04 23:32:13.360 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Received ping response
2024-11-04 23:32:13.363 [TRACE] [ome.internal.comm.ConnectionSelector] - Num selected keys: 1
2024-11-04 23:32:13.363 [TRACE] [ome.internal.comm.ConnectionSelector] - Processing key readable=true
2024-11-04 23:32:13.363 [TRACE] [ome.internal.comm.ConnectionSelector] - Received data
2024-11-04 23:32:13.363 [TRACE] [me.internal.comm.AbstractFrameHelper] - [haard-eetkamer] Received packet of type 8 with data []
2024-11-04 23:32:13.364 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-eetkamer] Received message type PingResponse with content ''
2024-11-04 23:32:13.364 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-eetkamer] Received ping response
2024-11-04 23:32:23.299 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Sending ping
2024-11-04 23:32:23.300 [DEBUG] [me.internal.comm.AbstractFrameHelper] - [haard-salon] Sending message type PingRequest with content ''
2024-11-04 23:32:23.300 [TRACE] [home.internal.comm.ESPHomeConnection] - [haard-salon] Writing data 23 bytes
2024-11-04 23:32:23.325 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-eetkamer] Sending ping
2024-11-04 23:32:23.326 [DEBUG] [me.internal.comm.AbstractFrameHelper] - [haard-eetkamer] Sending message type PingRequest with content ''
2024-11-04 23:32:23.326 [TRACE] [home.internal.comm.ESPHomeConnection] - [haard-eetkamer] Writing data 23 bytes
2024-11-04 23:32:23.374 [TRACE] [ome.internal.comm.ConnectionSelector] - Num selected keys: 0
2024-11-04 23:32:23.389 [TRACE] [ome.internal.comm.ConnectionSelector] - Num selected keys: 1
2024-11-04 23:32:23.389 [TRACE] [ome.internal.comm.ConnectionSelector] - Processing key readable=true
2024-11-04 23:32:23.389 [TRACE] [ome.internal.comm.ConnectionSelector] - Received data
2024-11-04 23:32:23.389 [TRACE] [me.internal.comm.AbstractFrameHelper] - [haard-eetkamer] Received packet of type 8 with data []
2024-11-04 23:32:23.390 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-eetkamer] Received message type PingResponse with content ''
2024-11-04 23:32:23.390 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-eetkamer] Received ping response
2024-11-04 23:32:23.394 [TRACE] [ome.internal.comm.ConnectionSelector] - Num selected keys: 1
2024-11-04 23:32:23.394 [TRACE] [ome.internal.comm.ConnectionSelector] - Processing key readable=true
2024-11-04 23:32:23.394 [TRACE] [ome.internal.comm.ConnectionSelector] - Received data
2024-11-04 23:32:23.395 [TRACE] [me.internal.comm.AbstractFrameHelper] - [haard-salon] Received packet of type 8 with data []
2024-11-04 23:32:23.395 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Received message type PingResponse with content ''
2024-11-04 23:32:23.395 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Received ping response
2024-11-04 23:32:33.299 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Sending ping
2024-11-04 23:32:33.300 [DEBUG] [me.internal.comm.AbstractFrameHelper] - [haard-salon] Sending message type PingRequest with content ''
2024-11-04 23:32:33.300 [TRACE] [home.internal.comm.ESPHomeConnection] - [haard-salon] Writing data 23 bytes
2024-11-04 23:32:33.325 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-eetkamer] Sending ping
2024-11-04 23:32:33.326 [DEBUG] [me.internal.comm.AbstractFrameHelper] - [haard-eetkamer] Sending message type PingRequest with content ''
2024-11-04 23:32:33.326 [TRACE] [home.internal.comm.ESPHomeConnection] - [haard-eetkamer] Writing data 23 bytes
2024-11-04 23:32:33.405 [TRACE] [ome.internal.comm.ConnectionSelector] - Num selected keys: 0
2024-11-04 23:32:33.418 [TRACE] [ome.internal.comm.ConnectionSelector] - Num selected keys: 1
2024-11-04 23:32:33.418 [TRACE] [ome.internal.comm.ConnectionSelector] - Processing key readable=true
2024-11-04 23:32:33.418 [TRACE] [ome.internal.comm.ConnectionSelector] - Received data
2024-11-04 23:32:33.418 [TRACE] [me.internal.comm.AbstractFrameHelper] - [haard-eetkamer] Received packet of type 8 with data []
2024-11-04 23:32:33.419 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-eetkamer] Received message type PingResponse with content ''
2024-11-04 23:32:33.419 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-eetkamer] Received ping response
2024-11-04 23:32:33.427 [TRACE] [ome.internal.comm.ConnectionSelector] - Num selected keys: 1
2024-11-04 23:32:33.428 [TRACE] [ome.internal.comm.ConnectionSelector] - Processing key readable=true
2024-11-04 23:32:33.428 [TRACE] [ome.internal.comm.ConnectionSelector] - Received data
2024-11-04 23:32:33.428 [TRACE] [me.internal.comm.AbstractFrameHelper] - [haard-salon] Received packet of type 8 with data []
2024-11-04 23:32:33.428 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Received message type PingResponse with content ''
2024-11-04 23:32:33.428 [DEBUG] [home.internal.handler.ESPHomeHandler] - [haard-salon] Received ping response
This are relevant parts of the ESP yaml:
esphome:
name: haard-salon
[...]
switch:
- platform: gpio
pin: GPIO33 #D5 ## The initial instructions were GPIO14, but according to the manual, that is "HIGH" on boot, so I chose another pin.
name: "IN3"
id: IN3
inverted: true
- platform: template
name: winter_OFF
id: winter_OFF
turn_on_action:
- then:
- switch.turn_on: IN3
- delay: 8s
- switch.turn_off: IN3
- switch.template.publish:
id: winter_OFF
state: OFF
It is clear from the log that haard-salon switch winter_OFF receives the command and sends state responses for IN3, but not for winter_OFF.
Guessing section:
I see that you use turn_on_action, but you don’t publish an ON state when the command is received, hence when you in the last line requests the state to change to OFF, no update is sent from the device as winter_OFF already (and probably always is) in state OFF.
Sometimes my fireplace (‘governed’ by an output relay run by ESP32) goes out without my command, and without the relevant switche in openHAB being turned OFF. I need to do some digging in the logs, obviously, but I wonder whether the ESPHome binding supports the Logger component?
In step 3, is ESPHOMEDEVICE a placeholder, and should I write the actual device name? Or is it really ESPHOMEDEVICE, and does that catch all logs from all devices?
Use ESPHOMEDEVICE, it is not a placeholder. It is the name of the logger that will receive the log statements from the device, and is referred to inside the binding. This is to avoid mixing binding log statements (OH) and device log statements (ESPHOME).
varmtvann in the log messages is just the name of the (my) esphome device, which in your case would be haard-salon, haard-eetkamer and others depending on whether you enable logging in each thing configuration.
Little bit off topic to this binding, but does someone know an easy way how to compile a firmware for esphome without home assistant? 95% of the available tutorials are for home assistant. I tried the “command line” approch on their wiki but failed because my windows 10 pc was missing an c++ addon. Tried to install it with Microsoft visual studio (?) But didnt help.
I just installed the brew package on my Mac, I assume a similar package is available on windows.
Comes with a nice web ui.
Also https://web.esphome.io/ exists which is supposed to be a light version of the full esphome setup. Have not tried though.
I installed ESPHome manually on a raspberry pi. I tried it on a pi 4 and a pi 5. The pi 5 is faster, but the pi 4 worked just fine. Once installed, you start the ESPHome console on the Pi, and access it with a browser. The console looks like what you see in the HA docs. You can then access the console from a windows or mac computer from a browser, using the IP address of the Pi.
The advantage of using the pi is that if you can reflash the3 OS and start over if you goof it up. For me, it was easier than trying to get up to speed with docker, and I didn’t get things installed on my windows computer that I may not want permanently.
I simply forgot at about this dependency when I merged this 6 month old PR, but I’ll try to find a way to mark the Bluetooth binding as an optional bundle/feature dependency. If any of you knows how to do this I’m happy for any hints