Giter Site home page Giter Site logo

ingmarstein / velux-nibe Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 0.0 170 KB

Use Velux Active sensors as smart thermostats in NIBE Uplink.

License: MIT License

Dockerfile 1.22% Makefile 1.30% Go 84.95% Shell 12.52%
nibe nibe-uplink velux go golang synology-package

velux-nibe's Introduction

Velux-Nibe

Use VELUX ACTIVE sensors as smart thermostats in NIBE Uplink.

Purpose

NIBE Uplink gives the option of connecting your heat pump to a smart home system and making your heating system even smarter. Connect the thermostats in your smart home system with NIBE Uplink for optimised control of your indoor climate.

Unfortunately, the list of compatible systems is tiny. As of March 2021, only some thermostats from Niko are supported along with an integration based on IFTTT. This project extends this list by integrating VELUX ACTIVE sensors which you may be using to control your windows and shades.

Usage

1. Get NIBE API credentials

The tool uses the NIBE Uplink API to communicate with your heat pump and requires API credentials to do so. Use your existing NIBE account to create an application at https://api.nibeuplink.com/Applications. As callback URL, you can use https://www.marshflattsfarm.org.uk/nibeuplink/oauth2callback/index.php or host a similar script as in https://www.marshflattsfarm.org.uk/wordpress/?page_id=3480 on web servers of your choice. The application name is arbitrary, but what you enter in this field will be visible in the portal as the smart thermostat source.

Note your NIBE system ID which is visible in the URL after logging in to NIBE Uplink, e.g. in https://www.nibeuplink.com/System/${ID}/Status/Overview.

2. First run

Equipped with the client ID and secret from step 1 and your VELUX ACTIVE credentials, run the tool once to generate an access token (this step needs to be done only once):

go get github.com/IngmarStein/velux-nibe
./velux-nibe -velux-user xxx -velux-password xxx -nibe-system xxx -nibe-client-id xxx -nibe-client-secret xxx -nibe-callback xxx

You will be asked to open an URL in your browser and solve a captcha. Verify that the state parameter is set to state-token and enter the resulting code in velux-nibe. If successful, this will save an OAuth2 access token to the default location nibe-token.json.

3. Run velux-nibe

There are several options to run the tool on a variety of machines, including Raspberry Pi or common NAS hardware.

Native

go get github.com/IngmarStein/velux-nibe
VELUX_USERNAME=xxx VELUX_PASSWORD=xxx NIBE_CLIENT_ID=xxx NIBE_CLIENT_SECRET=xxx NIBE_CALLBACK_URL=xxx NIBE_SYSTEM_ID=xxx NIBE_TOKEN=nibe-token.json velux-nibe -targetTemp 210 -interval 60

In a container

docker run -v nibe-token.json:/nibe-token.json --env VELUX_USERNAME=xxx --env VELUX_PASSWORD=xxx --env NIBE_CLIENT_ID=xxx --env NIBE_CLIENT_SECRET=xxx --env NIBE_CALLBACK_URL=xxx --env NIBE_SYSTEM_ID=xxx ingmarstein/velux-nibe -targetTemp 210 -interval 60

Alternatively, use the included docker-compose.yml file as a template if you prefer to use Docker Compose.

On a Synology NAS

Add the Velux-Nibe Synology Package Source
  1. Open Package Center in DSM and select the Settings option.
  2. Select the Package Sources tab.
  3. Click Add
  4. In the Name section enter Velux-Nibe
  5. In the Location section enter https://ingmarstein.github.io/velux-nibe/
  6. Click OK
Install Velux-Nibe
  1. Go back to Package Center and search for Velux-Nibe
  2. Click on the Velux-Nibe package then select Install
  3. Click Agree when warned about using a package from an unknown publisher
  4. Click Done to confirm installation
  5. Provide the configuration parameters
velux-nibe.conf

If you upgrade your existing Velux-Nibe package, no changes will be made to the velux-nibe.conf file. If you want to overwrite your velux-nibe.conf configuration with the default one, please uninstall and install the package again.

You can customize the configuration of Velux-Nibe by using the config file at /var/packages/velux-nibe/target/velux-nibe.conf.
Please stop the package before changing the configuration.
If you have edited the configuration while Velux-Nibe is running, please restart the Velux-Nibe package.

Logs

On Synology, the service log file is located at /var/packages/velux-nibe/target/velux-nibe.log. The systemd logs can be inspected using journalctl -u pkgctl-velux-nibe.

4. Enable Smart Home mode

Once velux-nibe is running, it is polling your thermostats in the defined interval and submits the current values (as well as the specified target temperature) to NIBE Uplink. You can verify the data in the portal in the section "My Systems > System > Smart Home > Thermostats".

If you are happy with the results, don't forget to enable "smart home" mode in "My Systems > System > Manage > heat pump > plus functions > smart home" so that the heat pump actually uses the indoor temperatures to optimize operations.

5. HTML Interface

velux-nibe offers an optional HTML interface which is enabled by passing a non-zero value to the http-port flag. The HTML interface allows you to change the target temperature without restarting the service and view the most recently submitted values to NIBE Uplink.

velux-nibe's People

Contributors

dependabot[bot] avatar ingmarstein avatar

Watchers

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