I am currently trying to smartify my letterbox, so that I get a message when the postman delivers letters.
So I built a ltching circuit that powers up my esp8266 whenever the letterbox is opened and that one sets one pin to high so even if the letterbox is closed again that ESP keeps on running. If the code is done then the ESP sets the pin to low again and the whole circuit does not consume any power.
So far so good but now I am struggeling with what I need to make my ESP to do?
Is there a way to use ESPHome for this?
Or is it easier to program the ESP to connect to my WiFi and connect to Home Assistant via API? And if the API is the easier way what would I send the best? Any event directly? Or a status set from closed to open and react with a rule to get a notification.
Thanks for any hints pushing me into the right direction.
ESPhome does all of this for you via the HA API.
Otherwise you could use MQTT or a POST request to update HA if you coded your own solution.
I could suggest an alternative but won't scratch your itch
Yesterday I simply stuck a door sensor this to my letterbox and it took all of 10 seconds to position and affix. Any window/door (magnetic reed switch) will work. Note the Aqara uses Zigbee and will need a receiver.
I do not need the deep sleep verdion since the latching circuit switches the ESP off. There’s no energy consumption at all.
I think I will write the sketch myself. So the question is only if it makes more sense to use the API directly or start a MQTT broker and use that one?
Since I don’t use MQTT in my setup for the moment it might be better to use the API directly…