I’m having an issue that I suspect is within Hubitat, but am not 100% sure.
BLUF: Does Hubitat properly encode URLs entered in “send HTTP request” actions in RM that include an encoded semicolon (%3B) ?
I am using Tasmota running on a Wemos D1 mini to control relays for my pool pump, pool jets, and pool lights. For simple on/off it works wonderfully and integration in Hubitat is great. I love it!
The pool lights are capable of 14 different functions which is accomplished by cycling power off/on the number of times that matches the function. For example, if you want the "Caribbean" colors, you cycle the power to the light off/on 6 times.
Cycling the power from Hubitat kind-of works, but is not a great solution and what I would really like to do is be able to instruct Tasmota to cycle an output pin a prescribed number of times. This places the cycling routine on the D1 Mini and Tasmota rather than back at Hubitat.
To do that, Tasmota offers a blink feature where you can set both the blinktime (speed) and blinkcount (how many blinks). These commands combined with a Power command accomplish the goal of cycling the pool lights the correct number of times. Tasmota even offers a way to neatly package up all the needed commands by using the “backlog” command which executes them in sequence. Consequently, the following command issued from the Tasmota console will blink the relay#3 6 times
backlog blinktime 20 ; blinkcount 6 ; power3 3
This can also be done from a web browser as such… assuming our Tasmota device is accessible on an example IP address of 192.168.1.102
http://192.168.1.102/cm?cmnd={our backlog command here}
But you have to properly encode the spaces with %20 and the semicolons with %3B. The resulting URL then looks something like this:
http://192.168.1.102/cm?cmnd=backlog%20blinktime%2020%20%3B%20blinkcount%206%20%3B%20power3%203
This URL works perfectly from Firefox and Edge Chromium. The tasmota device logs that the backlog command was executed.
17:55:10 RSL: stat/tasmota_E9F888/RESULT = {"BlinkTime":20}
17:55:10 RSL: stat/tasmota_E9F888/RESULT = {"BlinkCount":6}
17:55:10 RSL: stat/tasmota_E9F888/RESULT = {"POWER3":"Blink ON"}
17:55:34 RSL: stat/tasmota_E9F888/RESULT = {"POWER3":"Blink OFF"}
17:55:34 RSL: stat/tasmota_E9F888/RESULT = {"POWER3":"ON"}
17:55:34 RSL: stat/tasmota_E9F888/POWER3 = ON
However, when I move that URL into a Hubitat RuleMachine rule as a “send HTTP request” action, the tasmota device logs a command unknown even though it is the EXACT same URL that was sent from the browser.
17:56:36 RSL: stat/tasmota_E9F888/RESULT = {"Command":"Unknown"}
After some playing around, I have determined that the part of the URL that is breaking in Hubitat is the semicolon (%3B). URLs with spaces (%20) seem to work fine, but as soon as you add the %3B the URL it no longer works when sent from Hubitat.
So, to investigate further, I sent the request to a lighttpd web server to see what Hubitat is sending and it looks nothing like what is sent from a browser.
Hubitat:
1598393894|192.168.1.99|GET /cm?cmnd=backlognull2020null3Bnull206null3Bnull203 HTTP/1.1|200|725
Browser:
1598393999|192.168.1.99|GET /cm?cmnd=backlog%20blinktime%2020%20%3B%20blinkcount%206%20%3B%20power3%203 HTTP/1.1|200|725
So… loooong story short, is this a broken feature in Hubitat or have I missed the boat altogether?