Skip to main content

Transfer HTTP requests from myStrom devices to MQTT

Project description

myStrom buttons allows to send HTTP requests. If a press pattern is applied then a request is send to a devices.

This module is not official, developed, supported or endorsed by myStrom AG.

For questions and other inquiries, use the issue tracker in this repository please.

myStrom AG has provided and is still providing hardware for testing and development.

Supported home automation platforms

Add the moment the following platforms are supported:

Requirements

You need to have Python installed.

  • myStrom button (button or button+, could work with the Motion sensor too)

  • A MQTT broker

  • Network connection

  • Devices connected to your network

Installation

The package is available in the Python Package Index .

$ pip3 install mystrom2mqtt

Usage

Set the target of the button. The port which is used by mystrom2mqtt is 8321.

curl --location --request POST 'http://[IP of the button]/api/v1/action/generic' \
  --data-raw 'post://[mystrom2mqtt host]:8321'

A configuration file is needed. The format is TOML and the default name config.toml.

[mystrom2mqtt]
broker = "192.168.0.20"
port = 1883
username = "mqtt"
password = "mqtt"

To start `mystrom2mqtt specify the path with -c, --config to the configuration file:

mystrom2mqtt -c path/to/config.toml

To autostart mystrom2mqtt create a systemd unit file named /etc/systemd/system/mystrom2mqtt.service with the parameters you

[Unit]
Description=myStrom2MQTT
After=network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/mystrom2mqtt -c "/path/to/config.toml"

[Install]
WantedBy=multi-user.target

License

mystrom2mqtt is licensed under ASL 2.0, for more details check LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mystrom2mqtt-0.1.0.tar.gz (8.5 kB view hashes)

Uploaded Source

Built Distribution

mystrom2mqtt-0.1.0-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page