WiFi tracker using a binary_sensor

There’s nothing wrong with OP’s direct use of strings.

@appsgt69

Neither home or not_home are accepted values for a binary sensor, change them to on and off. If you want the frontend representation to be Home and Away like device trackers, you need to add device_class: presence to your sensor config.

FWIW, you can simplify your template:

value_template: "{{ is_state('sensor.redmi_7a_wifi_connection', 'Vodafone-Whole3.0') }}"

Another approach would be to use a “virtual” device tracker.