NEWS
Adapter für MyStrom Wifi Button
-
Hallo,
kann mir jemand sagen, ob es einen Adapter für den Wifi Button von mystrom gibt?
Ich habe nur einen für den Wifi Switch gefunden.
Mir wurde gesagt, das eigentlich kein Adapter benötigt wird und der Button direkt per URL abgefragt wird.
Aber wo mache ich das bzw. mit welchem Adapter?
Oder geht das nur wenn ich über Scripte programmiere?
Hier die Doku zu der API:
! WIFI Button – REST API
! The myStrom WiFi Button offers a REST API (REST = representational State Transfer).
! The interface allows you to access/control the Button directly from your local network independently from myStrom - you don’t need a myStrom account or the myStrom app.
! With those rules you can integrate the button in almost any environment.
! Important Note
! The interface is transparent and has no authentication. If someone has access to your local network, they will be able to control your button.
! Please apply strong security mechanisms to protect your network.
! Get Info
! http://[IP]/api/v1/device/[MAC]
! Response
! {
! "[MAC]": {"type": "button", "battery": true, "reachable": true, "meshroot": false, "charge": false, "voltage": 3.705, "fw_version": "2.37", "single": "", "double": "", "long": "", "touch": ""}
! }
! Set Config
! curl -v -d "single=<url>&double=<url>&long=<url>&touch=<url>" http://[IP]/api/v1/device/[MAC]
! The order of parameters is not relevant. Request must have at least one parameter. URL to be sent must be encoded using x-www-form-urlencoded notation.
! In order to make it possible and simple at the same time to specify in the URL that specific request should be sent as GET or POST we introduced a special (very unusual) conventions. URL is considered as get when it starts with get:// and as post when it starts with post:// (in both cases get and post replaces the usual http prefix). GET is sent as is and POST is sent such, that parameters from URL are sent as POST body.
! Simple Example für myStrom Switch
! curl -v -d "single=get://[IP of Switch]/toggle" http://[IP]/api/v1/device/[MAC]
! Simple Example für myStrom Bulb
! curl -v -d "single=post://[IP of Bulb]/api/v1/device/[MAC of Bulb]?action%3Dtoggle" http://[IP]/api/v1/device/[MAC]
! curl -v -d "single=post://[IP of Bulb]/api/v1/device/[MAC of Bulb]?action%3Dtoggle%26color%3DFF000000" http://[IP]/api/v1/device/[MAC]
! [IP] – IP Address of your Button e.g. 192.168.1.99
! [MAC] – MAC Address of your Button e.g 5CCF7F02D676 (all capital letters / no „:“)</url></url></url></url>Danke & Gruß
-
Also ich war gerade auch auf der Suche nach einem Adapter oder eine Lösung.
bin auf eine Lösung sowie auf einen inoffiziellen Adapter gestossen. Der Adapter kann einfach die Switches steuern und mit dem Blogpost den Buttons sagen das er States im ioBroker ändern soll.
-
Hallo zusammen
hat jemand den Button erfolgreich eingebunden?
Also ich habe jetzt grundsätzlich alles soweit geschafft.
Ich möchte mit dem Button eine Scene schalten.
Die UEL wärehttp://192.168.xxx.xxx:8087/set/scene.0.Guten_Morgen?value=true
Beim aufrufen im Browser klappt das auch einwandfrei.
Aber welcher Befehl muss ich auf den Button schicken?
Es klappt weder die URL mit http noch mit set://Nachtrag: mit einem get:// hat es dann GEklappT