Closed kaikreuzer closed 4 years ago
Clicking widgets as in 'sitemap widgets inside the app' or 'app widgets in the launcher'?
"sitemap widgets inside the app", i.e. standard usage.
Did you check whether the rest API response is correct? The URL used for sending commands is the link
property in the item's JSON response (see here).
Yes, I had checked it, here's the response of the REST root resource:
{"version":"4","runtimeInfo":{"version":"3.0.0","buildString":"- local build -","configFolder":"/Applications/openhab3/conf","userdataFolder":"/Applications/openhab3/userdata"},"links":[{"type":"bindings","url":"https://192.168.0.4:8443/rest/bindings"},{"type":"voice","url":"https://192.168.0.4:8443/rest/voice"},{"type":"addons","url":"https://192.168.0.4:8443/rest/addons"},{"type":"audio","url":"https://192.168.0.4:8443/rest/audio"},{"type":"module-types","url":"https://192.168.0.4:8443/rest/module-types"},{"type":"inbox","url":"https://192.168.0.4:8443/rest/inbox"},{"type":"items","url":"https://192.168.0.4:8443/rest/items"},{"type":"sitemaps","url":"https://192.168.0.4:8443/rest/sitemaps"},{"type":"ui","url":"https://192.168.0.4:8443/rest/ui"},{"type":"discovery","url":"https://192.168.0.4:8443/rest/discovery"},{"type":"habpanel","url":"https://192.168.0.4:8443/rest/habpanel"},{"type":"iconsets","url":"https://192.168.0.4:8443/rest/iconsets"},{"type":"persistence","url":"https://192.168.0.4:8443/rest/persistence"},{"type":"services","url":"https://192.168.0.4:8443/rest/services"},{"type":"spec","url":"https://192.168.0.4:8443/rest/spec"},{"type":"uuid","url":"https://192.168.0.4:8443/rest/uuid"},{"type":"events","url":"https://192.168.0.4:8443/rest/events"},{"type":"auth","url":"https://192.168.0.4:8443/rest/auth"},{"type":"things","url":"https://192.168.0.4:8443/rest/things"},{"type":"links","url":"https://192.168.0.4:8443/rest/links"},{"type":"config-descriptions","url":"https://192.168.0.4:8443/rest/config-descriptions"},{"type":"rules","url":"https://192.168.0.4:8443/rest/rules"},{"type":"channel-types","url":"https://192.168.0.4:8443/rest/channel-types"},{"type":"thing-types","url":"https://192.168.0.4:8443/rest/thing-types"},{"type":"templates","url":"https://192.168.0.4:8443/rest/templates"},{"type":"profile-types","url":"https://192.168.0.4:8443/rest/profile-types"}]}
Sorry, and here's the item's JSON response:
https://192.168.0.4:8443/rest/items/Shutter_ELW_East
{"link":"https://192.168.0.4:8443/rest/items/Shutter_ELW_East/Shutter_ELW_East","state":"0","editable":false,"type":"Rollershutter","name":"Shutter_ELW_East","label":"Fenster Ost","tags":[],"groupNames":["ELW","Shutters"]}
Which looks a bit weird as the Item name is doubled in there...
I'll investigate why this is the case, maybe there's indeed a bug in the REST API response.
I take you also double checked the response for the selected sitemap (rest/sitemaps/<sitemap>/<sitemap>
)? That's what we use to build the data structures.
I'll double check whether we do any URL mangling at parse time, but OTOH I don't think we do.
Edit: we don't: https://github.com/openhab/openhab-android/blob/master/mobile/src/main/java/org/openhab/habdroid/model/Item.kt#L146
I take you also double checked the response for the selected sitemap
I didn't, thanks for reminding me of that - and that's indeed the culprit as it holds the items links without the items
segment in the path.
Thanks for your help, I'll hence close this issue and create a bug fix for openhab-core!
Using openHAB 3, the app fails to send commands when clicking widgets.
Checking the device logs with adb logcat, I can see the reason:
The url is missing the
item
segment for some reason... It is the same behavior using a local connection and through myopenhab.org.@mueller-ma I hope you can help me finding a quick solution as I have upgraded my production system to openHAB 3 this week and cannot use the app anymore now... Thanks!
Environment data
Client
Server