Closed KayGundhardt closed 5 months ago
Hey there @fabaff, mind taking a look at this issue as it has been labeled with an integration (mystrom
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
mystrom documentation mystrom source (message by IssueLinks)
Thank you, @joostlek for your comment: I wasn’t aware that this has been asked already.
Although meanwhile they can connect securely via Token:
… and according to the HomeAssitant API docs connecting via token to REST API should be possible:
curl \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
http://IP_ADDRESS:8123/ENDPOINT
afaik this isn't currently supported by the integration
You are right, but maybe @fabaff would mind to integrate it…
🥳
Although not solved I found a workaround for those of you that stumble across this post and try to integrate these buttons.
You can find additional information about:
The Following describes changing an API-POST-Command for Button 1 being pushed once (1x) resulting in turning a HA-entity on. You have of course to repeat the below step 6 for each other command.
curl -s -o configfile.json http://<BUTTON-IP-ADDRESS>/api/v1/config
{
"http": {
"method": "POST",
"payload": " {\"state\": \"on\"}",
"url": "http://<HA-IP-ADDRESS>/api/states/<HA-ENTITY_ID>"
},
"scheme": "1x",
"trigger": "btn1"
},
To:
{
"http": {
"headers":[
"Authorization: Bearer <LOOOOOONGAPITOKEN>"
],
"method": "POST",
"payload": " {\"state\": \"on\"}",
"url": "http://<HA-IP-ADDRESS>/api/states/<HA-ENTITY_ID>"
},
"scheme": "1x",
"trigger": "btn1"
},
curl -i -d @configfile.json http://<BUTTON-IP-ADDRESS>/api/v1/config
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 0
Connection: close
Pragma: no-cache
Cache-Control: no-store, no-cache
I don't have access to a WiFi Button Max. To be honest I haven't used my WiFi Buttons for while with Home Assistant and I don't know if there were changes in later firmware releases present which would make the integration easier.
The work-around in the past as to use myStrom2MQTT
to avoid dealing with tokens.
Hey @fabaff ! Cool idea: did not finde the MQTT-Capability in myStroms API-Docs: obviously i was completely taken in by the token method ;) How do you manage the API-Command to send the MQTT-Brokers credentials?
I think it's also interesting to mention that the rest API is unofficially deprecated (afaik). I'd rather use a webhook approach.
isn't changing the HTTP method from GET to POST and providing the webhook path in the URL enough? You can also define the request body (payload) for a POST/PUT method.
I'm just giving some hints on how you can improve your setup.
I think we could support setting up webhooks for these buttons as well in the config flow. Except I don't have one of these so I can't really test this or create this.
Okay, now I understand. Really funny, that you think I could do that! :)) Don’t get me wrong, I am very enthusiastic and really persistent, but I don't have any programming skills: I’m a noob ;)
But if you are willing to write the code, I would be happy to help with the testing and this way give the community something back for all the help. I got myself!
:)
Not necessarily, you can create a webhook trigger yourself:
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
Homassistants myStrom-Integration is not able to connect to a myStrom WiFi Button Max although REST API is integrated in FW Version 1.1.10.
What version of Home Assistant Core has the issue?
core-2023.12.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
myStrom
Link to integration documentation on our website
https://www.home-assistant.io/integrations/mystrom
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response