[SOLVED] Switch command using http binding not working

Hi I am using below syntax, but it is not working, normal url through browser or curl is working and I am able to change the state of ESP01 relay state.

Switch nexa "esp01" { http=">[RELAYON:POST:http://192.168.1.200] >[RELAYOFF:POST:http://192.168.1.200]" }

I don’t believe “RELAYON” and “RELAYOFF” are valid values for the command portion.

my URLs for switch off and on are below, which is to be integrated with openhab2.

http://192.168.1.200/RELAYOFF & http://192.168.1.200/RELAYON

item file:
Switch nexa "nexa" { http=">[RELAYON:http://192.168.1.200]>[RELAYOFF:http://192.168.1.200]" }
Switch nexa "nexa" { http=">[ON:http://192.168.1.200/RELAYON],>[OFF:http://192.168.1.200/RELAYOFF]" }

Thanks Vincent, I had modified the code to look for /ON & /OFF in URL :slight_smile :slight_smile: and it is working now, but i will check this to clear my doubt.

http://192.168.1.200/OFF & http://192.168.1.200/ON

Switch nexa "nexa" { http=">[ON:http://192.168.1.200/ON],>[OFF:http://192.168.1.200/OFF]" }
1 Like

Glad you got it sorted, please mark the thread as solved, thanks