Integrating Mystrom Buttons

This tutorial is about making Mystrom Button work with Openhab. I have a button on my night table to switch on/off the lights and open/close my rollershutters without going out of my bed.

I use the Wifi button from:

With firmware 2.74.31 they added support for content type plain/text and json which enabled the button to talk directly to REST API of Openhab items. Before they used application/x-www-form-urlencoded which was not working.

So first upgrade your button. You see version 2.74 only in the Mystrom app on your mobile. When you use curl to connect to your button you see the full version:

$ curl -v
* Trying
* Connected to ( port 80 (#0)
GET /api/v1/info HTTP/1.1
User-Agent: curl/7.54.0
Accept: */*
 HTTP/1.1 200 OK
 Pragma: no-cache
 Cache-Control: no-store, no-cache
 Access-Control-Allow-Origin: *
 Content-Type: application/json
 Content-Length: 245
 Connection: close

	"version": "**2.74.31**",
	"mac": "60019XXXXX",
	"type": 104,
	"ssid": "whatever",
	"ip": "",
	"mask": "",
	"gw": "",
	"dns": "",
	"static": true,
	"connected": true,
	"signal": 54
* Closing connection 0

I used some virtual items in Openhab, which I reset after a second with the expire binding:
Group:Switch:AND(OFF,ON) Mystrom_Button

Switch Mystrom_Button_Short (Mystrom_Button) { expire="1s,command=OFF" }
Switch Mystrom_Button_Long (Mystrom_Button) { expire="1s,command=OFF" }
Switch Mystrom_Button_Double (Mystrom_Button) { expire="1s,command=OFF" }

Then I use the following rule to switch my lights (two in this case).
Single click = Toggle Light1
Long click = Toogle Light2
Double click = Switch off Light1 & Light2

rule “Licht Zimmer1”
Member of Mystrom_Button changed to ON
switch ( {
case “Mystrom_Button_Short”: {
switch (Light1.state.toString) {
case “ON”: { Light1.sendCommand(OFF)
case “OFF”: { Light1.sendCommand(ON)
case “Mystrom_Button_Long”: {
switch (Light2.state.toString) {
case “ON”: { Light2.sendCommand(OFF)
case “OFF”: { Light2.sendCommand(ON)
case “Mystrom_Button_Double”: {

When you configure the button preferably with a fix IP, the button need to be in config mode in order you can send commands by curl. To get into config mode you need to connect the button with power and then hold the button for about 3-5s. After you let it go it should stay in config mode for some minutes.

To configure the button to trigger my virtual items above I used the following commands:

curl -v -d "single=post://OpenhabIP%3A8080%2Frest/items/Mystrom_Button_Short/?ON"
curl -v -d "double=post://OpenhabIP%3A8080%2Frest/items/Mystrom_Button_Double/?ON"
curl -v -d "long=post://OpenhabIP%3A8080%2Frest/items/Mystrom_Button_Long/?ON"

–> OpenhabIP = IP of my Openhab Server
–> 60019XXXXX = Mac Address of my Mystrom Button. Check Mystrom App or curl call above.
–> = IP of my Mystrom Button

Hope this helps to create some nice addition to your installation :slight_smile:


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.