Make Sensors act from "profiles"

Hi fellow makers,

I had the idea to automate my herb garden. Basically I have 4 humidity sensors in 4 different flowering pots measure the humidity and 4 pumps acting accordingly.
Now, for the logic behind that, i wanted create three different profiles for the flowering pots, namely “dry”, for herbs like thyme, “moist” for herbs like basil and something in-between. The plan was to fix these profiles in a database and make the sensors read them before pumping.

So for example, the flow would be:

Measuring humidity every hour → Pot 2 has an actual humidity of 17% → check in DB how much the profile expects the pot to have (for example 30% for a medium profile) → Pump for Pot 2 is activated for 10 seconds → rinse and repeat every hour until expected value is reached.

I understood that the standard Home Assistant DB can be manipulated with the average DB Tool but is there maybe also a possibility to do it directly from the WebUI? For example if I replant an herb to another pot and I want to change said pot from “dry” to “medium”.

Or does anyone have a completely different idea for the architecture to save said profiles?

Any nudge in the right direction is much appreciated!

Additional Info:
Running Home Assistant and esphome in Docker on Ubuntu.
Sensors and Actors are connected to an ESP32.

You can add custom attributes to any sensor.

So you could add something like this to your soil moisture sensors:

configuration.yaml

frontend:
  customize: !include customize.yaml

customize.yaml

sensor.thyme_soil_moisture:
  profile: "dry"  # alternatively you could add the actual % moisture target here. e.g.

sensor.basil_soil_moisture:
  target: 69 
1 Like

Awesome! Thanks for the quick help, I’ll try it out and post a feedback here if it’s of interest