MyStrom Eco Power Binding with Openhab 2

Hello community

I‘m a beginner on Openhab 2 and would like to control mystrom switches with openhab 2.
When i search the binding, i find the mystrom eco power binding that matched with my devices. But this binding is marked with „manual/legacy“.
Can I use this binding for openhab 2 and how i can
install it?

I have no plan how i can do this :flushed:

I’ll be very happy if someone can give me a tip.

Thank and best regards
Marcel

The meaning of legacy is, there should be a native OH2 binding for that (no, there is none…) so, the other option is
manual, which is, the binding was not marked as compatible to OH2 yet and also was not optimized to enable automatic install through openHAB2 Administration.
But there is a good chance, that the binding works anyway.

It’s almost straight forward, so don’t fear openHAB’s “complexity”.

Hi Udo

Thanks for your answer … my switches will not run :frowning:

  • I have execute “feature:install openhab-runtime-compat1x”
  • I have copy the jar-file into the addon-folder
  • I have set “Include Legacy 1.x Bindings”
  • I habe restart the openhab2

Now i have try to install the mystromecopower binding in paper ui, but the binding isn’t
visible there.

In the logfile openhab.log is see that a part of the binding is startet (i see my switches):
2017-11-28 23:24:50.292 [INFO ] [ower.internal.MyStromEcoPowerBinding] - Do mystrom discovery
2017-11-28 23:24:50.706 [INFO ] [ower.internal.MyStromEcoPowerBinding] - Mystrom device name: ‘01-Christbaum Aussen’, mystrom device id:'64002D047466’
2017-11-28 23:24:50.708 [INFO ] [ower.internal.MyStromEcoPowerBinding] - Mystrom device name: ‘Licht Bad’, mystrom device id:'64002D02363D’
2017-11-28 23:24:50.710 [INFO ] [ower.internal.MyStromEcoPowerBinding] - Mystrom device name: ‘Wohnzimmer’, mystrom device id:'64002D03DA0B’
2017-11-28 23:24:50.712 [INFO ] [ower.internal.MyStromEcoPowerBinding] - Mystrom device name: ‘Samuel’, mystrom device id:'5CCF7FA0B2FB’
2017-11-28 23:24:50.714 [INFO ] [ower.internal.MyStromEcoPowerBinding] - Mystrom device name: ‘WiFi Button’, mystrom device id:'5CCF7F0CB680’
2017-11-28 23:24:50.717 [INFO ] [ower.internal.MyStromEcoPowerBinding] - Mystrom device name: ‘Rasenmäher’, mystrom device id:'64002D023184’
2017-11-28 23:24:50.719 [INFO ] [ower.internal.MyStromEcoPowerBinding] - Mystrom device name: ‘Waschmaschine’, mystrom device id:'64002D02312D’
2017-11-28 23:24:50.721 [INFO ] [ower.internal.MyStromEcoPowerBinding] - Mystrom device name: ‘Ladegerät Velo’, mystrom device id:'64002D023666’
2017-11-28 23:24:50.724 [INFO ] [ower.internal.MyStromEcoPowerBinding] - Mystrom device name: ‘Secomat’, mystrom device id:'64002D023158’
2017-11-28 23:24:50.727 [INFO ] [ower.internal.MyStromEcoPowerBinding] - Mystrom device name: ‘Entfeuchtet Garage’, mystrom device id:‘64002D0230F3’

I don’t no what i should do with the openhab.cfg, i haven’t found this file. Also i don’t find the file
mystromecopower.cfg. Are this to files probably my problem?

Thank you very much and best regards
Marcel

As you are using openHAB2, you will have to use services/mystromecopower.cfg to configure the binding.
As this is an openHAB1 Binding, you have to define items in an .items file (see the last Link on my previous posting, readme for mystrom binding).

is the file services/mystromecopower.cfg to create by myself, or should it be already there?

As you manually installed the binding, you also will have to create it manually.

If that doesn’t work, you may need to create an openhab.cfg file and put the mystromecopower config items in that with mystromecopower: prepended to each entry. When using the compat layer I don’t know if it lets you split out the configs or not.

Thanks for your answers. Now the switches works fine (command, state & power consumption). The only not comfortable thing is the long refresh time of the state, when i change the state of the switch by pressing the button on the switch … there are more then a half minute for refresh.
I there a possibility to make the refresh time shorter?

If there is it will be a setting on the binding. See the README for available settings.

Help required:
I own a couple of MyStrom Switches but am lost in installation of the binding ob my Raspberry (latest Openhab Version installed).

I managed to download the .jar file but somehow I can not follow the steps described above (I am quiet new).

Best regards
Daniel

My two MyStrom devices are successfully discovered, but I cannot use them. Log file tells me:

[ERROR] [ower.internal.MyStromEcoPowerBinding] - Unable to send command to 'Switch_Drucker' device is not in discovery table

Is there a problem with my .items file or what reason is there behinde this error?
Item definition is:

Switch		Switch_Drucker						(GF_Office)				 	{mystromecopower="Drucker"}

Thanks for any hint!

The items file looks fine.

Did you consider all steps in the installation of the binding?

However, please find below my personal walk trough guide" to get mystromecopower binding work in openhab 2.2:

  1. The Mystromecopwer Devices have to be installed through App and Internet. The friendly names (naming of the devices e.g. “Printer” as used in App) have to be known.
  2. The Legacy 1 Binding support has to be installed (trough PaperUI)
  3. Download the …jar file for binding and copy it into the correct folder: /usr/share/openhab2/addons/
  4. Set permissions on …jar file: sudo chown openhab:openhab org.openhab.binding.mystromecopower-1.12.0-SNAPSHOT.jar
  5. Create an openhab.cfg file with the content:
    mystromecopower:userName=xyz@abc.com // username for mystrom acconut
    mystromecopower:password=pwd // password for mystrom account
  6. Copy the file openhab.cfg to the folder: /etc/openhab2/services
  7. Create a mystromeccopower.items file (as you did) and copy to folder: /etc/openhab2/items
  8. Create a sitemap entry

