Git Product home page Git Product logo

homeassistant's Introduction

Home Assistant

My forray into Home Assistant blueprints (and more?).

Blueprints

Certificate Expiry Checker

Import Certificate Expiry Checker blueprint to your Home Assistant. certificate_expiry_checker

This blueprint depends on the Certificate Expiry integration.

The blueprint will return an array of dictionaries, which can be referenced using {{items}}. This way you can gain greater control over how the output should be handled.

An example of the returned data:

[
  {
    "host": "portainer.example.com",
    "port": "9443",
    "relative_time": "9 days",
    "entity_id": "sensor.cert_expiry_timestamp_portainer_example_com_9443",
    "state": "2023-02-24T20:24:44+00:00"
  },
  {
    "host": "proxmox.example.com",
    "port": "8006",
    "relative_time": "1 day",
    "entity_id": "sensor.cert_expiry_timestamp_proxmox_example_com_8006",
    "state": "2023-02-16T23:06:53+00:00"
  },
  {
    "host": "www.example.com",
    "port": 443,
    "relative_time": "9 days",
    "entity_id": "sensor.cert_expiry_timestamp_www_example_com",
    "state": "2023-02-24T20:19:17+00:00"
  }
]

An example on how to configure HTML e-mail notifications that will contain a list of certificates about to expire:

service: notify.smtp_gmail
data:
  title: Certificates expiring soon
  message: |
    The following monitored certificates 
      will expire soon:
  data:
    html: |
      <!DOCTYPE html>
      <html>
        <head>
          <meta charset="UTF-8">
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>Certificates expiring soon</title>
        </head>
        <body>
          <p>The following monitored certificates will expire soon:</p>
          <ul>
          {% for item in items %}
            <li><a href="https://{{item.host}}:{{item.port}}">{{item.host}}:{{item.port}}</a> expires in {{item.relative_time}}</li>
          {% endfor %}
          </ul>
        </body>
      </html>

Device Availability Checker

Import Device Availability Checker blueprint to your Home Assistant. certificate_expiry_checker

The blueprint will return an array of dictionaries, which can be referenced using {{items}}. This way you can gain greater control over how the output should be handled.

An example of the returned data:

[
  {
    "device_id": "bb0074342dc93760d18ae40bb454f9ec",
    "device_name": "LUMI lumi.sensor_magnet",
    "area_id": "entrance",
    "state": "unavailable"
  },
  {
    "device_id": "0a300fdf5cdcc8e7d2e2473d003f9585",
    "device_name": "LUMI lumi.weather",
    "area_id": "bedroom",
    "state": "unavailable"
  },
  {
    "device_id": "6586d15e7134da404836203e165b7b9c",
    "device_name": "LUMI lumi.weather",
    "area_id": "living_room",
    "state": "unavailable"
  },
  {
    "device_id": "5e20568a620d5b500811c86568c5cee8",
    "device_name": "RGB Bulb",
    "area_id": "closet",
    "state": "unavailable"
  },
  {
    "device_id": "2563429dfb3eb402007748d833f2dfd4",
    "device_name": "LUMI lumi.weather",
    "area_id": "kitchen",
    "state": "56"
  }
]

An example on how to configure HTML e-mail notifications that will contain a list of unavailable or low battery devices:

service: notify.smtp_gmail
data:
  title: Unavailable or low battery devices
  message: |
    The following devices are low on battery or unavailable:
  data:
    html: |
      <!DOCTYPE html> <html>
        <head>
          <meta charset="UTF-8">
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>Unavailable or low battery devices</title>
        </head>
        <body>
          <p>The following devices are low on battery or unavailable:</p>
          <ul>
          {% for item in items %}
            <li><a href="https://homeassistant.example.com/config/devices/device/{{item.device_id}}">{{item.device_name}}</a><br />
              <ul>
                <li>Area: <a href="https://homeassistant.example.com/config/areas/area/{{item.area_id}}">{{area_name(item.area_id)}}</a></li>
                <li>State: {{item.state}}</li>
              </ul>
            </li>
          {% endfor %}
          </ul>
        </body>
      </html>

homeassistant's People

Contributors

briped avatar

Stargazers

Salim B avatar Sandro avatar  avatar Thomas Dietrich avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.