Home Assistant custom component to help ev-chargers stay below peak hourly energy levels.

Overview

Validate with hassfest Peaq_downloads hass-peaq_downloads Buy me a coffee

Peaqev ev-charging

Peaq logo

Peaqev ev-charging is an attempt of charging an ev without breaching a preset monthly max-peak energy level. In order for this integration to function, you will need to have a sensor/device that reads your current power-draw with good resolution examples below. You will also have to disable any other smart-charging capability you may have, such as scheduled charging or energy-price-aware charging, the latter will come as parameter here in a future update.

This integration does not communicate with any properitary API's, everything is handled locally in your Home Assistant. However, the chargers selected will use the integrations set for them, and may include cloud polling of data.

While this integration will try to not break your monthly energy peak hour, there is off course no guarantee. Various factors beyond control of this logic do occur, so for those aiming at staying below their threshold, I do suggest you think about the non-hours, caution-hours etc in the setup. These hours should be set when you commonly utilize a lot of extra energy in your home, such as cooking, doing laundry etc.

Installation

Required to install is Home Assistant version 2022.4.5 or higher.

If you have HACS installed, you can add peaqev as a custom integration.

Otherwise you may:

  • Copy custom_components/peaqev folder to <config_dir>/custom_components/peaqev/
  • Restart Home assistant
  • Go to Configuration > Devices & Services > Add integration

Config setup:

Search for peaqev in your integrations setup. Fill in the following parameters:

  • Power sensor - The already existing power sensor in your setup. This is required to get the reading to work. Examples of devices sending such data is Tibber Pulse/Watty, Shelly DIN-mounted devices or similar.
  • Power sensor includes car - Check this option if the above sensor includes your car's power draw. The calutions will be altered accordingly
  • City, or Grid owner company - Chose your city from the list. The characteristics differ in how peak hours are stored and measured. If you don't live in a supported location but just want to test the integration, or lower your peaks for other reasons, you may check "Other, just want to test"
  • Charger type - Pick the installed ev-charger you have. Currently Chargeamps and Easee are supported. Check links for required custom components per charger-type: Chargeamps, Easee

Config options:

  • Non hours - Click to select the hours (if any) where you do not wish to charge.
  • Caution hours - Click to select the hours (if any) where you want the charger to be extra cautious to not break the peak.
  • Price aware charging - Check this to calculate the cheapest hours from Nordpool (requires Nordpool). Above Non- and Caution-hours will be ignored.
  • Absolute top price - The limit (if any) where your charger should be stopped, regardless of the hour-algorithm.
  • Monthly allowed peak - Needs to be set in order to determine a minimum allowed peak. In the beginning of each month this is necessary to be able to charge at all. Format is in kW. See examples below
  • Caution-hour type - Choose to what extent you would like Peaqev to hold back during caution-hours. Suave > Aggressive

These are two (quite restrained) examples of monthly start peaks, for 1-phase and 3-phase charging respectively. This option is always up to your house and it's other appliances. The below are made for a modern house with installed heat pump.

Month 1-phase charge 3-phase charge
Jan 2.0 4.0
Feb 1.8 3.6
Mar 1.8 3.6
Apr 1.5 3.0
May 1.5 3.0
Jun 1.5 3.0
Jul 1.5 3.0
Aug 1.5 3.0
Sep 1.5 3.0
Oct 1.5 3.0
Nov 1.8 3.6
Dec 2.0 4.0
Locale Characteristics
Gothenburg, Sweden The average of three max peak hours from different days is what your are charged for. The algorithm tries to stay below the minimum value of these three peaks.
Partille, Sweden Single monthly peak hour is what is being avoided by the algorithm
Nacka, Sweden (Normal tariffe) The average of three max peak hours is what your are charged for. The algorithm tries to stay below the minimum value of these three peaks.
Sala, Sweden (SHE ab-customer) The average of three max peak hours, that do occur Mon-Fri, between 07-19. Other hours are non-observed.
Skövde, Sweden Single monthly max peak. Observed Nov-Mar, Mon-Fri between 06-22. Other hours are non-observed.
Karlstad, Sweden single max peak
Kristinehamn, Sweden for Nov-Mar, max peak during Mon-Fri 07-17. Other months, single max peak
Malung-Sälen, Sweden Average of five peaks on different days. Peaks are calc between 07-19. Other hours are free-charge.
Other, just want to test Single monthly peak hour is what is being avoided by the algorithm

More cities will come in future updates

Usage

  • To start and stop, I suggest you create automations that call the services peaqev.enable and peaqev.disable.
  • Make sure to not exclude the created sensors from your recorder, as this would conflict with the monthly peaks.

