Ignore previous two comments. This from the post referenced earlier works fine in the template editor
{% if is_state('binary_sensor.dave_s22_wifi_state','on') and is_state('sensor.dave_s22_wifi_state','MyHomeWIFIName') %}
on
{% elif is_state('binary_sensor.brian_pixel6_wifi_state','on') and is_state('sensor.brian_pixel6_wifi_connection','MyHomeWIFIName') %}
on
{% else %}
off
{% endif %}
Change the sensor names and on and offs to Extern Charging etc and it should work!
(famous last words)
I had/have no idea what the syntax would be to do it in one line - template editor is a great place to try things out but I couldn’t get anywhere with one line approach.