Joe-houghton/IFTTTtoDomoticzUsingPushover

Bad Send Request

Closed this issue · 3 comments

Hi Joe,

First of all, thanks for developing this beautiful script which enables me to securely switch devices from outside my network without opening up ports.

I've installed everything and it seems to be running just fine, but when receiving a command, I see the following error:

python3 UsingPushover.py

"Address: http://hestia.sndltn3:8080
Username:
Password:

Request for Messages sent
Websocket connection opened.

Received: #command Off 118
Processing Domoticz Command
RequestUrl: http://hestia.sndltn3:8080/json.htm?type=command&param=getlightswitches
Bad Request
RequestUrl: http://hestia.sndltn3:8080/json.htm?type=scenes
Bad Request
http://hestia.sndltn3:8080/json.htm?type=command&param=switchlight&idx=118&switchcmd=Off
Bad Send Request"

However, when I open the above link in my browser, it works fine and gives me the following request:
{ "status" : "OK", "title" : "SwitchLight" }

So, it seems that the internal request done by the Requests plugin is somehow corrupt or not correct.
If needed I can do additional test, as I'd love to help with solving this.

Cheers,
Sander

Hi Sander,

Can you check the following please
The url in device.cfg looks similar to the following (quote marks, correct url, plus all the other data fields are filled out):

"domoticzAddress": "http://hestia.sndltn3:8080",

Including the quotation marks.

Are you running this on a raspberry pi, i.e. a different device to your browser? if so
Can you try a
wget http://hestia.sndltn3:8080/json.htm?type=command&param=switchlight&idx=118&switchcmd=Off
And see what that returns.

Hi Joe,

Thanks for your swift reply. I checked the device.cfg and it's exactly as you stated.
The wget command tells me that Username/Password Authentication Failed. Strange, because I didn't configure this, but I'll take a look into it right away. Thanks for pointing this out.

Edit:
I didn't added 127.0.0.1 to my local networks in the settings of Domoticz, so that gave issues with running the script from the same environment. Sorry for bothering you with this! Issue can be closed.

Sander

Not a problem, glad it is working for you.