I’m sure there’s a simple way to do this, but I’m puzzled. I have two relays, one to open a valve and one to close the valve. I don’t want an automation to turn on a relay when it is already in the desired state). What’s the best way to have HA know what the current state is?
Hi Dan, I think (only started with ESPHome recently) you have to create a (binary) sensor in your ESP config which will be exposed to HA to be used as a state.
Please take the time to mark the post that helped you solving your issue as the solution so anyone who’s searching for this can benefit from it like you did.
You do that by selecting the three dots under the post:
Then select the check box:
Also, by doing so this prevents that someone else steps in to try to help.