rest API?

280 views
Skip to first unread message

Moritz Rogalli

unread,
Jun 30, 2014, 6:05:32 PM6/30/14
to myop...@googlegroups.com
Hi!

I was wondering if it is possible to write to the rest API? I can see my items in the API but i get unauthorized when i try to change states.

Justin Aiken

unread,
May 5, 2015, 7:45:49 PM5/5/15
to myop...@googlegroups.com
Bump! Same question... I'm getting timeouts instead of unauthorized, but I can't get a Contact item to change.

- PUT'ing the state (via text/plain) to 'https://my.openhab.org/rest/items/$MY_ITEM/state"
- POST'ing a command (via text/plain) to "https://my.openhab.org/rest/items/$MY_ITEM"
Getting the state works fine... are there any additional security settings that need tweaking for this to work?

Victor Belov

unread,
May 6, 2015, 2:01:06 AM5/6/15
to Justin Aiken, myop...@googlegroups.com
Hi,

Justin, does it work when you post to your openHAB directly?

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "my.openHAB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to myopenhab+...@googlegroups.com.
To post to this group, send email to myop...@googlegroups.com.
Visit this group at http://groups.google.com/group/myopenhab.
To view this discussion on the web visit https://groups.google.com/d/msgid/myopenhab/db937643-6704-4412-9a99-533fa27f12bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin Aiken

unread,
May 6, 2015, 4:36:21 PM5/6/15
to myop...@googlegroups.com, 60ton...@gmail.com
Yes, here's a gist showing what happens locally/remote: 
https://gist.github.com/JustinAiken/b1ceee399386cbf0bdfc

POST commands seem to work, but Contact items don't respond to them.

I ended up creating a virtual switch that does nothing but trigger my Contact item, then I can send a ?CMD request to the virtual switch remotely... klunkly workaround, but it works :)

- Justin

Victor Belov

unread,
May 14, 2015, 7:02:33 PM5/14/15
to Justin Aiken, myop...@googlegroups.com
Hi,

It's not a problem in the my.openHAB cloud, but seems a problem with the bundle. Still working on it.

Best regards,
Victor Belov

On Wed, May 6, 2015 at 10:37 PM, Victor Belov <belov...@gmail.com> wrote:
Ok, I think it is a problem with PUT, not with contact. I will check this out!

Mark Czelnik

unread,
Aug 4, 2015, 4:19:18 PM8/4/15
to my.openHAB, 60ton...@gmail.com
Hi Victor,

any news on this?
Experiencing the same issue with POST commands.

Cheers

Mark Czelnik

unread,
Aug 4, 2015, 4:57:41 PM8/4/15
to my.openHAB, 60ton...@gmail.com
Seems that after upgrading to the latest release everything runs now fine! :)
Reply all
Reply to author
Forward
0 new messages