Closed Tikilou closed 3 months ago
The issue is that %20 is being URI decoded to a space character. I think you can solve this problem by URI encoding %, which is %25. So try: cm?cmnd=Power%2520On and see if it works. The only problem is that you have to do this encoding every time you save the HTTP zone settings, otherwise it gets translated to space again.
The issue is that %20 is being URI decoded to a space character. I think you can solve this problem by URI encoding %, which is %25. So try: cm?cmnd=Power%2520On and see if it works. The only problem is that you have to do this encoding every time you save the HTTP zone settings, otherwise it gets translated to space again.
Thanks ! Unfortunatly it didn't works, electrical outlets with tasmota don't turn on or off with your trick.
I've compiled the fork by opensprinklershop(.de) v2.3.1 and this bug is not in this release, it's works fine now, %20 is saved. :-)
It looks like the main difference is Stefan's firmware doesn't do urlDecode: https://github.com/opensprinklershop/OpenSprinkler-Firmware/blob/master/opensprinkler_server.cpp#L679 whereas our firmware does: https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/opensprinkler_server.cpp#L611
It's pretty easy to change it, but I want to be careful with other implications of this change, i.e. it may work for you but not work for other users due to their commands having encoded characters. Honestly I don't know how the command parameter itself has a space character in it, this is quite unusual I feel. Why not use an underscore like Power_On instead of Power%20On.
Just to confirm, if you go to our firmware, opensprinkler_server.cpp, around here: https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/opensprinkler_server.cpp#L611 comment out that urlDecode, that should work for your case. Again, I am not entirely sure about the implications to other users, but this should solve the problem for you at least.
Just to confirm, if you go to our firmware, opensprinkler_server.cpp, around here: https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/opensprinkler_server.cpp#L611 comment out that urlDecode, that should work for your case. Again, I am not entirely sure about the implications to other users, but this should solve the problem for you at least.
Thanks, it's working, i can now enable/disable tasmota outlets with officiel OpenSprinkler again like on V 2.2.0 ! I don't know/understand too, why tasmota choose to use a space character ? - or _ would be a better choice... Could you add a setting about enabling or not urlDecode, maybe, for keeping compatibility for everyone, in http stations settings ? :-)
Stefan's firmware OpenSprinkler is interesting too, but i always prefer to use official flavor... There is somes bugs (ex : Stefan's firmware always send "off" command to my tasmota outlets, when i manually enable it with anything else than his firmware, and there is not setting to disable that "security"...)
Edit : my mistake, it seems i have this problem of auto off tasmota outlet with this official open-sprinkler-firmware too. After ~ one minute of manual enabling, OpenSprinkler send off command... I will open a new Issue !
OK, I am closing this issue for now and will respond in the new issue.
Hi! First of all, many thanks for all the work you've done on the opensprinkler.
With my previous opensprinkler setup under OsPI with electrical outlets connected under tasmota firmware, I was using http commands to turn them on and off. (To pump water from the well) This release concerned firmware 2.2.0, running on Raspberry pi 4 and RaspiOS Bullseye. Following an update to the OpenSprinkler firmware, I can no longer switch my connected sockets on and off. The reason seems quite simple, visually at least I've noticed that when I indicate an http station type and register the start (cm?cmnd=Power%20On) or stop (cm?cmnd=Power%20Off of the socket) command, on last year's version 2.2.0, the command was registered as is. Following the update, commands are now recorded as follows:
cm?cmnd=Power On cm?cmnd=Power Off
As you can see, OpenSprinkler registers the command with a space without "%20", making it impossible to activate/stop the pump outlets.
To put this in context, I'm using OpenSprinkler (OsPI with Raspberry PI 4) with Home Assistant, Tasmota, Ecowitt, humidity and rain sensors, OpenWRT routers and Proxmox servers in a nursery I'm setting up. I've written a big tutorial of my setup to popularize the use of OpenSprinkler and Open Source bricks in France for private and professional irrigation and water saving. :-) https://pepinature.org/fr/gestion_de_l_eau/programmation_avancee_et_automatisation_de_l_irrigation