So far I use the snapshot version for both, OH 3 and the HTTP Binding.
Things and 4 channels have been created in UI, three of them are working well:
1 x number and 2 x string channel
Each channel has its own JS script attached to it, I am pasring a local ics.file for the upcoming garbage dates.
The datetime channel is making some trouble, the log says:
2020-10-25 17:03:33.632 [WARN ] [iles.JavascriptTransformationProfile] - Could not transform state 'UNDEF' with function 'abfall_naechste_abholung_datum.js' and format '%s'
2020-10-25 17:04:03.802 [WARN ] [iles.JavascriptTransformationProfile] - Could not transform state 'UNDEF' with function 'abfall_naechste_abholung_datum.js' and format '%s'
2020-10-25 17:04:33.880 [WARN ] [iles.JavascriptTransformationProfile] - Could not transform state 'UNDEF' with function 'abfall_naechste_abholung_datum.js' and format '%s'
2020-10-25 17:05:03.448 [WARN ] [iles.JavascriptTransformationProfile] - Could not transform state 'UNDEF' with function 'abfall_naechste_abholung_datum.js' and format '%s'
2020-10-25 17:05:33.732 [WARN ] [iles.JavascriptTransformationProfile] - Could not transform state 'UNDEF' with function 'abfall_naechste_abholung_datum.js' and format '%s'
I understand, that the default setting is %s, so I tried allready some other settings like [%1$td.%1$tm.%1$tY], but the result is still the same.
channel profiles are unrelated to binding transformations.
At OH2, transform profiles were restricted to use with String type Items, I do not think that has been addressed yet.
Thanks for the hint, changed it to string… date is now visible. Since the output ist just being displayed in the sitemap and no further action will be done with it, this is fine for me as well.
That’s good.
I suppose it did not work in this case then, because the user’s transform does not output an ISO date string that can be parsed into a DateTime Item state,
I will probably move to the visual configuration on OH3 sooner or later (I need to move toons of code rows !) but for the time being I have OH2 on stage and OH3 in testing and it is easy to work on textual configuratrion in OH2 and move it on OH3 for testing.
I cant seem to get it done. Logs seem to indicate the command is going but is this is the right way to send a json payload? i suspect its just going as a plain string.
2020-11-14 02:36:28.453 [TRACE] [.HttpDynamicStateDescriptionProvider] - returning new stateDescription for http:url:bf98036307:TV_ON
2020-11-14 02:36:28.453 [TRACE] [nding.http.internal.HttpThingHandler] - Sending to 'http://192.168.1.199:5000/device/0/power': Method = {POST}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.20.v20190813, Content-Type: text/plain}, Content = {"state: "on"}
2020-11-14 02:36:28.460 [TRACE] [p.internal.http.HttpResponseListener] - Received from 'http://192.168.1.199:5000/device/0/power': Code = {500}, Headers = {Date: Fri, 13 Nov 2020 21:06:28 GMT, Content-Length: 89, Content-Type: text/plain; charset=UTF-8}, Content = {{"state":"Error: json: cannot unmarshal string into Go value of type webservice.Request"}}
2020-11-14 02:36:28.461 [WARN ] [p.internal.http.HttpResponseListener] - Requesting 'http://192.168.1.199:5000/device/0/power' (method='POST', content='org.eclipse.jetty.client.util.StringContentProvider@3534c0d2') failed: 500 Internal Server Error
the other side a custom golang microserver expecting a json payload via POST.
any suggestions pls?
It looks like you are missing the curly braces in the on/off value fields, have you tried including them? (try {“state”: “on”} instead of “state”: “on”)
Hi,
I’m currently testing the HTTP binding on OH 3 (Build 2017). But the site i’m running the test against doesn’t seem to be using any authentication except for a “API” Key they call “AppKey”.
Please note that i have changed the AppKey, and address in this post. This is just for showing an example.
I’m getting this current error:
I have setup the thiing with this Header: Kommunenr=0000&RenovasjonAppKey=11-22-33-44&OS=Android&Connection=Keep-Alive&Accept-Encoding=gzip
I can get it to work with a curl like this:
curl -H “Kommunenr: 0000” -H “RenovasjonAppKey: 11-22-33-44” -H “OS: Android” -H “Connection: Keep-Alive” -H “Accept-Encoding: gzip” -X GET “https:/komteksky.norkart.no/komtek.renovasjonwebapi/api/tommekalender/?gatenavn=Address&gatekode=1006&husnr=150”
Does anyone have any suggestion on what could be wrong?
Please enable TRACE or DEBUG logging and show what exactly is sent. Did you configure authentication? Did you really set the headers as above? That’ll probably not work. Add a new entry for each header key-value-pair.