The state of sensor.bluetooth_proxy_miscale_weight must go from below 80 to above 80 in order to trigger. If it’s already above 80 nothing will happen.
has the state of sensor.bluetooth_proxy_miscale_weight changed since you added the template sensor? The state needs to change in order for the trigger to trigger.
Your code looks fine, so just an idea: since you don’t define a unique_id; if you change the details of the sensor and reload the yaml, HA will think you’ve defined a new sensor. If you didn’t change the name, HA will add an _2 or _3 etc to the entity ID to avoid conflicting with the first one.
So the scenario is:
you created the YAML sensor, unknowingly made a mistake in the template, and reloaded the YAML.
Saw that the sensor called sensor.v_my_weight2 was “unknown” so went back into the code and fixed the template and reloaded the yaml
Looked at the original sensor entity ID and saw that sensor.v_my_weight2 was still unknown without realizing that you should instead be looking at an entitiy ID that is sensor.v_my_weight2_2
That template isn’t going to achieve anything, but I’m not sure what your end goal is either.
If you want to track every weight that is below 80 on one entity, and every weight that is above (or equal to 80) on another entity, this would be one option:
Well, yours is certainly shorter (nicer), but mine did work, if the weight was below 80, it did not update v_my_weight. I planned to duplicate that for another that is below 80.
Anyway, thanks for your script, there is a lot of new stuff such as this.state
Mine sends both weight and impedance. The impedance is used for statistics like muscle mass.
The weight sensor is updated first and then the impedance sensor. By triggering on the impedance sensor I ensure I combine both weight and impedance of the same person. Otherwise it could be that I use the weight of one person, and the impedance of the person who used the scale earlier