How to setup mystrom switch?

Hi,
I try to setup my HA system. I’m a beginner and i can’t set up my MyStrom switch. I follow the instructions but nothing works.

I added this to my config file:

switch:
  - platform: mystrom
    host: myip

Now i don’t know where i write this in:

$ curl -X GET -H "Content-Type: application/json" http://myip/report
{
 "power": 0,
 "relay": false
}

or

curl -G -X GET http://myip/relay -d 'state=1'

(myip is the IP from my Switch)

I already try it in states, in the config file or in the services but nothing work. I enabled REST API too.

I hope someone can help me.

Thanks

(sorry for my English i come from Switzerland)

Open a linux terminal, paste in this command:

$ curl -X GET -H "Content-Type: application/json" http://myip/report

And see if you get this response:

{
 "power": 0,
 "relay": false
}
1 Like

Yes that works. Thanks! But can I add a button or something to the Home-Site in HA to Controll it?

By including this configuration

switch:
  - platform: mystrom
    host: myip

you already have.

Check the developer tools states menu. Your switch entity id will be listed there.

Add it to a Lovelace entities card.

1 Like

Oh I see there is the Problem. I only see my hue devices or the weather but no switch. I have already tried to create one there but that didn’t work too.

You can’t create one there. That is just a menu for looking at the entity ids, states and attributes of your devices.

You’ve added the configuration.
You’ve enabled the rest api.
You’ve tested the that the switch can be reached.

I’m not sure why you are not seeing the switch. Did you restart home assistant after adding the configuration?

1 Like

Yes I have restarted several times.
I have installed the HA on a Raspberry PI 3 B+
I tried the HA software in 32 or 64 bit. Both did not work.

Now I try to restart my Router

Oh, I restarted the Router and reconnect the Switch in the App and on the Website from myStrom. Now it shows it in the Home-Site.

Unbenannt

Many thanks for your help! :smile:

Was very helpful and worked for me as well!

Any hint how I can setup two myStrom Switches in Home Assistant (Current Version). It did not work with this

switch:

  • platform: mystrom
    host: myip-Switch1
    host: myip-Switch2

thanks for any help

Hi,

I got the same Problem. If i add one myStrom Switch its all ok but with the second line the code will not validated.
Think there ist an Issue with the correct yaml structure and we have to learn it;)
(found nothing in Www so it could took longer)

Hi,
the code is:

switch:

  • platform: mystrom
    host: IP1
  • platform: mystrom
    host: IP2
1 Like