Today i installed the Home Assistant Operating System on a Raspberry 4 and got it working as well.
A bit more of an effort:
create the folder
/config/custom_components/
if there are no custom components already.
download or git-clone https://github.com/home-assistant/core
i downloaded the zip from https://github.com/home-assistant/core/archive/dev.zip
then extracted the contents of the mystrom folder
/homeassistant/components/mystrom
from the zip-file into a folder mystrom2
download or git-clone https://github.com/home-assistant-ecosystem/python-mystrom
i downloaded the zip from https://github.com/home-assistant-ecosystem/python-mystrom/archive/master.zip
then extracted the folder pymystrom folder from the zip-file into the mystrom2 folder
and renamed it to pymystrom2
The mystrom2 folder should look like this now:
mystrom2/
pymystrom2/
__init__.py
bulb.py
cli.py
discovery.py
exceptions.py
pir.py
switch.py
__init__.py
binary_sensor.py
const.py
light.py
manifest.json
switch.py
Now edit const.py:
2: DOMAIN = "mystrom2"
light.py:
4: from .pymystrom2.bulb import MyStromBulb
5: from .pymystrom2.exceptions import MyStromConnectionError
switch.py:
4: from .pymystrom2.exceptions import MyStromConnectionError
5: from .pymystrom2.switch import MyStromSwitch as _MyStromSwitch
change values in manifest.json:
"domain": "mystrom2"
"name": "myStrom2"
"requirements": []
and add:
"version": "2"
in pymystrom2/init.py change:
27:
headers = {
"User-Agent": USER_AGENT,
"Accept": "application/json, text/plain, */*",
"Token": "PUT_TOKEN_HERE"
}
in pymystrom2/cli.py:
8: from .bulb import MyStromBulb
Upload the folder to /config/custom_components/,
I installed “SSH & Web Terminal” and uploaded via SFTP.
Edit configuration.yaml:
switch:
- platform: mystrom2
host: SWITCH_IP
name: "myStrom Switch 1"
- platform: mystrom2
host: SWITCH_IP
name: "myStrom Switch 2"
- platform: mystrom2
host: SWITCH_IP
name: "myStrom Switch 3"
Reboot.
I tried first without token, and after the custom component itself worked, i set up the mystrom tokens. If no Token is set up, Token header is ignored.