Custom Sensor How To?

I am admittedly in over my head here, but what better way to learn!? I am trying to figure out how people do cool stuff like this:

When looking at the Phone section there’s a Wifi On or Off. I know I can get to whether or not I am connected to my SSID when looking at device_tracker.phone_<name>. If I can get at the secondary attribute essid I can test for my SSID name.

I believe custom sensors are the way to go here, but I cannot figure out where to start:

  1. Are they stored in configuration.yaml?
  2. How does one go about configuring a custom sensor using the example above. If phone SSID = desired test string how do I return ON or OFF?

I want to keep it super simple in order to start wrapping my head around the basics.

Thanks much.

Yes using this:

Something like this:

  - binary_sensor:
      - name: "Wifi"
        state: "{{ is_state('sensor.your_ssid_sensor_here', 'your_ssid_test_string_here') }}"

The dashboard you have shown appears to be using the custom button card. Unfortunately nothing is simple about this card. It has custom grid layouts and javascript templates to wrap your head around. It probably isn’t using a template sensor at all. The Wifi state is probably generated with javascript templates in the card.

Thank you. Used this as a basis to get something simple working!

1 Like

Hey @jinx_removing where did you get this beauty? Is this a real dashboard or just a mock-up?

I know… a very old post… but I was just wondering about the used cards/tempalte etc. Very nice! Would like to know more about this!

@obatiuk did you find out something?

Nope. Still looking …