Command line with password failing but succeeds without

I have a working sonoff basic, I use commandline on homeassistant to operate the sonoff using : command_on: "/usr/bin/curl -X POST"

The above doesn’t work on home assistant when password is activate but works when there is no password as follows:

command_on: "/usr/bin/curl -X POST"

The url with the password works when I implement it on a normal browser, but fails to operate on home assistant. the one without the password works in both normal browser and on Homeassistant. There is no error message directly related to this, it just does not switch on, the light switch returns to off position immediately with no action. I tried searching in vain for a solution.

Please assist, why is the one with a password failing in HA while it succeeds in normal url and why does the one without password work in HA and normal browser.

Not sure about your actual issue, but if it’s a sonoff why don’t you use MQTT with a firmware like Tasmota?

I had so many intermittent issues on mqtt, I think I have a solution, will try and revert

It is sorted, all that was needed is a second set on inverted commas around only the url portion like so:

command_on: "/usr/bin/curl -X POST '' "