Coder Social home page Coder Social logo

octopus_agile_trigger's Introduction

Octopus Agile Trigger

A small script that toggles the state of Philips Hue plugs based on the current Octopus Agile price.

Overview

This is intended to be run every half an hour on a cronjob. When the price drops below a given threshold, it turns on a Philips Hue plug. I then have a Google Home automation which uses the Hue plug state as a trigger to run other automations in the house (e.g. turn on the car charger, dishwasher, and send a broadcast via Google speakers etc). When the price goes back above the threshold, it turns the Hue plug off.

Similarly, when the price goes below 0, the state of another Hue plug is set, which can trigger another automation.

Installation

Clone the project and install the dependencies into a python virtual environment:

# Clone the repository
$ git clone [email protected]:AlanCunningham/octopus_agile_trigger.git

# Create a python virtual environment
$ python3 -m venv venv

# Activate the virtual environment
$ source venv/bin/activate

# Install the python dependencies using the requirements.txt file provided
(venv) $ pip install -r requirements.txt

Open the settings.py and enter:

  • Your Philips Hue Bridge IP address
  • You Distribution Network Operator Code
  • The names of the Hue plugs you want to toggle when the price drops below a given threshold and for plunge pricing
  • You preferred price threshold in pence

Then run the application

(venv) $ python main.py

octopus_agile_trigger's People

Contributors

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