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=&double=&long=&touch=" 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 „:“)