I’m trying to create a sensor template from an attribute on a TP-Link HS-110 and I’m stuck.
My goal is to create a sensor that is either “on” if the current consumption is above 1 watt or “off” if it’s below 1 watt.
I’ve found this code that removes the “W” from the current consumption attribute, but struggling to make the rest.
Any help would be much appreciated
value_template: '{{ states.switch.tplink1.attributes["Current consumption"] | replace(" W", "") | float }}'