#Smart Plug "On" Sensor Template?

7 messages · Page 1 of 1 (latest)

midnight dagger
#

Hey guys. I am following the video posted about the Mushroom cards to make a dashboard. I'm pretty much a newbie when it comes to HA and coding etc. I was wondering if anyone knew how I could set up a template like the Lights on Sensor for my Smart Plugs? I've got both TP Link and Kasa smart plugs. I tried editing the template for the Lights on but I can't seem to get it set up properly in the config file.

Any help would be greatly appreciated. Thanks! 😄

hardy schooner
#

Were you talking about a Blueprint? If you have lights on your switches you could use a helper to convert them to lights, which makes everything easier.

midnight dagger
#

I have this in my config for lights.

sensor:

  • platform: template
    sensors:
    count_lights_on:
    friendly_name: "Light Count"
    unit_of_measurement: "on"
    value_template: "{{ states.light | selectattr('state', 'eq', 'on') | list | count }}"

What I'm trying to find out is how can I edit this to work with Smart Plugs. Apologies, not quite up with the lingo so not sure what a Blueprint is.

hardy schooner
#

As i said previously, for the switches which are lights, use the Switch as X helper to convert them to lights.

midnight dagger
#

Sorry if I’m misunderstanding but I don’t want anything to do with lights? I want to make a sensor that can inform me of how many smart plugs are switched on at a current time.

hexed rune
#

It won't be as straight forward as that for a smart plug because the domain you want is "switch.x" (e.g switch.smartplug_1) but that encompasses lots of other devices that aren't smartplugs too

There is probably a workaround...still thinking of it 😅

midnight dagger
#

Haha darn. 🙈