myStrom WiFi Switch is a smart plug that switches a load and measures its power over the local Wi-Fi network. The Weble IoT Universal Gateway MyStrom driver finds the myStrom devices of the local network by itself, reads the power and temperature of the switches and switches their relay.
Driver key:
mystrom— listed as MyStrom under Building Automation in Gateway driver. Licence: not required. Platforms: Linux and Windows.
0.Open the address table: each switch appears as %mystrom:<MAC address> with its sub-addresses. The …/report values update every 5 seconds. Write 1 to …/relay to switch the plug on.
Name (labelled Host in this form), Cluster ID and Description are common to all drivers: see Gateways. The driver has no other gateway parameter.
Keep this gateway on Cluster ID
0: this driver is meant to run in its own process, not in a cluster shared with other gateways.
{}
%mystrom:<device>[/<path>] — <device> is the MAC address of the device (created by the scan) or its IP address (created by hand).
| Address | Created by | Value |
|---|---|---|
%mystrom:<MAC> |
the scan | Device information returned by the device (/api/v1/info): name, type, MAC, firmware… |
…/report |
the driver | Report of the switch (power, relay state), polled every 5000 ms, with one sub-address per field (for example …/report/power). |
…/temp |
the driver | Temperature measured by the switch, polled every 5000 ms, with one sub-address per field. |
…/relay |
the driver | Relay command: write 1 (on) or 0 (off). |
Examples:
%mystrom:64002D1A2B3C/relay — switch the plug on or off.%mystrom:64002D1A2B3C/report/power — power drawn by the load.%mystrom:192.168.1.60 — a device inserted by hand with its IP address.The scan sets the IP address of the device in the address JSON (json.host) and updates it when the device is found again.
| Label | JSON key | Default | Description |
|---|---|---|---|
| Host/IP | name |
MAC or IP address of the device, after the %mystrom: prefix. To add a device that the scan does not find (other subnet), insert its IP address. |
|
| Polling | json.polling |
0 |
Refresh period in ms of a sub-address. 0: not polled. Minimum 1000 ms. …/report and …/temp are created with 5000 ms. |
| Description | description |
name of the device | Free text. |
| Log | log |
never | Logging policy, see Log and Store value policies. |
Polling changes apply immediately, without restarting the gateway.
| Property | Value |
|---|---|
| Readable | Yes — polled (no read on demand) |
| Writable | …/relay only |
| Created automatically | Yes — by the network scan, and sub-addresses from the device type and the polled answers |
| Routable | Yes |
| Loggable | Yes |
At start, the driver scans every subnet of the box network interfaces whose mask is /24 or narrower, and asks each IP address for its device information. Each myStrom device that answers gets an address named with its MAC address, so it is found again if its IP address changes. If a device stops answering for 24 hours, the driver scans the network again.
Networks wider than /24 are not scanned: insert the devices by IP address.
The full set of sub-addresses (report, temperature, relay) is created for the WiFi Switch (type 101 / WS2). Other myStrom devices (bulb, buttons) are found by the scan, but without polled or writable sub-addresses. A device of an unknown type is logged unknown device type … (no reference model).
Write 1 / true to …/relay to switch on, 0 / false to switch off. The new state is visible in …/report at the next polling.
Route a Cron address or a KNX switch to %mystrom:<MAC>/relay.
Log %mystrom:<MAC>/report/power with on_update and show it on a dashboard.
| Symptom | Cause | What to do |
|---|---|---|
| No address after start | The devices are in a subnet that the box does not reach directly, or the subnet is wider than /24. | Insert the device by its IP address (Host/IP). |
Status pending or an error on …/report; log poll failed … |
The device does not answer (off, Wi-Fi lost, new IP address). | Check the device; give it a fixed IP address. The log shows poll recovered when it answers again. |
Write fails with Not writtable address |
The address is not …/relay. |
Write to the …/relay sub-address. |
Write fails with invalid host destination |
The device has not been found yet. | Wait for the scan, or insert the device by IP address. |
To read the driver log: open the gateway log (see Gateways).