Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
damo78 0
I am trying to call Fibaro REST APIs from either Lua script within a scene, or from a VD and I have struggled for hours without success. I think I've read nearly every post here and still no joy.
I have been able to run node.js calls to my HC2 so I know it is just my Lua code. This is my latest attempt from a scene, which has been as much progress as I've made in 4 hours.
Please login or register to see this code.
This gets me the furthest (Note: I've changed the method and url combinations for these sets of tests also):
[DEBUG] Success: 401
[DEBUG] Failed: 401
I know this is an authorisation failure but i cannot find any documentation for how to include it. I've tried the
Please login or register to see this link.
and various others.I think I've tried every combination of everybody's code snippets in one way or another. The documentation for this is a little lacking....
Please login or register to see this image.
/emoticons/default_icon_confused.gif" alt=":-?" />My basic requirement:
To use the REST APIs because there seems to be much more [json] data available than using the Lua code alone (unless someone can suggest otherwise). Before I can get to using this data, I need to know some first principles on how to GET it (think I should be okay to json.decode and use after that), and POST/PUT it, primarily from a scene, but possibly using a VD too which I believe maybe different.
Your help, documents, post-pointers etc. would be sooooooo much appreciated. Thanks.
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.