Git Product home page Git Product logo

evohome2mqtt's Introduction

Evohome2mqtt

npm Run tests and publish github issues Support me on Github mqtt-smarthome semantic-release

This node.js application is a bridge between the Evohome system and a mqtt server. Your thermostats will be polled every x seconds and the status(es) get published to your (local) mqtt server. As with a bridge it also works the other way around. You can set the temperature for a thermostat with a message to mqtt.

It's intended as a building block in heterogenous smart home environments where an MQTT message broker is used as the centralized message bus. See MQTT Smarthome on Github for a rationale and architectural overview.

Installation

Using evohome2mqtt is really easy, but it requires at least Node.js v6 or higher. (This app is tested against v12).

sudo npm install -g evohome2mqtt

Usage

evohome2mqtt 0.0.0-development
Usage: evohome2mqtt [options]

Options:
  --user                  Your evohome username                       [required]
  --password              Your evohome password                       [required]
  -l, --logging           Logging level
                   [choices: "error", "warn", "info", "debug"] [default: "info"]
  -m, --mqtt              mqtt broker url. See
                          https://github.com/svrooij/evohome2mqtt#mqtt-url
                                                   [default: "mqtt://127.0.0.1"]
  -n, --name              instance name. used as mqtt client id and as topic
                          prefix                            [default: "evohome"]
  -p, --polling-interval  evohome polling interval in seconds      [default: 30]
  --app                   Specify a different application ID (EXPERT?)
                               [default: "91db1612-73fd-4500-91b2-e63b069b185c"]
  -h, --help              Show help                                    [boolean]
  --version               Show version number                          [boolean]

Evohome credentials

We need your evohome credentials, so those are required. evohome2mqtt --user yourUsername --password yourSecretPassword

MQTT Url

Use the MQTT url to connect to your specific mqtt server. Check out mqtt.connect for the full description.

Connection without port (port 1883 gets used)
[protocol]://[address] (eg. mqtt://127.0.0.1)

Connection with port
[protocol]://[address]:[port] (eg. mqtt://127.0.0.1:1883)

Secure connection with username/password and port
[protocol]://[username]:[password]@[address]:[port] (eg. mqtts://myuser:[email protected]:8883)

Environment variables

You can also config this app with environment variables, they all start with EVOHOME2MQTT_ and then then full name of the argument. Like EVOHOME2MQTT_USER, EVOHOME2MQTT_PASSWORD or EVOHOME2MQTT_POLLING_INTERVAL

Topics

Every message starts with a prefix (see usage) that defaults to evohome. So if you change this all the topics change.

Connect messages

This bridge uses the evohome/connected topic to send retained connection messages. Use this topic to check your evohome bridge is still running.

  • 0 or missing is not connected (set by will functionality).
  • 1 is connected to mqtt, but not to evohome.
  • 2 is connected to mqtt and evohome. (ultimate success!)

Status messages

The status of each thermostat will be published to evohome/status/thermostat/zone_name as a JSON object containing the following fields.

  • val current temperature.
  • state JSON object retrieved from evohome server.
  • lc last change.

We also publish the temperature as a single value to evohome/status/thermostat/zone_name/temp.

Setting the temperature

You can control each zone by sending a json message to evohome/set/thermostat/zone_name with the following fields:

  • temp is the new temperature.
  • minutes is the number of minutes this new temp should be set (optional).
evohome/set/thermostat/livingroom
{
  "temp":20,
  "minutes":48
}

Will set the temperature to 20ΒΊ for 48 minutes.

An empty message to evohome/set/thermostat/livingroom will revert the livingroom back to the schedule.

Run in Docker

You can run this app in docker. We provide an image for linux/amd64 linux/arm/v7 and linux/arm64. Everything is configurable with environment variables, docker compose sample:

version: "3.7"
services:
  evohome:
    image: svrooij/evohome2mqtt
    restart: unless-stopped # This makes sure that on a crash it will automatically be restarted.
    environment:
      - EVOHOME2MQTT_USER=your_user_name # Replace with your username for the evohome system
      - EVOHOME2MQTT_PASSWORD=complicated_password_I_hope # Replace with your password for the evohome system
      - EVOHOME2MQTT_MQTT=mqtt://emqx:1883 # EMQX is a nice mqtt broker
    depends_on:
      - emqx
# Optional MQTT server (I like emqx over mosquitto)
  emqx:
    image: emqx/emqx
    restart: unless-stopped
    ports:
      - "1883:1883"
      - "18083:18083"

Off course you can also start it wil the following oneline.

# Start in current process CTRL+C quits the app
docker run -e "EVOHOME2MQTT_USER=your_user_name" -e "EVOHOME2MQTT_PASSWORD=complicated_password" -e "EVOHOME2MQTT_MQTT=mqtt://emqx:1883" -n evohome svrooij/evohome2mqtt

# Start in background
docker run -d -e "EVOHOME2MQTT_USER=your_user_name" -e "EVOHOME2MQTT_PASSWORD=complicated_password" -e "EVOHOME2MQTT_MQTT=mqtt://emqx:1883" -n evohome svrooij/evohome2mqtt
# Follow logs from running in background
docker logs -f evohome

Use PM2 to run in background (deprecated)

In the past running this app with PM2 was recommended, currently (Oct 2020) I would suggest to use docker.

If everything works as expected, you should make the app run in the background automatically. Personally I use PM2 for this. And they have a great guide for this.

Special thanks

The latest version of this bridge is inspired on hue2mqtt.js by Sabastian Raff. That was a great sample on how to create a globally installed, command-line, something2mqtt bridge.

Beer or Coffee

This bridge took me a lot of hours to build, so I invite everyone using it to at least have a look at my Sponsor page. Even though the sponsoring tiers are montly you can also cancel anytime πŸ˜‰

evohome2mqtt's People

Contributors

svrooij avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

evohome2mqtt's Issues

Error Response

Hi,
i installed it today (Version 1.1.1, node-js v10.23.2).
It looks great but i got an error response while loading data from evohome:

grafik

Please, can you help me?

Topic name generation fails for DHW zone

Hi Stephan @svrooij

Thanks for your efforts on the project. I just installed it today and have noticed a slight anomaly in the automatic mqtt topic name generation specifically for the DHW (hot water) zone (which I believe is a special case in the evohome system because it cannot be renamed by the user).

The topics created are:

evohome/status/thermostat/
evohome/status/thermostat//temp

That is, it looks like the DHW zone takes a zero length string as its name.

The status JSON for evohome/status/thermostat/ is:

{"val":51.03,"state":{"units":"Celsius","indoorTemperature":51.03,"allowedModes":["DHWOn","DHWOff"],"minHeatSetpoint":5,"maxHeatSetpoint":30,"changeableValues":{"mode":"DHWOn","status":"Scheduled"}},"lc":1537123696132}

Thanks

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

setHeatpointSetpoint should be setHeatSetpoint

When setting the temperature via MQTT you get an error evohomeClient.setHeatpointSetpoint is not a function. I researched this and it should be setHeatSetpoint instead of setHeatpointSetpoint.

Multiple Locations on Evohome

Hello, I am trying to pull my second location on Evohome using your very useful app. Is there a way to do this as currently the app only seems to pull the first location alphabetically. any help would be very much welcome! thanks

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.