SmurfnSurf Posted October 3 Share Posted October 3 (edited) Hi, Quick background, I have a Shelly Button 1 (for simplicity) activating a Central Heating Relay (mini Gen3), switching it on or off. The relay is ALSO on a schedule, so I wanted to write a simple URL sent from the Shelly Button that if I select OFF, it disables the Input, which I understand essentially "deactivates" the Switch and thus any scheduled "On" calls. Switching the Shelly Button 1 back "On" should reactivate the Relay, setting it to "On" by setting the Toggle (in_mode: follow) and "initial_state":"match_input"}. I assume the schedule just continues from there. Small disclaimer, I am also investigating just disabling the schedules, but it's coming along as a lot more complicated, with scripts. The OFF URL called from Shelly Button 1 to the CH Relay: http://admin:password@192.168.47.127/rpc/Switch.SetConfig?id=0&config={"in_mode":"detached","initial_state":"off"} The ON URL called from Shelly Button 1 to the CH Relay: http://admin:password@192.168.47.127/rpc/Switch.SetConfig?id=0&config={"in_mode":"follow","initial_state":"match_input"} If I leave OUT the Authentication, it works fine, testing OFF and ON as follows: http://192.168.47.127/rpc/Switch.SetConfig?id=0&config={"in_mode":"detached","initial_state":"off"} http://192.168.47.127/rpc/Switch.SetConfig?id=0&config={"in_mode":"follow","initial_state":"match_input"} But when Authentication is added back in, (also using a Chrome Browser), the "sign in" text box in Chrome keeps prompting for the username and password. It doesn't take the password. If I click cancel (the Chrome auth dialogue), I see: { "restart_required": false } The odd thing is if I just issue a simple GetConfig (as below, I can type in the admin:password in the dialogue box and it gets the result of GetConfig just fine. http://192.168.47.127/rpc/Switch.GetConfig?id=0 Does anyone know why does it not "take" the password when I test using the in_mode command and how to get around this please? Thx! EDIT: The Chrome Browser console responds with Failed to load resource: the server responded with a status of 401 () EDIT2: I used HttpToolkit and got this output, if it helps? See METHOD GET.txt file attached. METHOD GET.txt Edited October 3 by SmurfnSurf Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.