Coder Social home page Coder Social logo

jasonmadigan / ha-esb-faults Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 28 KB

ESB Networks PowerCheck Faults integration for Home Assistant

Python 100.00%
electricity-grid energy-monitor home-assistant home-assistant-integration home-automation iot esb-networks

ha-esb-faults's Introduction

ESB Networks PowerCheck Faults integration for Home Assistant

This repository contains a Home Assistant integration for ESB Networks PowerCheck display notable service interruptions for a given location, within a configured proximity. The integration relies upon a connection to ESB Network's PowerCheck API.

Installation

You will need HACS installed in your Home Assistant server. Install the integration by installing this repository as a Custom Respository (working on adding this to the default HACS integration set). Then, navigate to Integrations, Add an Integration and select ESB Faults. You will then be asked to enter:

  • Latitude: Your location latitude
  • Longitude: Your location longitude
  • Proximity: Filters alerts to within X kilometers of your lat/lon.
  • API Key: I won't include this here, but you can find it by inspecting requests on the PowerCheck website. Look for the Api-Subscription-Key key.

Open your Home Assistant instance and add this integration

Entities

The integration reads data 5 minutes. It exposes one entity, sensor.esb_faults_sensor. The State of the sensor is a numeric value, indiciating how many total faults (be they Planned Outages, Recent Restorations or Current Unplanned Faults) are present nearby. The attributes for the sensor include a an outages array, which contains details of individual outages present. Fields for these individual outages include:

Outage Field Description
outageType Outage type (e.g. 'Planned', 'Fault', 'Restored')
location Outage location
plannerGroup Region
numCustAffected Number of customers affected
startTime Outage start time
estRestoreTime Estimated restoration time
statusMessage Status Message
restoreTime Restoration time (only for outages of outageType Restored)
numCustAffected Number of customers affected

Sample Automation to notify about nearby outages

alias: ESB Outage Notifications
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.esb_faults_sensor
    attribute: outages
condition: []
action:
  - service: notify.notify
    data:
      title: ⚡ ESB Outage Notification ⚡
      message: >-
        Type: {{state_attr('sensor.esb_faults_sensor', 'outages')[0].type}},
        Location: {{state_attr('sensor.esb_faults_sensor',
        'outages')[0].location}}, Distance:
        {{state_attr('sensor.esb_faults_sensor', 'outages')[0].distance}} KM,
        Estimated Restore: {{state_attr('sensor.esb_faults_sensor',
        'outages')[0].estRestoreTime}}
mode: single

ha-esb-faults's People

Contributors

dependabot[bot] avatar jasonmadigan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  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.