Promo for Members

Dashboard Light Count Template Sensor YAML Code

$2.00
10% off for Diamond Members, 5% off for Gold Members. Promotion auto-applied on checkout.

This is YAML code for use in Home Assistant to save you time. You can use it to create an Entity Badge on a Sections dashboard that will display the number of lights that are currently turned on. You can single tap the badge to navigate to another view showing all light entities if you'd like. This includes the YAML code for the template sensor that counts the lights, and the YAML code for the Entity Badge on your Sections dashboard. See the images for what to expect, and watch this video for how to use it.

This is dependent on using the Sections view for your Home Assistant dashboard, as explained in the video.

INSTALL 

After purchasing, follow these steps to use the YAML code in just 5 minutes: 

  1. In Home Assistant, go to your configuration.yaml file using an add-on like Studio Code Server.
  2. Paste the first part of the YAML code in the zip file into your configuration.yaml. This will create a template sensor that counts all lights that are turned on. The template sensor includes code to exclude lights from the count if you wish (e.g., LED on a motion sensor). 
  3. Restart Home Assistant.
  4. After Home Assistant restarts, go to Settings > Dashboards > Open the dashboard you want to edit.
  5. Click the edit icon in the upper right > click to Add a Badge from the top row > choose Manual > paste the second part of the YAML code in the zip file.
  6. Edit the entity names to match the actual names of your Home Assistant entities.
  7. Click Save.

NOTE 

Producing high quality tech reviews and tutorials requires a large investment of time. My videos are free and show everything you need. To make it even easier for you, I invest additional time in creating and sharing the Blueprints, code, etc. to save you time, and you can access these for a small fee.