Giter VIP home page Giter VIP logo

homewizard-qbus's Introduction

Introduction

The goal of this project is to inform me and the members of my family if our solar-panels are producing more electricity than what we're currently consuming.

How does it work

A process that runs indefinitely reads out the measurements of the HomeWizard P1 device at a certain interval. If it turns out that the solar-panels are producing that much energy that we have a surplus of energy, a signal is triggered in the QBus home automation system that informs the habitants about the energy surplus.

I have this process running on a Raspberry Pi where it is hosted in Kubernetes (k3s). This is actually overkill, but I wanted to experiment with Kubernetes as well. Information on how to install k3s on a Raspberry Pi can be found here.

Build and run

You can pull the image from Dockerhub.

Build the image for a Windows operating system

  • Build the project as a container image

    docker build . -f Dockerfile-amd64 -t solarpoweralerter:<tag>
  • Run the program

    docker run solarpoweralerter:001 --network="host"

    The --network="host" argument makes sure that the container connects to the host's network.

Building for ARM32 devices

If you want to run the image on a Raspberry PI, you need to use the Dockerfile-arm32 for building the image.

If you build this container for arm32 on a Windows system, use docker buildx to build the image.

You also need the required emulators. Find information on how to install them here.

Make sure that you have the linux/arm/v7 emulator. Verify this by executing docker buildx ls.

Additional background information for this can be found here.

Once everything is in place, build the image using this command:

docker buildx build . -f .\Dockerfile-arm32 -t solarpoweralerter:<tag>

Push to dockerhub

  • Build the container locally

  • Tag the container so that it can be pushed to dockerhub:

    docker tag solarpoweralerter:001 docker.io/fgheysels/solarpoweralerter:001
    
  • Make sure to be logged in with Docker Hub via docker login

  • Push the image to the repository docker push fgheysels/solarpoweralerter:0.0.1

  • Pull image docker pull docker.io/fgheysels/solarpoweralerter:0.0.1

Deploy to Kubernetes

Deploy the component on a Kubernetes cluster by simply deploying the deployment manifest.

kubectl apply -f .\deploy\k8s\solar-prod-alert.yml -n solar-alert

Configuration

Following configuration settings are required:

Setting Name Value Description
HomeWizard__P1HostName p1meter_015ABC The hostname of the HomeWizard P1 name. We try to find the HomeWizard in the network via this name
QBus__IpAddress 192.168.1.14 The IP address of the QBus controller
QBus__Port 8444 The port at which the QBus EqoWeb API is listening
QBus__Username QBUS The username of the account that must be used to connect to QBus EqoWeb. Note that the username is case-sensitive
QBus__Password The password of the account that is used to connect to QBus EqoWeb
QBus__SolarIndicators A comma-separated string that lists the QBus devices that must be notified on Power Usage state changes
PowerUsageThresholds__NotEnoughProduction 200 The amount of electricity power (in watt) that must be exceeded to determine that we're consuming more electricity than that we're producing
PowerUsageThresholds__OverProduction -800 The amount of electricity powser (in watt) that must be passed to determine that we're producing more electricity than that we're consuming
PowerUsageThresholds__ExtremeOverProduction -2500 The amount of electricity power (in watt) that must be passed to determine that we're producing a whole lot more electricity than that we're consuming

When the power usage (in watt) is between PowerUsageThresholds__NotEnoughProduction and PowerUsageThresholds__OverProduction, we consider this as a 'break-even' state.

homewizard-qbus's People

Contributors

fgheysels avatar

Stargazers

 avatar

Watchers

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