Giter Site home page Giter Site logo

homeassistant-eloverblik's Introduction

eloverblik

hacs_badge

The eloverblikcomponent is a Home Assistant custom component for monitoring your electricity data from eloverblik.dk

The custom component in it's very early stage for showing data from eloverblik.dk.

Installation

Manual Installation

  1. Copy eloverblik folder into your custom_components folder in your hass configuration directory.
  2. Restart Home Assistant.
  3. Configure Eloverblik through Configuration -> Integrations -> Add Integration.

Installation with HACS (Home Assistant Community Store)

  1. Ensure that HACS is installed.
  2. Search for and install the eloverblik integration through HACS.
  3. Restart Home Assistant.
  4. Configure Eloverblik through Configuration -> Integrations -> Add Integration.

Configuration

Refresh token and metering point

Get refresh token and metering point from https://eloverblik.dk.

  1. Login at eloverblik.
  2. metering point is your ID
  3. refresh token can be created by clicking at you user and chose share data.

State and attributes


A sensor for each over hour in the past 24 hours is created with the syntax:

  • sensor.eloverblik_energy_0_1
  • sensor.eloverblik_energy_1_2
  • etc.

A sensor which sum up the total energy usage is added as well:

  • sensor.eloverblik_energy_total

All sensors show their value in kWh.

Debugging

It is possible to debug log the raw response from eloverblik.dk API. This is done by setting up logging like below in configuration.yaml in Home Assistant. It is also possible to set the log level through a service call in UI.

logger: 
  default: info
  logs: 
    pyeloverblik.eloverblik: debug

Examples

Daily average and gauge bar indicating high usage

Below example is an example how to display daily average and a guage indicating high usage.

alt text

Requirements

Average sensor

Below statistics sensor shows the daily average calculated over the last 30 days.

sensor:
  - platform: statistics
    entity_id: sensor.eloverblik_energy_total
    name: Eloverblik Monthly Statistics
    sampling_size: 50
    state_characteristic: mean
    max_age:
        days: 30

Lovelace

type: vertical-stack
cards:
  - card:
      entity: sensor.eloverblik_energy_total
      max: 20
      min: 0
      name: >-
        ${'Strømforbrug d. ' +
        states['sensor.eloverblik_energy_total'].attributes.metering_date }
      severity:
        green: 0
        red: '${states[''sensor.eloverblik_monthly_statistics''].state * 1.25}'
        yellow: '${states[''sensor.eloverblik_monthly_statistics''].state * 1.10}'
      type: gauge
    entities:
      - sensor.eloverblik_energy_total
      - sensor.eloverblik_monthly_statistics
    type: 'custom:config-template-card'
  - type: entity
    entity: sensor.eloverblik_monthly_statistics
    name: Daglig gennemsnit

Forecast total kWh price with Nordpool integration

If you have the Nordpool installed you can calculate the current electricity price and forecast the price for today and tomorrow by the hour. These prices will including any tarrifs that apply, which will adjust according to peak times and season as they are fetched from Eloverblik. This way you will get the actual price you pay per kWh. You can plot this on a dashboard, or use it in the Energy dashboard.

To combine the the nordpool and eloverblik sensors, create below template sensor. Please note that the template assumes that your nordpool integration is configuerd to NOT include VAT.

template:
  - sensor:
    - name: "Electricity Cost"
      unique_id: electricity_cost
      device_class: monetary
      unit_of_measurement: "kr/kWh"
      state: >
        {{ 1.25 * (float(states('sensor.eloverblik_tariff_sum')) + float(states('sensor.nordpool'))) }}
      attributes:
        today: >
          {% if state_attr('sensor.eloverblik_tariff_sum', 'hourly') and state_attr('sensor.nordpool', 'today') %}
            {% set ns = namespace (prices=[]) %}
            {% for h in range(24) %}
              {% set ns.prices = ns.prices + [(1.25 * (float(state_attr('sensor.eloverblik_tariff_sum', 'hourly')[h]) + float(state_attr('sensor.nordpool', 'today')[h]))) | round(5)] %}
            {% endfor %}
            {{ ns.prices }}
          {% endif %}
        tomorrow: >
          {% if state_attr('sensor.eloverblik_tariff_sum', 'hourly') and state_attr('sensor.nordpool', 'tomorrow') %}
            {% set ns = namespace (prices=[]) %}
            {% for h in range(24) %}
              {% set ns.prices = ns.prices + [(1.25 * (float(state_attr('sensor.eloverblik_tariff_sum', 'hourly')[h]) + float(state_attr('sensor.nordpool', 'tomorrow')[h]))) | round(5)] %}
            {% endfor %}
            {{ ns.prices }}
          {% endif %}

Replace nordpool with the name of your Nordpool sensor.

Long term statistics and Energy dashboard

The integration now supports long-term statistics and energy dashboard.

The integration will pull current and last years data from Eloverblik and insert it into the long-term statistics in HomeAssistant.

An entity with the id sensor.eloverblik_energy_statistic is created, this entity will always have an unknown value, since if a current value is set, the recorder will try to write it to the statistics.

NOTE: This is not the ideal setup, but it does enable owners that do not have live access to their measurements to get the data into home-assitant.

But the entity will have a valid long-term statistic.

The statistic will continually be updateed daily.

NOTE: The data will be delayed between 1 and 3 days, depending on your local grid operator (DSO).

Below are two examples of UI yaml configuration to display the values.

Yesterdays consumption example:

type: statistic
name: Elforbrug i går
entity: sensor.eloverblik_energy_statistic
period:
  calendar:
    period: day
    offset: -1
stat_type: change
icon: mdi:lightning-bolt

Example in apexcharts

Last weeks consumption

This is created with the help of apexcharts

type: custom:apexcharts-card
graph_span: 7d
header:
  show: true
  title: Sidste 7 dages elforbrug
span:
  end: day
  offset: '-1d'
series:
  - entity: sensor.eloverblik_energy_statistic
    type: column
    statistics:
      type: sum
      period: hour
    group_by:
      func: diff
      start_with_last: true
      duration: 1d

Example in apexcharts

homeassistant-eloverblik's People

Contributors

brondum avatar ftoft avatar hausnera avatar hwikene avatar jonasped avatar martinschmidt avatar runemoennike avatar runepx4 avatar sticky12 avatar wrt54g 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.