Hello,
this worked for me. It is much easier to setup NodeMCU with HTTP request than with MQTT channels.
Thanks a lot.
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]" }
namraccr
(namraccr)
July 15, 2018, 4:13am
2
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]" }
vzorglub
(Vincent Regaud)
July 15, 2018, 7:36pm
4
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 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
vzorglub
(Vincent Regaud)
July 16, 2018, 8:09am
6
Glad you got it sorted, please mark the thread as solved, thanks