Skip to content

Commit 86fb6d9

Browse files
authored
Add details about 'api_password' (home-assistant#5497)
* Add details about 'api_password' * Add details about IP filtering and banning * Add hint about charging
1 parent 481e045 commit 86fb6d9

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed

source/_components/binary_sensor.mystrom.markdown

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,24 @@ The buttons will give you feedback with its built-in LED:
2828
- white then green: Pattern was submitted successfully
2929
- white then red: There is a problem with the communication
3030

31-
To use your myStrom WiFi Button in your installation, add the following to your `configuration.yaml` file:
31+
### {% linkable_title Setup of myStrom Buttons %}
3232

33-
```yaml
34-
# Example configuration.yaml entry
35-
binary_sensor:
36-
- platform: mystrom
37-
```
33+
You need to configure every button to make it work with Home Assistant. First connect the Wifi Buttons to your wireless network. Once a button is connected you have three minutes to set the actions for the push patterns if the button is not charging. The fastest way is to use `curl`. Check the [documentation](https://mystrom.ch/wp-content/uploads/REST_API_WBP.txt) of the WiFi Button for further details about the implementation (`http://` is replaced by `get://` or `post://`). `action` is the name of the corresponding push pattern (see above).
3834

39-
### {% linkable_title Setup of the myStrom Buttons %}
35+
The endpoint that is receiving the data is `http://[IP address Home Assistant]:8123/api/mystrom`. If you have set an [`api_password`](/components/http/) then this needs to be included in the URL.
4036

41-
You need to configure every button to make it work with Home Assistant. First connect the Wifi Buttons to your wireless network. Once a button is connected you have three minutes to set the actions for the push patterns. The fastest way is to use `curl`. Check the [documentation](https://mystrom.ch/wp-content/uploads/REST_API_WBP.txt) of the WiFi Button for further details about the implementation (`http://` is replaced by `get://` or `post://`). `action` is the name of the corresponding push pattern (see above).
37+
With `api_password:`
4238

43-
The endpoint that is receiving the data is `[IP address Home Assistant]:8123/api/mystrom`.
39+
```
40+
$ curl -d "[action]=get://[IP address Home Assistant]:8123/api/mystrom?api_password%3D[api_password]%26[action]%3D[ID of the button]" \
41+
http://[IP address of the button]/api/v1/device/[MAC address of the button]
42+
```
43+
44+
Without `api_password`:
4445

4546
```bash
46-
$ curl -d "[action]=get://[IP address Home Assistant]:8123/api/mystrom?[action]%3D[ID of the button]" http://[IP address of the button]/api/v1/device/[MAC address of the button]
47+
$ curl -d "[action]=get://[IP address Home Assistant]:8123/api/mystrom?[action]%3D[ID of the button]" \
48+
http://[IP address of the button]/api/v1/device/[MAC address of the button]
4749
{
4850
"[MAC address of the button]": {
4951
"type": "button",
@@ -52,7 +54,7 @@ $ curl -d "[action]=get://[IP address Home Assistant]:8123/api/mystrom?[action]%
5254
"meshroot": false,
5355
"charge": true,
5456
"voltage": 4.292,
55-
"fw_version": "2.26",
57+
"fw_version": "2.56",
5658
"single": "get://[IP address Home Assistant]:8123/api/mystrom?single=[id of the button]",
5759
"double": "",
5860
"long": "",
@@ -67,6 +69,26 @@ A complete command to set the URL for a double click could look like the example
6769
$ curl -d "double=get://192.168.1.3:8123/api/mystrom?double%3DButton1" http://192.168.1.12/api/v1/device/4D5F5D5CD553
6870
```
6971

72+
With an `api_password`:
73+
74+
```bash
75+
curl -d "double=get://192.168.1.3:8123/api/mystrom?api_password%3Dapi_password%26double%3DButton1" http://192.168.1.12/api/v1/device/4D5F5D5CD553
76+
```
77+
78+
The command-line tool [`mystrom`](https://github.com/fabaff/python-mystrom) is a helper to configure myStrom buttons.
79+
80+
If you have set [`login_attempts_threshold`](/components/http/) and forget to include the `api_password` for an action and that action is triggered then after the threshold is reached will the button no longer work because it is banned. See [IP filtering and banning](/components/http/#ip-filtering-and-banning) about how to revert the banning.
81+
82+
## {% linkable_title Configuration %}
83+
84+
To use your myStrom WiFi Button in your installation, add the following to your `configuration.yaml` file:
85+
86+
```yaml
87+
# Example configuration.yaml entry
88+
binary_sensor:
89+
- platform: mystrom
90+
```
91+
7092
<p class='note'>
71-
The firmware version 2.26 doesn't support TLS/SSL. This means that you are only able to use the WiFi Buttons if you are using plain-text communication between Home Assistant and the clients/entities.
93+
The firmware version 2.56 doesn't support TLS/SSL. This means that you are only able to use the WiFi Buttons if you are using plain-text communication between Home Assistant and the clients/entities.
7294
</p>

0 commit comments

Comments
 (0)