Hey guys, been a minute since I posted around here.
Need some help; essentially trying to create a binary sensor, using a template to pull out the “moisture low” option from a plant sensor with a problem. So if the plant needs water, binary sensor is true, or if it doesn’t need water, it’s false.
Just to use a real world example:
{{ state_attr('plant.moneytree', 'problem') }}
Outputs: moisture low, conductivity low, brightness low
Which is great, but i’m only concerned with “moisture low”, since it’s the only thing I can really do anything about, aka water the plant. So how would I check for the presence of that one option out of a list of all possible options?
It seems like a template is the only option, since the sensor “sensor.moneytree_moisture” only reports the value of the moisture, not whether it’s above or below a threshold- which is why I like the plant integration for this. Would be quite annoying to have to make yet another sensor, with a static variable just to know if the moisture if below the certain threshold.
Ideally, it’d be great to create a sensor, which only reported those plants which needed water from all the plants in the plant domain. So that way if a plant was added, and needed water, it would dynamically be reported, instead of having to code each and every plant.
Cheers.