Skip to content

Domoticz plugin for the EMS Wi-Fi Gateway with Proddy's EMS-ESP firmware

License

Notifications You must be signed in to change notification settings

bbqkees/ems-esp-domoticz-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

license last-commit last-commit-dev

ems-esp-domoticz-plugin

Domoticz plugin for the EMS Wi-Fi Gateway with Proddy's EMS-ESP firmware.

DECEMBER 2021 -> YOU DO NOT NEED THIS PLUGIN ANYMORE

Domoticz now natively supports the Home Assistant MQTT Discovery protocol. The Gateway already supported this protocol. With a recent Domoticz beta version (late December 2021 and onwards) you can get all your EMS parameters into Domoticz without any further plugin. See HERE for the instructions on how to add it to Domoticz. With EMS-ESP until v3.3 all parameters except thermostats are read only, in EMS-ESP v3.4 this will be changed so that all settable parameters are added automatically.

When do you need this plugin?

If you are using the EMS Wi-Fi Gateway (or another setup with) with Proddy's EMS-ESP firmware in combination with Domoticz.



The EMS-ESP firmware communicates via MQTT. Although MQTT is an open format, the required message contents is specific to each home automation system.
The EMS-ESP firmware was intented for integration with Home Assistant (HA).
To communicate with Domoticz you need this plugin that will listen to the topics the Gateway publishes and listens to.
The plugin will basically translate the Home Assistant format to Domoticz format.

Compatibility

This version is compatible with EMS-ESP V2.2 and most V3 versions.

I'm making significant changes to the plugin soon in order to support more simultaneous devices in Domoticz. You can find the new plugin version HERE.

Installation and configuration

Check if you have a MQTT broker/server

The Gateway communicates via MQTT. For this you need a MQTT broker/server installed on your machine. Usually this is Mosquitto.
You can check if your machine has it installed by typing f.i. mosquitto_pub in a terminal.
If it says 'command not found' you need to install Mosquitto first. If you get a list of option Mosquitto is installed and you can continue installing the plugin directly.

Mosquitto 2.0 configuration

Heads up for everyone where the Gateway/EMS-ESP MQTT status will show 'TCP disconnected' after you have updated Mosquitto: The default configuration of Mosquitto version 2.0 only accepts (anonymous) clients from local host (the same machine Mosquitto is running on). So if you have previously used an older version of Mosquitto with no additional config, Mosquitto will now deny external connections from for instance the Gateway/EMS-ESP. In order to accept clients outside of local host you need to add a listener on port 1883. For this to work add the following line to your mosquitty.conf file:

listener 1883

Now is also a good time to add authentication to Mosquitto if you have not already done so. Google around on how to do it (See f.i. http://www.steves-internet-guide.com/mqtt-username-password-example/). If you want to allow anonymous/unauthenticated access instead add the following line to mosquitto.conf:

allow_anonymous true

Installing the plugin

If you have Git installed (preferred method):
Go to the domoticz/plugins directory and run git clone https://github.com/bbqkees/ems-esp-domoticz-plugin.git.

Make sure that 'Accept new Hardware Devices' is enabled in settings/system.
Now restart the domoticz service (by typing sudo systemctl restart domoticz in the shell).
Create a new hardware of the type "EMS bus Wi-Fi Gateway" (Do not create a hardware of the type 'MQTT Client Gateway', this is something different). See the image below.


Set the MQTT server and port. Usually the MQTT server is running on the same machine as Domoticz. If so, you can leave the IP and port to its default setting.

Setting the correct topics

The plugin listens to the topics preceded by "ems-esp/".
Also make sure you don't change the host name of the Gateway otherwise the topic will change as well!
In the latest plugin version you can change the topic string to your own preference if needed.

Set the right MQTT format

In the MQTT setting of the web interface set the MQTT format to 'nested'. Otherwise the plugin won't work as intended.

Using the plugin

The plugin subscribes and publishes to the default MQTT topics of the Gateway.
The plugin captures the messages and updates the Domoticz devices and sensors automatically.
On the first run the plugin will create several devices and sensors in Domoticz.
Go to the 'Devices' tab in Domoticz and search for the devices that are created. You can now add each device to Domoticz by clicking on the small green arrow with 'Add Device'.

Updating the plugin

If you used the git clone command to initially install the plugin just type git pull when in the plugin folder.
Now restart the domoticz service (by typing sudo systemctl restart domoticz in the shell).
On first run of the plugin (takes a minute maybe) additional devices will be created automatically if they were not defined before. Existing devices will not change.

Issues

If you find a problem with the plugin, just open an issue here.
Als if you are missing parameters just let me know.

ToDo list

The mixer logic got a bit more complex in EMS-ESP V2. There are now too many possible ID's and HC's so I need to create an elegant solution for this that fits into the limitations of the Domoticz Python plugin system.

Also there are many ongoing changes in EMS-ESP so it is hard to keep the plugin in perfect sync all the time.

Credits

This plugin was based on the beta version version created by Gert05