Best regards, may it help.
Daniel

Hi Daniel

Thanks for your guide. I’ve followed it but I got the same Error as @Chrysokomas. Is there any possibility to check the Connection of the Binding or to check if it’s installed correctly?

If you need some Logs or more infos, please let me know :wink:

Greetings

It finally works at my place. I initially was not aware that i have to name the config file “openhab.cfg” and use it the “old way”. So my approach having a “mystromecopower.cfg” was completely wrong. Once I changed the config file to the way @dandil described it was fine.

Thanks a lot for your great help!!!

@seljo

did you consider the naming of openhab.cfg and the other details (according to my experience every detail (path, permissions, etc. is relevant)

@dandil

Yes. I’ve followed each step of your guide. I’ve installed the Legacy Support, I’ve downloaded the and copied the *.jar File, set the Permission and created the openhab.cfg file with my credentials.

The only difference I can see, i’ve created the files directly in the paths with the Visual Code tool.

In the Logfiles, I got the same message. Maybe I’can send you some files? Or some code from my System?

@seljo
Dear Oliver

Feel free to post your configuration/Log files. I am not an expert myself, but maybe I or someone else can help.

Plese find below an extract from my configuration files:

I used the following binding file: org.openhab.binding.mystromecopower-1.12.0-SNAPSHOT.jar

openhab.cfg:

   mystromecopower:userName=XXXXXXXXX
   mystromecopower:password=YYYYYYYYYYYY

mystromecopower.items:

// Konfiguration Items für mystromecopower
// Stern
    Switch Fiona_Stern_IO       "Stern Ein/Aus"	        (gLICHT_FIO, gLICHT_EIN)    {mystromecopower="Stern"}
    Number Fiona_Stern_watt     "Stern Watt [%.2f W]"   (gLICHT_FIO)    {mystromecopower="Stern"}
    String Fiona_Stern_Status   "Stern Status"          (gLICHT_FIO)    {mystromecopower="Stern"}
// Home
    Switch Fiona_Home_IO    	"Home Ein/Aus"          (gLICHT_FIO, gLICHT_EIN)    {mystromecopower="Home"}
    Number Fiona_Home_watt  	"Home Watt [%.2f W]"    (gLICHT_FIO)    {mystromecopower="Home"}
    String Fiona_Home_Status    "Home Status"           (gLICHT_FIO)    {mystromecopower="Home"}
// Kugeln
    Switch Fiona_Kugeln_IO    	"Kugeln Ein/Aus"        (gLICHT_FIO, gLICHT_EIN)    {mystromecopower="Kugeln"}
    Number Fiona_Kugeln_watt  	"Kugeln Watt [%.2f W]"  (gLICHT_FIO)    {mystromecopower="Kugeln"}
    String Fiona_Kugeln_Status  "Kugeln Status"         (gLICHT_FIO)    {mystromecopower="Kugeln"}

==> Be aware that the friently name (in the above exampe Stern, Kugeln and Home) need to be exact the same as in the mystromecopower account.

default.sitemap:

sitemap default label="default" 
...
	Frame label="Licht" {
		Text label="Fiona" icon="light"	{
			Switch		item=HM_Schaltaktor_FIO_STATE label="Dekenlicht Fiona"	mappings=[OFF="Aus", ON="Ein"]	icon="light" 
			Switch		item=Fiona_Stern_IO 		label="Stern"		mappings=[OFF="Aus", ON="Ein"]		icon="light"	
			Text		item=Fiona_Stern_Status 	label="Stern Status [%s]"
			Switch		item=Fiona_Kugeln_IO 		label="Kugeln"		mappings=[OFF="Aus", ON="Ein"]		icon="light"
			Text		item=Fiona_Kugeln_Status 	label="Kugeln Status [%s]"
			Switch		item=Fiona_Home_IO 			label="Hänger"			mappings=[OFF="Aus", ON="Ein"]	icon="light"
			Text		item=Fiona_Home_Status	 	label="Hänger Status [%s]"
			Switch 		item=HM_Switch_02_STATE 	label="Home Schild" 	mappings=[OFF="Aus", ON="Ein"]	icon="light"		
			Switch		item=HUE_LED_Fiona_Dimmer	label="LED-Uhr I/O"		mappings=[OFF="Aus", ON="Ein"]	icon="light"
			Slider 		item=HUE_LED_Fiona_Dimmer 	label="LED-Uhr Dimmer [%.1f]"		icon="colorlight"			
			Colorpicker item=HUE_LED_Fiona_Farbe	label="LED-Uhr Farbe" 				icon="colorwheel"
			Slider		item=HUE_LED_Fiona_FarbTemp	label="LED-Uhr Farbtemperatur"		icon="colorlight"
			Switch		item=HUE_LED_Fiona_Farbwechsel label="LED-Uhr Farbwechsel"	mappings=[OFF="Aus", ON="Ein"]	icon="siren"
        }
}
...
end

A “thing” is not recognized in PaperUI. It only works after the item file is loaded. I use ftp to upload the files, the edit I do locally.

Best regards
Daniel

Dear Daniel

Thanks a lot. I’ll get another try this evening.

Regards

Olivier

Bad news… Today it does no longer work and I have again the “not in discovery table” error. No idea what happened and why it does no longer work…!

Hi Dave

Try it with the Code from Daniel. To test it change the Username an Password in the cfg file and the “Friendliy Names” in the Items.
Then test it. That worked for me.

Regards
Olivier