I need a gauge style widget that shows the percentage of fuel left in the tank. The item delivers a number between 0 and 1 and I wanted to display a percentage number between 0 and 100. Here is the functioning code that modifies an item value in the valueText component.
backup [--full] [filename] -- Stores the current configuration of openHAB.
clean-cache -- Cleans the openHAB temporary folders.
console -- Opens the openHAB console.
info -- Displays distribution information.
reset-ownership -- Gives openHAB control of its own directories.
restore [--textconfig] [--uiconfig] filename
-- Restores openHAB configuration from a backup.
showlogs -- Displays the log messages of openHAB.
start [--debug] -- Starts openHAB in the terminal.
status -- Checks to see if openHAB is running.
stop -- Stops any running instance of openHAB.
I am using openHAB as my main home automation server. I want to be able to switch on/off Philips Hue lights with the Gira KNX TS3 sensors installed in my rooms.
Basically, you need to create a group address, map it to the TS switch channel, create a virtual KNX device in openHAB and create two rules to link both objects (one rule for switching ON and one for switching OFF).
In the ETS software, create a group address (e.g. 1/9/9) and map it to the TS button’s channel that should allow switching the Hue light ON and OFF.
In openHAB, create a KNX device thing called Virtual KNX switch. Add a channel with type Switch Control and configure it to address 1/9/9. Map an item of type Contact to this channel (let’s name it KitchenVirtualSwitch).
Assuming that your Hue light is called HueLight, create a rule to switch the light ON:
If you try to delete a thing via the GUI in openHAB 4 and it does not get removed (status remains stuck on: removing), you can remove it using the CLI.
In the wish to integrate our Grünbeck water softener softliQ:SD18 into openHAB I tried the existing community binding with unfortunately no success. So I chose the MQTT way with the help of ioBroker. The way data transits from our water softener to openHAB might not be as straightforward as a direct binding, but it works just fine. The data arrives in openHAB through the following workflow: Water-softener => Grünbeck cloud => ioBroker => MQTT broker => openHAB This might sound complicated, but in fact it is not. It just assumes certain requirements.
Requirements
To integrate data from your water softener into openHAB, you need to have the following appliances set up:
a Grünbeck water-softener connected to the Grünbeck cloud
In order to receive data from your Grünbeck cloud in ioBroker, you have to install the Grünbeck adapter in ioBroker. In ioBroker, click on Adapter and search for Grünbeck. Just hit the vertical three dots and then click the “+”-sign.
Now go to the Instances tab and fill in your connection data to the Grünbeck Cloud. Your Grünbeck Cloud Username and password are sufficient if you use an SD device.
2. Connect ioBroker to your MQTT broker
Install the MQTT-client adapter in ioBroker in the same way you did for the Grünbeck cloud adapter.
Configure the access data for your MQTT broker in the newly installed MQTT-client instance. MQTT broker IP-address and port are sufficient, if you do not use authentication.
3. Send your Grünbeck data to the MQTT broker
Now you have to tell ioBroker which information from the Grünbeck adapter you want to have sent to your MQTT broker. If your Grünbeck adapter is correctly configured, your object list should show similar data points like these:
The first subfolder under softliQ gives you information about your device (I hid the name of the folder as it is the serial number of the device). In my installation, this folder includes three subfolders named Stream, measurements and parameters. You have to browse these folders and find out what the different objects mean.
Let’s say you want to have the water counter sent to your openHAB instance. The Stream subfolder includes an object named mcountwater1. This object is the water counter (in liters). You have to click on the gear at the end of the line listing this object (see selected line in the above screenshot).
You should see a menu point for your MQTT client (probably mqtt-client.0, if you have only one MQTT client defined). Define a Topic for this object and activate it. You can freely make the topic tree in MQTT fit to your needs. ioBroker suggests quite a long one based on the structure in the object list. I prefer to reduce the number of subtopics to make it more easily readable.
After saving the MQTT info, your MQTT browser (I use MQTT Explorer) should show the requested data in a few seconds. The following two images show what data points are available in the Stream folder and general folder for my SD18.
4. Configure openHAB to import the Grünbeck data from the MQTT broker
To read MQTT telegrams in openHAB, you need to install the MQTT binding. Go to openHAB’s administrationsettings, Add-ons: Bindings and install the MQTT binding.
To start, you need to add an MQTT Broker bridge. Go to the things tab and add a thing based on the MQTT binding. Select MQTT Broker. Give it a name (example: MQTT bridge). Enter the IP address of the MQTT broker. Save.
Now add a Generic MQTT Thing. Give it a name (example: Grünbeck water softener) and link it to the above created bridge. Save. We will use this thing to centralise all Grünbeck data from our water softener.
Now select the Channels tab in the thing you just created. Click on Add channel and enter for the MQTT State Topic the Topic information you defined in the MQTT settings for your Grünbeck object in ioBroker. If you like, you can add your Unit of Measurement (Show advanced). Click Done.
Now add a Link to an item to this channel.
Now your item should show the amount of water treated by the water softener.
Add all the channels that you need and integrate the items to your sitemap in openHAB.
In search to connect our Buderus boiler (heating, warm water system, hot water solar panels) to openHAB, I stumbled over an EMS gateway developed by a dutch engineer.
1. Installing the EMS gateway
I ordered the Wifi edition and connected it via the mini-jack cable to the boiler system. The boiler system also delivers power to the gateway over this cable.
The connection to the WIFI network was straight forward (chapter 8.1 of the manual) and the gateway automatically detected all the devices connected to our boiler. It immediately started displaying live data from the boiler.
2. Setting up an MQTT broker
We will use MQTT to send the boiler data to the openHAB system: the EMS gateway will send the boiler data to the MQTT broker which relays it onto the network. openHAB then needs to listen to this telegrams and interpret them.
Installing Mosquitto in an ubuntu VM was straight forward:
sudo apt-get install mosquitto mosquitto-clients
If you run the MQTT broker behind a firewall, it might not be necessary to force authentication. Entering the IP address and port of the MQTT broker in the gateway was straight forward. Do not forget to define a base, a kind of a channel on which MQTT will broadcast your telegrams. I chose ems-esp. The gateway then immediately began sending the boiler data to the broker.
3. prepare openHAB to receive and treat the incoming data
3a: Go to openHAB’s administrationsettings, Add-ons: Bindings and install the MQTT binding.
3b. Go to openHAB’s administration settings, Add-ons: Other Add-ons, Transformation Add-ons and install theJSONPATH Transformation.
4. Configure openHAB to receive the MQTT telegrams
4a.1: From this step on, you can either add a “HomeAssistant MQTT Component” which auto-detects all EMS things. In order for this to work, you need to activate the “MQTT Discovery (Home Assistant, Domoticz)” in the MQTT settings in the EMS gateway.
4a.2: I decided to go the manual way to have full control over the things and items to add to openHAB. You need to add an MQTT Broker bridge. Go to the things tab and add a thing based on the MQTT binding. Select MQTT Broker. Enter the IP address of the MQTT broker. Save.
4b. Then add a Generic MQTT Thing. I linked it to the above created bridge. To have a better overview, I created a generic thing for the boiler, one for the warm water and one for the solar data.
4c: Now you have to add the data points that you want to import into openHAB as items. If you don’t know which data points are available, use an MQTT Explorer to get a better insight into your data.
4d: For each data point, you need to define a channel in openHAB. Open the MQTT genericthing that you created, click on the channel tab, and click add channel. Add the channel identifier, the label and select the corresponding channel type. In our example, we select Number Value, as we want to catch a temperature value.
The MQTT State Topic‘s first part is the base that you defined in the MQTT broker settings in the EMS gateway. In our case: ems-esp. The second part of the topic gives more details about the object you want to catch. Your MQTT explorer will help you determine which information telegrams are available.
In order to precise which value of the current object you want to import, you have to click the Show advanced check box.
As the object information is received in JSON format, you have to use JSONPATHTransformation to catch the exact value that you need (do not forget to install the JSONPATH tranformation, see 3b above). In our case, enter JSONPATH:$.curflowtemp under Transformation Values: Incoming Value transformations. This will extract the value for the current flow temperature object in the ems-esp/boiler_data telegram. As this is a temperature, you can add the Unit of Measurement if you want. In our case it is in Celsius degrees, so we add °C here. Click CREATE if you have entered all the necessary information.
Now you have to link the channel to an item (click: Add link to Item). This is standard openHAB procedure. As soon as you save the item that you created/linked, the value will show up!
You have to repeat the step 4d for each data point you want to import.