I wanted to have a binary sensor that basically shows me when I have excess power (when my battery is at more than 80% charge, the car is not charging and the solar panels produce energy.
So I basically try to check the state of three sensors and set another one on or off based off that.
This is what I came up with in my configuration.yaml:
I’m not sure why you are using “iif”, but apart from that what I would do to debug is start with 3 template sensors and then combine them. So the first 2 binary_sensors would be:
state: {{ states('sensor.powerwall_charge') | int > 80 }}
state: states('sensor.tesla_wall_connector_state') != '11'
or state: states('sensor.tesla_wall_connector_state'|int) != 11
and take it from there? Maybe it’s just the != 11 (afaik states are always strings)?