Thought Id’ try this here before creating a PR, in case there is some fundamental flaw to the idea.
While developing a Plant Card for Lovelace we wanted to access the configured min/max-values for moisture, temperature etc. from the Plant domain to display different states in the card.
This could be easily solved by adding another dict to the Plant State Attributes containing the configured (and/or default-) values.
This would also help creating better automatons for plants, as the current State only shows there is a “problem”, but the actual problems is just a comma separated list of “XXXX high” and “YYYY low”, and you don’t know how serious the issue really is.
E.g. I probably dont need to take any actions if moisture just 1% below the “minimum” mark, and rain is predicted in a few hours…
So my idea is to add something like the following at the top of /components/plant/init.py
ATTR_CONFIG = "config"
And around line 355:
ATTR_CONFIG: {
CONF_MIN_BATTERY_LEVEL: self._config[CONF_MIN_BATTERY_LEVEL]
CONF_MIN_TEMPERATURE: self._config[CONF_MIN_TEMPERATURE]
CONF_MAX_TEMPERATURE: self._config[CONF_MAX_TEMPERATURE]
CONF_MIN_MOISTURE: self._config[CONF_MIN_MOISTURE]
CONF_MAX_MOISTURE: self._config[CONF_MAX_MOISTURE]
CONF_MIN_CONDUCTIVITY: self._config[CONF_MIN_CONDUCTIVITY]
CONF_MAX_CONDUCTIVITY: self._config[CONF_MAX_CONDUCTIVITY]
CONF_MIN_BRIGHTNESS: self._config[CONF_MIN_BRIGHTNESS]
CONF_MAX_BRIGHTNESS: self._config[CONF_MAX_BRIGHTNESS]
CONF_CHECK_DAYS: self._config[CONF_CHECK_DAYS]
}
(Not tested in production)
But I am not sure if adding configured values to a State object is the wrong path, and this should be resolved in another way.