I may have ended up very much over complicating things here so very open to other suggestions on how to improve this flow (that I’ve yet to get working anyway).
The basic need is: I have a blocked soak-away that when it rains heavy, the water level backs up and floods my garage. Based on the level of the presence of a high water level in the drain, I want to turn on a pump for a period of time to help evacuate the water away from the garage door.
I’ve started with two disconnected systems:
- Added a Water Leak detector using 433MHz wireless signals to an existing Weather Station monitoring system that captures the values in InfluxDB and reports via Grafana. I then have Grafana setup with an alert trigger to send me an email when the water leak detector value moves from 0 to 1.
- An Amazon branded Smart Plug with a routine then triggered by voice or the app to turn on the pump for 15 minutes.
I’ve been looking for a way to take the human out of the middle of this setup without really adjusting too much at either end of the solution already in place, and looked at Home Assistant with the free way of linking to Alexa as a possible way to achieve this (Alexa / HA integration all done and working).
My plan was to change the Grafana alert type to be a Webhook that to trigger an automation in HA (https:///api/webhook/garagepump) with Actions to set the condition state of a binary_sensor (device class: moisture) that I’ve created in the configuration.yaml file to “wet”, insert a delay of 15mins and then change the same binary_sensor’s state back to “dry”.
The plan was to then use the binary_sensor entity within the Alexa App to create a routine that when the state = ‘wet’ that she would move the Smart Plug state to “on”. At any other state of the binary_sensor entity, the Smart Plug state would be “off”.
What works is the webhook in HA itself (Postman returns a 200 code status). And the Smart Plug can be directly controlled in the Alexa App. Other than that I seem to be failing in all other angles.
Would the logic of what I am trying to achieve be possible? And if so, anyone got any pointers that would help eliminate what I am sure will be my own stupidity. Or is there a cleaner way to achieve the outcome that someone can see?
R. Mark