I’m trying to re-use some NodeMCU devices I programmed through the Arduino programming interface that I’ve been using since before implementing HASS. These have a PIR and a microwave sensor and do the following:
- while neither PIR or microwave sensor is triggered, it flashes an LED at 1Hz
- if either the PIR or microwave is triggered it flashes the LED at 2Hz
- if both are triggered simultaneously it turns the LED solid on and then sends a webhook to BlueIris
- solid LED resets after 30 seconds
I’ve got the NodeMCU working with Hass and ESPHome (to replace the webhook) but have no idea how to programme the NodeMCU to run the local logic (flashing the LED, monitoring for the PIR and microwave etc) while running under ESPHomeAPI.
Essentially, what I’m struggling with is how do I make it run the local logic as well as be an input for HASS?
Thanks.
Richard