Yes from the driver code, I can muddle through that aspect. However, it contains available commands in the HE device for Push Button # and Double press Button #, Why have those if the intent was not to 'send' button actions to ESP device?
Like the contact sensor driver it contains no commands, since it only can receive open/close from binary sensors on ESP device.
Nevertheless, it obviously does not do what I was hoping for, to allow HE to send button presses to an ESP device. Currently, I have to use a switch component which is setup in ESPHome yaml to delay 2s then turn-off itself, simulating a button press (momentary action).
However, this method has flaws, although seldom, it can occur where the switch on the hubitat side is left in the on state, if the device disconnected from wifi for a moment. Then when it reconnects the HE will send its current state (ON) and the ESP device will in turn toggle the momentary switch action again, causing a bounce condition.
With an actual button press coming from the HE this would not occur for obvious reasons. I have used in my automations set switch to on, immediately followed by off, to cover this situation.
Another solution would be to have a switch driver that keeps the ability to Enable 'auto-off' as the default virtual switch does. So that it will always return on HE side as off no matter the state of communication to ESP device.
To do something like that, you would probably need to add (space/RAM allowing) the web server component to the ESPHome build on the device itself. You could then add a REST endpoint to trigger actions on the device.
@s1godfrey - I am seeing the same errors; and I am new to ESPHome. What did you do to resolve the error of "same device network ID exists"? What happened that made you say beware of duplicate IPs?