GithubHelp home page GithubHelp logo

696grocuttt / appdaemon Goto Github PK

View Code? Open in Web Editor NEW
54.0 8.0 6.0 248 KB

A collection of AppDaemon modules for home power management and other misc uses

License: GNU General Public License v3.0

Python 58.48% CSS 1.46% HTML 0.05% JavaScript 39.92% Makefile 0.10%

appdaemon's Introduction

AppDaemon modules

This project contains AppDeamon apps for use with Home Assistant. AppDaemon is a Python execution environment that makes it easier to create complex automations and scripts for Home Assistant. For more information about how AppDaemon complements Home Assistant, see the AppDaemon Tutorial for HASS users.

You can use the apps in this project to:

  • Build a profile of the effective energy price for the day ahead and use this to control the behaviour of home batteries, and solar power diverters.
  • Provide a list of the lowest priced energy time slots to Home Assistant. You can then use this information to turn appliances on or off.
  • Monitor entities connected to Home Assistant and raise alerts when specified values are returned.

This documentation is a work in progress. If you have questions that are not currently answered by this content, please contact us.

Architecture overview

These AppDaemon apps are loosely coupled. In order to share data between apps, the data is sent to and retrieved from Home Assistant. The apps do not communicate with each other directly.

Each app is instantiated and configured using an AppDaemon configuration file. An example YAML configuration file is included for reference.

Architecture overview diagram

Power Manager

Power Manager uses data from multiple Home Assistant integrations to create a forecast of energy generation and consumption for the day ahead. It uses this information to:

  • Calculate the most cost-effective way to use solar, battery and grid power. Power Manager then sends this plan to Home Assistant in order to control the relevant devices.
  • Provide details of the cheapest time slots for consuming electricity to Home Assistant. This data can then be used by the Cheapest Time app to turn appliances on and off.

Energy generation and consumption forecast

Power Manager uses a number of sources to build the energy generation and consumption forecast:

  • Solar forecast data from Solcast. This provides a basic estimate of solar production for the coming day.
  • Historic solar production data from a solar inverter. This data is used to refine the solar forecast for local conditions. This is useful if shade from buildings or trees reduces solar production at a particular point in the day. Power Manager has been designed to use data from SolarEdge. Integrations with other solar inverters that provide data in the same format should also work but some modifications may be needed.
  • The current battery level and home energy usage from Tesla Powerwall, together with historic values from this integration that are available from Home Assistant.
  • Electricity import and export costs and gas import costs from an energy provider. Power Manager has been designed to use data from Octopus Energy. Using an integration with another energy provider is likely to need some modifications.

Note: The exact length of the energy price profile depends on the data sources. For Agile Octopus, price data is provided daily until midnight the following night.

Power plan and automations

Having built a forecast of energy generation and consumption for the day ahead, Power Manager calculates the most cost-effective way to use the available energy sources and when to export energy to the grid. This includes the best times to:

  • Power the home from solar-generated electricity.
  • Power the home from batteries.
  • Power the home from the grid.
  • Charge batteries using solar-generated electricity.
  • Charge batteries from the grid.
  • Divert solar-generated electricity to another system that would otherwise use gas (such as an immersion heater).
  • Export solar-generated energy to the grid.
  • Export energy stored in batteries to the grid.

The power plan uses historic energy consumption data (stored in Home Assistant) to create a plan that allows for typical energy usage. The aim is to ensure that when powering the home from batteries, there is sufficient charge to meet typical demand. For example, if the grid import cost is lowest in the afternoon, highest in the morning and average the night before, Power Manager will charge the batteries overnight up to a level sufficient to meet typical consumption and avoid the batteries going flat during peak time.

Power Manager uses the power plan to control devices in Home Assistant via the following integrations:

Effective energy price profile

Power Manager uses the data from the previous steps to build a profile of the effective energy price for the coming day. It sends this information to Home Assistant for use by the Cheapest Time app.

The cost in the energy profile is either the grid import cost, the grid export cost or the cost of previously charging the battery. The applicable cost depends on whether you are using the grid, solar-generated electricity or the battery to power the house at a given point in time.

Cheapest Time

Cheapest Time uses the effective energy price profile provided to Home Assistant to calculate the most cost-effective time to run home appliances. For example, you can use the information provided by Cheapest Time to turn on devices (such as a dishwasher or washing machine) at the most cost-effective time, taking into account the expected duration of the cycle.

Cheapest Time has been designed for use with Bosch Home Connect. It could be adapted to work with other Home Assistant integrations but some modifications may be required.

You can instantiate multiple instances of Cheapest Time. This is useful if you want to control multiple appliances in Home Assistant.

Monitor

Monitor listens to Home Assistant for notifications from selected entities and raises alerts if specified values are received. Monitor then sorts and formats the alerts before returning the prioritized list of notifications to Home Assistant for display on a card or physical device.

Use the AppDaemon configuration file to identify the entities in Home Assistant using a regular expression and specify the values. Monitor can listen for alerts from any entity in Home Assistant. For example, you can use Monitor to manage notifications for firmware updates, devices that have been turned on or off, a parcel by the door, a robot vacuum cleaner that is not docked or pet food running out.

License

This software is licensed for non-commercial use under GPL v3.

appdaemon's People

Contributors

696grocuttt avatar mejcrowder avatar

Stargazers

Lukshan Sharvaswaran avatar Dan Cecil avatar MaxGyver avatar  avatar  avatar Matthias Larsen avatar  avatar David Felix avatar  avatar Zac Stevens avatar  avatar  avatar  avatar  avatar  avatar Josh Pullin avatar Steve avatar Patrick Bulteel avatar Jamie Roos avatar  avatar Ash Heskes avatar loryferli avatar Thevoyagertwo avatar Tristan Jarrett avatar Greg McDougall avatar Neil Williams avatar  avatar  avatar Patrick McEvoy avatar Mark Ley avatar Jason Eames avatar  avatar  avatar Andrew avatar Ben Cos avatar  avatar  avatar  avatar Brandon Callifornia avatar  avatar John Tate avatar  avatar Luke avatar Michael Barrett avatar sebek avatar Neil McGovern avatar  avatar  avatar Ricardo Duarte avatar DJMalachite avatar  avatar Joe Alden avatar Dominik Wajda avatar Vlad M. avatar

Watchers

Tony Walsh avatar Christopher Wilmot avatar Isaac Edmonds avatar  avatar  avatar  avatar  avatar  avatar

appdaemon's Issues

Forced discharge of the powerwall - better API available?

Hi,

I saw your project featured on a YouTube video and was interested to hear how you control your Powerwall. I use the 'Tesla Custom Integration' (along with the 'Tesla HTTP Proxy') to change the Powerwall Operation Mode. By putting it to Backup with a high backup reserve I can force it to charge from the grid, and in 'Self consumption' mode it matches discharge to home use. However, my solution for forced discharge is pretty poor - I put it into Time-Based Control and then have high tariffs set in the app for the times when discharge to grid is normally required. Most of the time this works and force discharges to the grid, but not always - this is particularly a problem when a pricing spike happens at a non peak period of time.

Do you have a better way to force charge and discharge of the powerwall? I can enable my energy provider's VPP to control my powerwall and it has forced charge / discharge manual controls which work far better. They can force charge from the grid at a faster rate, force discharge at any time, and commands of this nature are actioned far quicker. They must have access to a much more functional API than the 'Tesla Custom Integration' has.

Thanks,

Fred

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.