Giter Site home page Giter Site logo

dobiss2mqtt's Introduction

Dobiss 2 MQTT

This service needs to be pointed to a Dobiss CAN Programmer as well as an MQTT server.

It will then expose your lights (outputs) as MQTT lights using the Home Assistant discovery protocol.

For now this only supports:

  • turning relay, dimmer & 0-10v outputs on/off
  • dimming dimmer and 0-10v outputs to a specific percentage
  • reading the state of outputs if relay, dimmer & 0-10v modules

It will set up a socket connection to the CAN Programmer. The intention is to not have a permanent connection set up so that the regular dobiss app still works nicely alongside this service. For the moment though the socket is always connected. Which means that the native dobiss apps might encounter issues.

It will make a lot of requests to your CAN Programmer since it'll poll for the state of every relay you have.

Config

See data/config.js.example for the main configuration. Rename it to config.js and place it under the data folder.

There are also a couple of things which can be configured through an environment variable or through the config file.

env config key description example
CONFIG_PATH - Where does the config.js file live. /data/config.js
POLL_INTERVAL_IN_MS pollIntervalInMs To control the polling interval. Eg: the time between polling the output states on the modules in milliseconds. 500
MQTT_URL mqtt.urls URL for the MQTT broker mqtt://host
DOBISS_HOST dobiss.host IP of your Dobiss IP Interface (CAN Programmer) 192.168.0.2
DOBISS_PORT dobiss.port Port of your Dobiss IP Interface (CAN Programmer) 10001
DOBISS_INTERFACE dobiss.interface Which type of Dobiss installation. See Dobiss Installation Types for the possibilities. ANBIANCEPRO
- modules The array of modules along with their outputs available on your dobiss installation. Needs to be configured in the config file. -
DEBUG - Control what gets logged. See debug npm package. Everything from dobiss2mqtt starts with 'dobiss2mqtt.' *

Dobiss Installation Types

I don't know all the protocols dobiss speaks. But this is a list of all the installations / systems there are. http://www.dobiss.com/nl/vorige-gammas as well as http://www.dobiss.com/nl/onze-oplossingen.

SX Evolution

Set dobiss.interface to SXEVOLUTION

SX Ambiance

Set dobiss.interface to SXAMBIANCE

Currently this is linked to the same protocol as SXEVOLUTION. This might not be working correctly.

SX has a dimmer range going from 0 to 10. So brightness changes in steps of 10%.

0-10v modules are not tested on this. If it works, let me know.

Ambiance PRO

Set dobiss.interface to AMBIANCEPRO

Evolution PRO

Set dobiss.interface to EVOLUTIONPRO

Currently this is linked to the same protocol as AMBIANCEPRO. This might not be working correctly.

0-10v modules are not tested on this. If it works, let me know.

NXT

Set dobiss.interface to NXT.

Currently this is linked to the same protocol as AMBIANCEPRO. This might not be working correctly. Perhaps NXT also implements this older protocol. Let me know if this does not work.

It appears NXT works via a new API via REST and WebSockets. This is not implemented currently. If you have an NXT system, and are not affraid to dig into the code a little bit, reach out on the home assistant community and we can help you integrate it.

Installation

Docker

Here's an example config. Make sure to mount your data folder containing the config.js file.

version: '3.5'

services:
  dobiss2mqtt:
    container_name: dobiss2mqtt
    image: vincentds/dobiss2mqtt:latest
    restart: unless-stopped
    volumes:
    - source: /tank/configs/dobiss2mqtt
      target: /data
      type: bind

Development

Grab node which is defined in package.json -> volta.node.

Create a config.js file in the data folder based on the example file provided.

npm i && npm run start should get you up and running with ts-node-dev executing the typescript code and restarting automatically when you make a change.

It will set the ENV of CONFIG_PATH to ./data/config.js so that it will load the correct file.

It's set up to ignore reloading when the config.js file changes.

Make sure npm run validate passes.

Create a PR when stuff is working. I know that tests should be added to create a good PR. I will look into refactoring the codebase a bit so that testing is easier and everything is a bit more modular.

dobiss2mqtt's People

Contributors

dependabot[bot] avatar spobo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dobiss2mqtt's Issues

Possible memory leak

I've seen this in my debug log of docker but i'm not sure if this is a problem.

dobiss2mqtt |
dobiss2mqtt | > [email protected] start:prod /app
dobiss2mqtt | > NODE_ENV=production node ./dist/index.js
dobiss2mqtt |
dobiss2mqtt | (node:20) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [MqttClient]. Use emitter.setMaxListeners() to increase limit

Support for raspberry pi 3/4?

I see on docker hub there is only an amd64 version available. Any reason why there isn't support for arm/v7 like the pi's are using?

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.