Hi,
I have an entity/sensor included into HA from an http rest api. More or less I have a number which i receive.
I can show these numbers correctly in the dashboard but when I try to run automations against the value of the entity I got stuck.
My first try was to choose the entity and use numeric state to set below/above values. But I can only choose the following attributes
Unit of measurements
Device Class
Friendly Name
but not the value itself. Which would be the most obvious one in my opinion. What am I doing wrong? Thanks in advance
Thomas
Maybe I said it a bit confused. I have a moisture sensor. Which has a value between 0 and 100. Integer to be exact. In my yaml config I have unit of measurement defined with a “%”. And I want to check for example do something if the value is below 40.
And that is not working afaik. Any suggestions?
Since we don’t see what you are doing all we can do is go by what you are saying.
And what you said was incorrect. Do not use the attribute field.
If you want more help then this the paste your code here.
This has arisen a few times before: people mistakenly think they must select an attribute, and then ask why their automation doesn’t work, because it’s looking for a change in the unit_of_measurement, for example.
@TommyMyName — just leave the attribute field empty, and then the automation will use the sensor state (which is a separate thing: think of it as the “primary attribute” if you like, and the others as “secondary”).
This bit of the UI could perhaps be tweaked to try to avoid the tendency of newbies to incorrectly populate the Attribute field.
As Troon and Hellis said, leave the attribute blank. You don’t need it. Attribute is for any sub attributes on an entity. You want the state, which is just the entity itself. Therefor you leave attribute blank.