pluemmi
(Wolfgang)
January 26, 2023, 7:43am
1
Hi all,
I am invoking the REST API on my old Openhab 2 server from Tasker like this:
Works like a charm
Doing the same on my new Openhab 3 server gives me error code “404” and:
However the following works from the Linux console both on the Openhab 3 server itself as well as from my Laptop:
curl -v -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "ON" "http://{192.168.0.11}:8080/rest/items/RadiatorTimerSwitch"
Something is blocking the Tasker access…
Any idea?
I have added
org.eclipse.smarthome.cors:enable=true
into runtime.cfg as suggested in the documentation.
Cheers
Wolfgang
rlkoshak
(Rich Koshak)
January 26, 2023, 2:47pm
2
Since OH 3 doesn’t have any references to eclipse smarthome any more, I’m sure if that property still exists at all, it would be org.openhab.cors
.
Do you have the implicit guest user enabled in the API security settings?
pluemmi
(Wolfgang)
January 27, 2023, 9:14am
3
I have tried that, but no change.
I have in the meantime got access to the item via myopenhab.org .
Posting an ON or OFF to the item returns success code 200, but the item state does not change.
Did you get it working through tasker. Care to share how you did it?
Thanks
pluemmi
(Wolfgang)
January 27, 2023, 2:31pm
6
Yes via Tasker.
On your Openhab server expose the item(s) in the UI->Settings->Openhab Cloud
Create HTTP auth in Tasker:
Create Task with HTTP Auth as 1st action:
Create HTTP request as 2nd action:
1 Like
rlkoshak
(Rich Koshak)
January 27, 2023, 2:47pm
7
No, do not do that. The only reason to ever have done that is for IFTTT integration which has been turned off for years. Nothing else uses “exposed Items” at this time. Exposing the Items does not make them available to Tasker and on the flip side not exposing an Item does not hide that Item from Tasker.
Once authenticated, Tasker has access to everything.
rpwong
(Russ)
January 27, 2023, 5:04pm
8
Out of curiousity, are you aware that the openHAB Android app can serve as a Tasker plugin? You can’t monitor openHAB, but you can send commands from Tasker.
pluemmi
(Wolfgang)
January 27, 2023, 6:12pm
9
Yes I am aware of that, thanks.
But I wanted to test the REST API.
rpwong
(Russ)
January 27, 2023, 6:37pm
10
Cool. I just wanted to make sure. It’s easy to miss when features like this are added.
I opened an issue last year to update the “Items to expose” setting, but I’m not sure if it made it into 3.4 (I’m still on 3.3).
opened 08:20PM - 05 Apr 22 UTC
closed 09:09PM - 04 Jul 22 UTC
Although support for IFTTT was removed from myopenHAB.org long ago, there's stil… l an option to expose items in MainUI under the openHab Cloud settings:

I assume this is to allow people running their own cloud servers to use IFTTT. Unfortunately, it causes confusion for many users who assume it's required for Alexa and Google Assistant integration (which is quite reasonable).
I suggest:
1. Having "Items to expose" only appear when you click "Show advanced".
2. Renaming it "Items to expose to IFTTT"
3. Updating the caption: "If you've set up a private cloud server with IFTTT integration, use this option to indicate which items can be controlled with IFTTT. This setting does not work with myopenHAB.org and is not required for integration with Amazon Alexa or Google Assistant."
Alternatively, we could just remove IFTTT support. However, that would be detrimental to anyone who has set up a cloud server specifically to keep IFTTT working with openHAB.
Thanks for you work!
rlkoshak
(Rich Koshak)
January 27, 2023, 6:46pm
11
The PR was merged in July so it should be in 3.4.0+ but not in 3.3 and before.
I’m on 4.0 snapshot though and the option is still there in the UI. I wonder if that issue was erroneously closed?
rpwong
(Russ)
January 27, 2023, 7:02pm
12
I’m not very familiar with Github. It looks to me like it still needs Kai’s review? Might have gotten lost in the shuffle.
What’s the best way to draw attention to it politely? I don’t know what the etiquette is in Github.
rlkoshak
(Rich Koshak)
January 27, 2023, 7:46pm
13
No, purple means merged and closed but the PR that it’s claiming closed the issue doesn’t seem to be relevant.
I’d add a comment to the issue and ask if it was really meant to be closed because even as late as OH 4 it’s still showing the option in MainUI to select Items to expose.
JustinG
(JustinG)
January 27, 2023, 8:31pm
14
Isn’t IFTTT still an option for users that spin up their own cloud servers? I assume the setting needs to remain available for those users.
Thank you for the update. Will have to combine this with Auto Notification.
rpwong
(Russ)
January 27, 2023, 9:33pm
16
Yep. I suggested hiding it in Advanced Settings and editing the description to say pretty much this.
JustinG
(JustinG)
January 27, 2023, 9:35pm
17
Well, that’s true in the 3.4 release, so it looks like the PR did get correctly merged.
rpwong
(Russ)
January 27, 2023, 9:35pm
18
Oh, okay. So just not in 4.0. Weird.
rlkoshak
(Rich Koshak)
January 27, 2023, 11:44pm
19
I mistakenly had the show advanced checked. It’s indeed hidden.
1 Like
rpwong
(Russ)
January 28, 2023, 1:01am
20
Well then, mystery solved. I look forward to seeing my meagre contribution to MainUI when I get around installing 3.4.