Im trying to update my automation code for the recent TPLink change that moved the vaules from attributes to sensors. I cant get my template sensor to hold a value and the template sensor just reads “Unavailable”. They should hold “True” or “False” depending on the current. The commented out code was my previously working code. I initially tried it without replacing the " W" but that doesn’t work either. Note, its not a typo, I used to monitor Watts.
Lol. The ‘s’. Thats it. All working now. Interestingly, this code was cut and paste from another “solution” I googled. Thanks for your help. Also, yes I should convert this to a binary sensor. These are the problems you have when you’ve had the same RPi2 running since HA 0.6x!
The template format you use is now called legacy format. Although there are yet any plans to deprecate the old format, I personally think its better if you start using the modern format.