openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.71k forks source link

[HTTP binding] Dynamic URL is not working with cacheurl #5929

Closed JanVerstuyft closed 4 years ago

JanVerstuyft commented 4 years ago

I want to configure a HTTP binding with a cache url and the current date as param. my http.cfg has the following content: test.url=http://webhook.site/d0f39a16-a52d-4ef9-9dd2-096ad11403b4?param=%1$tY-%1$tm-%1$td test.updateInterval=10000

my http.items has the following content: Number temperature { http="<[test:3000:JSONPATH($.id)]"}

Expected Behavior

The expected call that happens would be http://webhook.site/d0f39a16-a52d-4ef9-9dd2-096ad11403b4?param=2020-01-06

Current Behavior

The actual call that happen is http://webhook.site/d0f39a16-a52d-4ef9-9dd2-096ad11403b4?param=%251%24tY-%251%24tm-%251%24td

Steps to Reproduce (for bugs)

the easiest way to test this call is using http://webhook.site. This allows you to see which calls are done.

  1. go to http://webhook.site
  2. copy the url (see green button right up)
  3. configure http.cfg with content from above (and use the url that you copied)
  4. configure the items as mentioned (don't bother the jsonpath errors, not needed for this test)

Context

I have a solar system with an HTTP rest interface that I want to use. This systems needs the current date as an argument. Since I want to have 4 metrics from this call, it would be handy to have it cached.

Your Environment

9037568 commented 4 years ago

See also discussion in #5928 and its accompanying community thread.