Example of basic automations to enable/disable the charging. Your states here may differ from the example which is a Chargeamps Halo:

- id: '111111'
  alias: Peaq - Charge
  trigger:
  - platform: state
    entity_id: sensor.your_chargersensor
    from: Available
    to: Connected
  - service: peaqev.enable
    data: {}
  mode: single

- id: '222222'
  alias: Peaq - Disconnected
  trigger:
  - platform: state
    entity_id: sensor.your_chargersensor
    to: Available
  condition: []
  action:
  - service: peaqev.disable
    data: {}
  mode: single

Tested with Chargeamps Halo 11kw and Easee. Both setups with one single charger per household. Currently will not function where multiple chargers have been installed ,2022-04-23

Issues
  • Setup failes with error on energy sensor

    Setup failes with error on energy sensor

    I get different errors with different sensors, see log below. My asumption is that eithere the naming, or attributes on them do not match up. Or simply that i have miss judge what sensors that should be provided.

    image

    At setup it accepts my input and configuration steps. But then gives error that it cant be set up. Full log below with modified entity due to adress (for the Tibber Pulse) First i thought it was about that i have local production so some sensors goes negative, however tested during over consuption with same error.

    Let me know what data i can collect and what assistans i can give/help out with

    2022-04-19 10:16:08 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry sensor.total_power_total_mqtt for peaqev File "/config/custom_components/peaqev/init.py", line 32, in async_setup_entry File "/config/custom_components/peaqev/peaqservice/hub.py", line 105, in init File "/config/custom_components/peaqev/peaqservice/hub.py", line 133, in init_hub_values File "/config/custom_components/peaqev/peaqservice/util/hubmember.py", line 30, in value 2022-04-19 10:20:02 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry sensor.power_XXXadressXXX for peaqev File "/config/custom_components/peaqev/init.py", line 32, in async_setup_entry File "/config/custom_components/peaqev/peaqservice/hub.py", line 80, in init File "/config/custom_components/peaqev/config_flow.py", line 77, in async_step_user File "/config/custom_components/peaqev/config_flow.py", line 56, in validate_input_user File "/config/custom_components/peaqev/config_flow.py", line 38, in _check_power_sensor 2022-04-19 10:31:51 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry sensor.power_XXXadressXXX for peaqev File "/config/custom_components/peaqev/init.py", line 32, in async_setup_entry File "/config/custom_components/peaqev/peaqservice/hub.py", line 80, in init

    bug 
    opened by nsimb 11
  • Cant set up the Peaq in integration, still getting Aborted

    Cant set up the Peaq in integration, still getting Aborted

    closed the last ticket, after clean install, and trying to figure out what could be wrong with my setup. image

    Guessing it got somthing with how to with the additional of the Nordpool, since this started to hapen when the priceaware beta got released.

    Not really sure how to debugg or find the logs when it comes to custom integration setup throu gui. Let me know if its just my installation and what i can do.

    v0.5.3 core-2022.4.7 supervisor-2022.04.0 Home Assistant OS 7.6

    bug 
    opened by nsimb 8
  • Chargepoint ID

    Chargepoint ID

    I feel really stupid but i cant get it to work, my guess is that i give the wrong Chargepoint ID Tried all kind of stuff related to device and entitys

    Checked out the code to see what it could be related to and tested. Sadly no luck

    Easee charger, device is called 42 but i tried with different entitys aswell without luck I asume that the power sensor should the the full entity name and mesure in W since power. Have a few but so far no luck

    image

    bug 
    opened by nsimb 3
  • Dynamic caution-hours

    Dynamic caution-hours

    if priceaware, create dynamic caution hours.

    this will allow peaq to charge up to a certain threshold dynamically and not just based on the set peak. with this feature, there will be a possibility to charge "a little" when prices are high but not high enough to cause a non-hour

    opened by elden1337 0
  • Take tomorrow's prices into account if possible

    Take tomorrow's prices into account if possible

    The price calc for hours only takes today into account. I think we should do now and 24hr forward (if Nordpool had released tomorrow's prices) so that one can see when charging will start next time if stopped.

    Originally posted by @elden1337 in https://github.com/elden1337/hass-peaq/discussions/38#discussioncomment-2648785

    enhancement 
    opened by elden1337 0
  • Own Energy Production

    Own Energy Production

    Hi, To make this integration even better my suggestion is to take into account own energy production. For me that has solar panel it´s cheapest to charge the car when they produce energy independent on the hourly price at that moment.

    To make it even more advanced you could look at the forecast to plan ahead.

    enhancement 
    opened by stejo388 3
  • Transfer localetypes to core

    Transfer localetypes to core

    • [ ] fix schema in core
    • [ ] make sure the pattern is agnostic enough to use elsewhere
    • [ ] make translation of pattern in this repo (hass-peaq) to sql-lite to work with HA as is now
    enhancement 
    opened by elden1337 0
  • Servicecall for needed charge

    Servicecall for needed charge

    Since peaq cannot read car's chargelevel.

    Set up call, params are

    Desired kwh: Departuretime:

    Peaq should then tweak accordingly. As smart as possible. Ie perhaps break peak-energy, perhaps charge more at more expensive hours.

    This must all be session-based and return to normal state after next disconnect

    enhancement 
    opened by elden1337 0
Releases(v0.10.1)
  • v0.10.1(Jun 2, 2022)

  • v0.10.0(Jun 2, 2022)

    Downloads for this release

    Changes

    • #71 Switch-entity for turning peaqev on/off. Service calls still exist.

    New Localetypes

    • #77 Glitre Energi, Norway
    • #78 Agder Energi, Norway

    Norway added as country in HACS.json

    Misc

    • Cleanup of sensor attributes where redundant
    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(59.72 KB)
  • v0.9.0(Jun 1, 2022)

  • v0.8.4(May 30, 2022)

    Downloads for this release

    Changes

    • Fix on init when chargerobject threw exception because state was numeric
    • Important bugfix to chargerstates that could cause charger to not start when called
    • Fix to estimated max-charge-amount attribute on the hourcontroller (if using price-awareness)
    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(57.16 KB)
  • v0.8.2(May 29, 2022)

    Downloads for this release

    Changes

    • Changes to charging-done. Now turns off when car is disconnected. No need to call service off
    • Changes to hub-initialization process, mainly for finding issues with Easee-charger, but should help out elsewhere as well. Chargerstate will now report "Hub not ready. Check logs!" if any vital part has not been initialized yet.
    • Extended logging overall
    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(57.14 KB)
  • v0.8.0(May 27, 2022)

    Downloads for this release

    Changes

    Bugfixes

    • #64 Chargeampsfix. Removed some hard-coded data for creating the sensors, which got corrupt with Chargeamps latest update 1.7.0.

    Features

    • #63 Now possible to set a min-price if you are using price-awareness. If set, all hours lower than this price will automatically be allowed charging.
    • #62 If using priceawareness, on the hourcontroller-sensor, the estimated average per-kwh price for charging and the absolute max possible charge-amount (for the coming 24hrs) are shown as parameters. These attributes will probably be refined in future iterations.
    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(55.68 KB)
  • v0.7.2(May 24, 2022)

  • v0.7.0(May 23, 2022)

  • v0.7.0-beta(May 19, 2022)

  • v0.6.1(May 18, 2022)

  • v0.6.0(May 16, 2022)

    Downloads for this release

    Time for Peaqev Lite! Lite is an alternative setup of Peaqev that lets the majority of households (those without a connected power meter) save at least something on their ev-charging in terms of peak hour effeicency.

    While this type is much more basic than the regular Peaqev, the hope is that this, together other changes in your household (don't wash and charge at the same time etc) will lower your peaks.

    Lite can be combined with priceawareness like the regular installation, or with static non- and caution-hours.

    Technically, Lite will charge the set amount (you set the amount in the config at the monthly start peak section) each hour, unless priceawareness or your own non-hours have told it to stop). Then it will wait, and repeat this next hour.

    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(49.22 KB)
  • v0.6.0-beta.4(May 14, 2022)

    Downloads for this release

    Changes

    • fixes to init flow that caused non price aware installations to not show set caution hours
    • is_initialized checks on the entire hub. Should prevent hickups when dependencies are not ready despite calling ready
    • minor bugfixes and linting

    Report any clear bugs in issues. Discussions and q/a in the Discussions section

    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(49.20 KB)
  • v0.6.0-beta.3(May 14, 2022)

    Downloads for this release

    Changes

    • nullcheck on newly introduced peaqevtype in init to not crash existing installations.
    • adding peaqevcore to requirements
    • logging on chargecontroller when state "error" is reported to find underlying reasons

    Report any clear bugs in issues. Discussions and q/a in the Discussions section

    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(49.01 KB)
  • v0.6.0-beta.2(May 12, 2022)

  • v0.6.0-beta(May 12, 2022)

    Downloads for this release

    Changes

    Time for Peaqev Lite! Lite is a version of Peaqev that lets the majority of households (those without a connected power meter) save at least something on their ev-charging in terms of peak hour effeicency.

    While this type is much more basic than the regular Peaqev, the hope is that this, together other changes in your household (don't wash and charge at the same time etc) will lower your peaks.

    Lite can be combined with priceawareness like the regular installation, or with static non- and caution-hours.

    Technically, Lite will charge the set amount (you set the amount in the config at the monthly start peak section) each hour, unless priceawareness or your own non-hours have told it to stop). Then it will wait, and repeat this next hour.

    Report any clear bugs in issues. Discussions and q/a in the Discussions section

    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(48.03 KB)
  • v0.5.11(May 12, 2022)

  • v0.5.10(May 10, 2022)

  • v0.5.9(May 9, 2022)

  • v0.5.8(May 9, 2022)

    Downloads for this release

    Changes (only applies to users with price aware charging)

    • #52 - Dynamic Caution hours. the caution hours are now presented and used in a much nicer way. The more expensive an hour is (but below non-hour stop in the algorithm), the less of the registered peak you are allowed to charge up to. This is to let you charge when prices are semi-high, but not at full peak.
    • New sensor created, Peaqev Hour controller. Check this to see when next charging hour is scheduled, or at what percentage the current hour can chare.

    Even if this is not a beta release I urge you to report any issues in this project. Any questions or discussions regarding features are welcome in the discussions-section.

    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(42.27 KB)
  • v0.5.7(May 6, 2022)

  • v0.5.6(May 5, 2022)

    Downloads for this release

    Changes

    Updates to accommodate HA version 2022.5.0.

    BREAKING CHANGE! Do not update unless you already have HA 2022.5.0. After installing this update, you probably have to delete and reinstall the integration.

    Unfortunately, you may also need to manually remove the entity registries as they are not removed properly on deleteing the integraiton. If you, after reinstalling and rebooting notice that some sensors are duplicated, this is the case. You will then need to manually delete before reinstalling again.

    Sorry about this. Hope we can find a better way forward and implement the sensors in a different manner (help requested should you have the time).

    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(39.47 KB)
  • v0.5.5(May 4, 2022)

    Downloads for this release

    Changes

    • power multiplier introduced in chargertypes-aggregator. Easee is reporting charging wattage as kw, so in order to get that right an x1000 needed to be added.
    • Currency now shown on top-price if price-awareness is chosen.
    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(38.86 KB)
  • v0.5.4(May 3, 2022)

  • v0.5.3(May 2, 2022)

  • v0.5.2(May 2, 2022)

  • v0.5.1(May 1, 2022)

    This release included a lot of changes.

    Mainly, price awareness is now available (you will need Nordpool-integration to do this). There is also an options flow which you will find on existing installations as the "configure"-button.

    Should you check the priceawareness, the preset non- and caution-hours will be ignored.

    The three levels Suave, Intermediate and Aggressive tells Peaqev how hard you would like to tell it to stop during expensive hours. Suave is a bit lighter (will let you charge on more hours) whilst aggressive can lead to long periods of not charging at all.

    There is also an absolute max price that you can set, which will stop the charger for any hour over this price.

    Also included are many fixes on the core level, better testing is carried out in the separate core-project. The bug/integration-fixes in this release are focused on Easee-charger type.

    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(38.01 KB)
  • v0.5.0(May 1, 2022)

    This release included a lot of changes. Mainly, price awareness is now available (you will need Nordpool-integration to do this). There is also an options flow which you will find on existing installations as the "configure"-button.

    Should you check the priceawareness, the preset non- and caution-hours will be ignored.

    The three levels Suave, Intermediate and Aggressive tells Peaqev how hard you would like to tell it to stop during expensive hours. Suave is a bit lighter (will let you charge on more hours) whilst aggressive can lead to long periods of not charging at all.

    There is also an absolute max price that you can set, which will stop the charger for any hour over this price.

    Also included are many fixes on the core level, better testing is carried out in the separate core-project. The bug/integration-fixes in this release are focused on Easee-charger type.

    Source code(tar.gz)
    Source code(zip)
    peaqev.zip(37.98 KB)
  • v0.5.0-beta.6(Apr 30, 2022)

  • v0.5.0-beta.5.1(Apr 30, 2022)

  • v0.4.3(Apr 30, 2022)

Owner
Magnus Eldén
Magnus Eldén
A Home Assistant sensor that tells you what holiday is next

Next Holiday Sensor This sensor tells you what holiday is coming up next. You can use it to set holiday light colors or other scenes. The state of the

Nick Touran 4 Jan 17, 2022
E-Ink Magic Calendar that automatically syncs to Google Calendar and runs off a battery powered Raspberry Pi Zero

E-Ink Magic Calendar that automatically syncs to Google Calendar and runs off a battery powered Raspberry Pi Zero

2.5k Jan 18, 2022
A versatile program that uses the raspberry pi camera and provides it as a service

PiCameleon Is a daemon program meant to provide the RaspberryPi Camera as a service while running according to a configuration.

André Esser 48 Dec 24, 2021
Connect a TeslaMate instance to Home Assistant, using MQTT

TeslaBuddy Connect a TeslaMate instance to Home Assistant, using MQTT. It allows basic control of your Tesla vehicle via Home Assistant (currently, ju

3 Oct 25, 2021
Hook and simulate global mouse events in pure Python

mouse Take full control of your mouse with this small Python library. Hook global events, register hotkeys, simulate mouse movement and clicks, and mu

BoppreH 578 Feb 09, 2022
Raspberry Pi Power Button - Wake/Power Off/Restart(Double Press)

Control Raspberry pi with physically attached button. Wake, Power Off, and Restart (Double Press) . Python3 script runs as a service with easy installation.

Stas Yakobov 12 Jan 09, 2022
Play music on Raspberry Pi Pico Without CPU involvement

MicroPython_PIO_Music_DMA Play music on Raspberry Pi Pico Without CPU involvement This is based on PIOBeep (https://github.com/benevpi/pico_pio_buzz)

2 Dec 19, 2021
Repo for the esp32s2 version of the Wi-Fi Nugget

Repo for the esp32s2 version of the Wi-Fi Nugget

HakCat 15 Dec 28, 2021
This repo uses a stereo camera and gray-code-based structured light to realize dense 3D reconstruction.

Structured-light-stereo This repo uses a stereo camera and gray-code-based structured light to realize dense 3D reconstruction. . How to use: STEP 1:

FEI 8 Jan 20, 2022
LedFx is a network based LED effect controller with support for advanced real-time audio effects

Welcome to LedFx ✨ -Making music come alive! LedFx website: https://ledfx.app/ What is LedFx? What LedFx offers is the ability to take audio input, an

485 Jan 27, 2022
Poupool is an overflow swimming pool control software

Poupool - The swimming pool controller Poupool is a swimming pool control software. It is based on Transitions, Pykka and Paho MQTT. The user interfac

Cyril Jaquier 6 Jul 24, 2021
An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and display it on a FeatherS2 in an OLED display.

CircuitPython IoT Trivia ESP32-S2 OLED Version An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and

Kevin Thomas 1 Nov 26, 2021
Programming of Robotics Systems course at the University of Aveiro, Portugal, 2021-2022.

Programação de Sistemas Robóticos Miguel Riem Oliveira Universidade de Aveiro 2021-2022 Projeto AtlasCar Projecto RACE IROS 2014 AtlasCar2 ATOM IROS 2

Miguel Riem de Oliveira 22 Jan 20, 2022
A Macropad using the Raspberry Pi Pico, programmed with CircuitPython.

A Macropad using the Raspberry Pi Pico, programmed with CircuitPython.

12 Nov 14, 2021
Water quality integration for Home Assistant with data provided by Budapest FVM

Water Quality FVM (Budapest, HU) custom integration for Home Assistant This custom component integrates water quality information provided by Budapest

Atticus Maximus 3 Dec 22, 2021
This is a python script to grab data from Zyxel NSA310 NAS and display in Home Asisstant as sensors.

Home-Assistant Python Scripts Python Scripts for Home-Assistant (http://www.home-assistant.io) Zyxel-NSA310-Home-Assistant Monitoring This is a python

5 Jan 24, 2022
How to configure IOMMU device for nested Proxmox hypervisor (PVE) VM - PCIe Passthrough

Configuring PCIe Passthrough for Nested Virtualization on Proxmox Summary: If you are running bare-metal L0 (level 0) Proxmox (PVE) hypervisor with ne

Travis Johnson 3 Dec 27, 2021
Raspberry Pi Spectrometer

PySpectrometer 2021-03-05 Raspberry Pi Spectrometer The PySpectrometer is a Python (OpenCV and Tkinter) implementation of an optical spectrometer. The

Les Wright 429 Jan 23, 2022
Volta: A Virtual Assistant which increases your productivity with time as you use it…

Volta Official Documentation Overview & Purpose Volta: A Virtual Assistant which increases your productivity with time as you use it… Volta, developed

Abeer Joshi 1 Jan 13, 2022
Raspberry Pi & Accelerometer with Losant's EEA

Raspberry Pi & Accelerometer with Losant's EEA This is a repository that contains companion code to this EEA How To guide. Each folder is named accord

Losant 1 Oct 28, 2021