Jump to content

SDK for remote and offline HC3 development


Recommended Posts

3 minutes ago, rangee said:

 

Um... I can't remember exactly because I edited this couple of month ago...

If don't do that, it makes problem with slider.

 

And without edit, code results different with original viewLayout...

 

If there are multi element in row,  there's no problem.

it looks like this

{ "components": [ { "components": [ { "name": "button2_1",

 

If there are one element in row,  there are some differces.

it looks like this without change

{ "components": [ { "components": [ { "name": "button1",

it looks like this with change and this is original code when you make ui at fibaro editor.

{ "components": [ { "name": "button1",
 

Ok, I will fix it in next release (any hour now :-) ). I'm also making some more changes to the UI creation code so let me know if you spot some more issues/incompatibilities.

Link to post
Share on other sites
  • Replies 120
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

This is a thread for the fibaroapiHC3.lua sdk that is under development (keeping it separate from the HC3 QuickApps coding - tips and tricks thread) I've started to run and test HC3 QuickApps off

The SDK can be useful for coding and debugging large projects with a lot of moving parts. Zerobrane studio allows for setting conditional breakpoints and live variables watches which is real time save

New version v0.120. Hopefully this version is usable in Visual Studio (Windows) thanks to debugging effort from @10der.    Besides being an emulator for the HC3, fibaroapiHC3.lua is als

Posted Images

Pushed v0.130.

Updated handling of UI elements.Fix from @rangee also.

Now we can declare UIlements in the UI=.. header like in this example.

At least laying out labels and buttons/sliders on the same row is useful.

Note also that slider takes extra arguments

{slider='s1',min=0,max=50,step=5,value=0,onChanged='s1'}

will make the slider return values 0-50 and move the value in steps of 5.

Link to post
Share on other sites
4 minutes ago, jgab said:

Pushed v0.130.

Updated handling of UI elements.Fix from @rangee also.

Now we can declare UIlements in the UI=.. header like in this example.

At least laying out labels and buttons/sliders on the same row is useful.

Note also that slider takes extra arguments

{slider='s1',min=0,max=50,step=5,value=0,onChanged='s1'}

will make the slider return values 0-50 and move the value in steps of 5.

 

Note that.. when we declare slider or button with label on the same row,

eg)  {slider, label}  or {button, label}

When edit script via hc3 editor, UI will broken up.

Link to post
Share on other sites
Just now, rangee said:

 

Note that.. when we declare slider or button with label on the same row,

eg)  {slider, label}  or {button, label}

When edit script via hc3 editor, UI will broken up.

Yes, the alternative layouts is not supported by the UI editor.

Link to post
Share on other sites
  • 3 weeks later...
12 hours ago, ChristianSogaard said:

I'm trying to use the SDK - but the QA is not being generated in HC3 - I'm using MAC - could this be an issue ? 

I'm developing everything on a Macbook Pro so that's not the issue.

It's a nice screen shot but it doesn't show what happens when you run.

 

(ZBS stops at the first line (the little green triangle to the left on line 1) and you need to press > or F5 to start running the code. I hope it's nothing as simple as that :-) )

 

Your settings from the screen shot shows that it's set to create a proxy on the HC3 (proxy=true). It does not happen? You would get a error message at least.

 

Then when you are ready with the QA and want to deploy the real QA on the HC3 you can either set deploy=true and run once, or install the ZBS plugin to get a menu option to deploy the QA (Project -> Deploy QuickApp)

 

 

Link to post
Share on other sites
53 minutes ago, jgab said:

I'm developing everything on a Macbook Pro so that's not the issue.

It's a nice screen shot but it doesn't show what happens when you run.

 

(ZBS stops at the first line (the little green triangle to the left on line 1) and you need to press > or F5 to start running the code. I hope it's nothing as simple as that :-) )

 

Your settings from the screen shot shows that it's set to create a proxy on the HC3 (proxy=true). It does not happen? You would get a error message at least.

 

Then when you are ready with the QA and want to deploy the real QA on the HC3 you can either set deploy=true and run once, or install the ZBS plugin to get a menu option to deploy the QA (Project -> Deploy QuickApp)

 

 

I'm trying to set it up - I followed the Guide and the youtube video :-)

Every second time  run F5 I am getting

Program starting as '"/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/lua.app/Contents/MacOS/lua" -e "io.stdout:setvbuf('no')" "/var/folders/ky/rhpk780x1cn7cpwp9mh59hb4bv22t8/T/.tTnaoj"'.
Program 'lua' started in '/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms' (pid: 46281).
Debugging session started in '/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms/'.
Program completed in 2.08 seconds (pid: 46281).
cannot open fibaro: No such file or directory
stack traceback:
    [C]: in function 'dofile'
    firstTry.lua:24: in main chunk
Debugging session completed (traced 0 instructions).

 

Link to post
Share on other sites

Ah, I saw that you do dofile("fibaro")

That won't work. Put fibaroapiHC3.lua  in your working directory

/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms/

(btw, maybe not optimal to run in the ZBS Contents directory)

Keep the name fibaroapiHC3.lua also and do

dofile("fibaroapiHC3.lua")

 

Install the plugin also - you get tooltips and completions for fibaro commands.

  • Like 1
Link to post
Share on other sites
1 hour ago, ChristianSogaard said:

cannot open fibaro: No such file or directory

your creds you can provide in credentials.lua 

 

return {
    ip = "192.168.1.36",
    user = "admin",
    pwd = "M$-RuLeZZ!"
}

 

Edited by 10der
  • Like 1
Link to post
Share on other sites
2 hours ago, jgab said:

Ah, I saw that you do dofile("fibaro")

That won't work. Put fibaroapiHC3.lua  in your working directory

/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms/

(btw, maybe not optimal to run in the ZBS Contents directory)

Keep the name fibaroapiHC3.lua also and do

dofile("fibaroapiHC3.lua")

 

Install the plugin also - you get tooltips and completions for fibaro commands.

I already put image.thumb.png.2b08a35e5dbc033f90debdc4707400e2.pngAnd the plugin here

 

image.png.52c96e92213b814ad60285462601dffd.png

 

1 hour ago, 10der said:

your creds you can provide in credentials.lua 

 

return {
    ip = "192.168.1.36",
    user = "admin",
    pwd = "M$-RuLeZZ!"
}

 

 

 in my working directory

/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms/

?

Link to post
Share on other sites
52 minutes ago, ChristianSogaard said:

I already put image.thumb.png.2b08a35e5dbc033f90debdc4707400e2.pngAnd the plugin here

 in my working directory

/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms/

?

Yes, 

credentials.lua in same directory as fibaroapiHC3.lua and your working files

 

and in ZBS set working directory to ../myprograms/

 

You still have issues?

Link to post
Share on other sites
3 hours ago, jgab said:

Yes, 

credentials.lua in same directory as fibaroapiHC3.lua and your working files

 

and in ZBS set working directory to ../myprograms/

 

You still have issues?

Yes - i have issues .

In myprograms is have fibaroapiHC3.lua and credentials.lua

and in packages I have fibaroapiHC3plug.lua

 

The QA is not being created when running (F5) - should be 961

 

Same screenshot as before

Program starting as '"/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/lua.app/Contents/MacOS/lua" -e "io.stdout:setvbuf('no')" "/var/folders/ky/rhpk780x1cn7cpwp9mh59hb4bv22t8/T/.ZedPlR"'.
Program 'lua' started in '/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms' (pid: 52385).
Debugging session started in '/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms/'.
Debugging session completed (traced 0 instructions).
Program completed in 5.21 seconds (pid: 52385).

 

image.thumb.png.d1badcaa2e1914a659f726d75154de86.png

Link to post
Share on other sites

Hi

 

On This post there is an example/quick app to send a sms using Nexmo/Vonage API.

Is possible to instead of sent a sms to make a phone call using this service?

 

Thank you

Link to post
Share on other sites

Hi there,

 

any plans to enable the SDK to run over https?

 

If the answer is 'no' I do understand - just asking.

 

Cheers,

jayrock

Link to post
Share on other sites
9 minutes ago, jayrock said:

Hi there,

any plans to enable the SDK to run over https?

If the answer is 'no' I do understand - just asking.

Cheers,

jayrock

If you set hc3_emulator.apiHTTPS=true it will make https calls to the HC3 api

No support for user provided certificates. If someone wants to hack it feel free to do it.

40 minutes ago, joaoartur said:

Hi

On This post there is an example/quick app to send a sms using Nexmo/Vonage API.

Is possible to instead of sent a sms to make a phone call using this service?

Thank you

Probably, but you need to adapt the API calls to do what you want.

I guess it uses the same api_key and secret for calls.

  • Like 1
Link to post
Share on other sites
17 minutes ago, jgab said:

If you set hc3_emulator.apiHTTPS=true it will make https calls to the HC3 api

No support for user provided certificates. If someone wants to hack it feel free to do it.

 

Thanks, got it. Maybe you want to add the property to post #1.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...