Jump to content

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


  • 0

LUA or QA to run HTTP url (powerview/luxaflex/HunterDouglas)


ppeterr
 Share

Question

[edit] i think i should have placed it in the "Scenes and Interface" section, sorry for that.

 

 

So, i'm new, newbe, so...dont shoot me :)

 

I've been reading a lot, on this forum and elsewhere trying to get my Powerview shades connected to a zwave switch.

It seems to be much harder to manage then i was hoping for. My head spins around with all the information, code lines and such,

Also, none of the info i found seems to be complete. It is all like "do it in LUA", make a QA or a a bunch of code lines.

I hope to find some hints, or answers - help with that.

 

So, what i worked out:

 

- The 8 button fysical wall switch works.

- The powerview plugin works, and the scene's controlled from the hub work

 

The imported scene's dont work, and need i to make a QA or a LUA scene for that.

 

What i tried:

 

I made a block scene with the switch, and  a HUE lamp, converted this to LUA

this is the "what if button is pressed" and it works.

 

Please login or register to see this code.

 

The action part, i made this - but its wrong.

 

Please login or register to see this code.

 

It gives this error:

10.07.2021] [07:00:40] [ERROR] [SCENE4]: (load):1: attempt to index a nil value (global 'Net')

 

I know there is a lost of writing about this on the forum but, I am totally lost in what to do, is this sort of the right way to do it ?

Should i do it with a QA ? 

 

Edited by ppeterr
tags
Link to comment
Share on other sites

Recommended Posts

  • 0

Also new here but Net.FHttp is from hc2, in hc3 use

local connection = net.HTTPClient()

Link to comment
Share on other sites

  • 0
  • Inquirer
  • 3 minutes ago, mike79 said:

    Also new here but Net.FHttp is from hc2, in hc3 use

    local connection = net.HTTPClient()

     

    Thanks i changed it. And now that error is goed. There is a new error in line 3. Maybe also is "get" for the HC2.

    Well, i actually copied the code from the HC2 Virtual Device :)

     

    [10.07.2021] [17:26:35] [ERROR] [SCENE12]: (load):3: attempt to call a nil value (field 'GET')

    Link to comment
    Share on other sites

    • 0

    what about trying this

     

    Please login or register to see this code.

     

     

     

    Link to comment
    Share on other sites

    • 0
    2 minutes ago, mike79 said:

    what about trying this

     

    Please login or register to see this code.

     
        error = function(message)
                print("error:", message)
        end
    })

     

     

     

    Link to comment
    Share on other sites

    • 0

    Please login or register to see this code.

    maybe simplyfying it without headers 

    also i forgot to put error code in first example

    Edited by mike79
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Posted (edited)

    Hey @mike79 and @tinman 

     

    Mike, i get a error in the last line 

    [10.07.2021] [17:52:35] [ERROR] [SCENE12]: (load):14: unexpected symbol near

     

    tinman,not sure what you mean. Some missing lines ? - [edit] its clear now

     

    [edit] Got the code from the latest edit mike, let me try

     

    @mike79

     I start the scene, and keeps running - no error msg

    Also no response or action from the shades ;/

    Tested the link "http://192.168.1.35/api/scenes?sceneId=25173" in a browser and it works.

     

     

     

     

    Edited by ppeterr
    Link to comment
    Share on other sites

    • 0

     

    like @tinman mentioned before put also error code in buttom

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0

    Please login or register to see this code.

    @

    Please login or register to see this link.

     

    Edited by mike79
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Posted (edited)
    12 minutes ago, mike79 said:

    Please login or register to see this code.

    @

    Please login or register to see this link.

     

     

    I pasted this code in the action field, run it - it keeps running.

    No error. But also no respond.

     

    edit, it took some time came up with

    [10.07.2021] [18:21:39] [ERROR] [SCENE14]:

    Edited by ppeterr
    Link to comment
    Share on other sites

    • 0

    @ppeterr - are you using the plugin from Fibaro?

    I tried it.. and it works when you install it.. then after ""some time"" it just doesn't. You can then reboot.. then it works.. then after... xxxxx time.. it doesn't..Fibaro helpdesk says it's a known problem.. 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Posted (edited)
    6 minutes ago, Symbiot78 said:

    @ppeterr - are you using the plugin from Fibaro?

    I tried it.. and it works when you install it.. then after ""some time"" it just doesn't. You can then reboot.. then it works.. then after... xxxxx time.. it doesn't..Fibaro helpdesk says it's a known problem.. 

     

    I loaded the plugin, but you can only control the scene's directly on the plugin. I want the scene's triggerd with a button press.

    I bought a in-wall 8 button zwave switch, i'd like to connect the scene's with LUA to the buttons.

     

    Also, i check if the LUA script doesnt work, if it still works in the plugin. Just to be sure that it "should" work.

     

     

    Edited by ppeterr
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Posted (edited)

    @mike79

     

    This line

     

    Please login or register to see this code.

     

    I assume that (not sure what it is called, but maybe prefix (http)

    is announced in this line ?

     

    Please login or register to see this code.

     

    Because, when i paste the url in a browser without http, it comes up with all api data for all scene's and doesnt run the scene.

    When i add "http://" it runs the scene.  I tried already putting http:// in front of the local url syntax. Doesnt work though :)

     

    Sorry for me being so new at this.

    Edited by ppeterr
    Link to comment
    Share on other sites

    • 0

    Please login or register to see this code.

     

    i think you have problems with copy / paste

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 40 minutes ago, tinman said:

    Please login or register to see this code.

     

    i think you have problems with copy / paste

     

    This outputs all the scene's on the hub

     

    [10.07.2021] [20:31:23] [DEBUG] [SCENE14]: 200[10.07.2021] [20:31:23] [DEBUG] [SCENE14]: {"sceneIds":[25655,29587,25173,20692,20348,60016,14461,33859,23870,16688,37],"sceneData":[{"roomId":46469,"name":"QWxsZXMgR2VoZWVsIE9wZW4=","colorId":7,"iconId":0,"networkNumber":16,"id":25655,"order":1,"hkAssist":false},{"roomId":46469,"name":"VGVzdA==","colorId":8,"iconId":0,"networkNumber":6,"id":29587,"order":10,"hkAssist":false},{"roomId":46469,"name":"TGlua3MgQWxsZWVuIERpY2h0","colorId":8,"iconId":0,"networkNumber":107,"id":25173,"order":6,"hkAssist":false},{"roomId":46469,"name":"T3BlbiBSZWNodHM=","colorId":8,"iconId":0,"networkNumber":106,"id":20692,"order":9,"hkAssist":false},{"roomId":46469,"name":"UmVjaHRzIEFsbGVlbiBEaWNodA==","colorId":8,"iconId":0,"networkNumber":33,"id":20348,"order":7,"hkAssist":false},{"roomId":46469,"name":"SGFsZiBPcGVuIFZlcmRlZWxk","colorId":8,"iconId":0,"networkNumber":51,"id":60016,"order":4,"hkAssist":false},{"roomId":46469,"name":"SGFsZiBPcGVu","colorId":9,"iconId":112,"networkNumber":178,"id":14461,"order":5,"hkAssist":false},{"roomId":46469,"name":"QWxsZXMgR2VoZWVsIERpY2h0","colorId":7,"iconId":62,"networkNumber":44,"id":33859,"order":0,"hkAssist":false},{"roomId":46469,"name":"QmlqbmEgSGVsZW1hYWwgT3Blbg==","colorId":8,"iconId":0,"networkNumber":146,"id":23870,"order":2,"hkAssist":false},{"roomId":46469,"name":"SGFsZiBPcGVuIE9uZGVy","colorId":8,"iconId":0,"networkNumber":200,"id":16688,"order":3,"hkAssist":false},{"roomId":46469,"name":"T3BlbiBMaW5rcw==","colorId":8,"iconId":0,"networkNumber":232,"id":37,"order":8,"hkAssist":false}]}

    Link to comment
    Share on other sites

    • 0

    great, and play scene should be like (i think)

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 3 minutes ago, tinman said:

    great, and play scene should be like (i think)

     

    Please login or register to see this code.

     

     

    gives, no response from the shades ;/

     

    [10.07.2021] [20:47:56] [DEBUG] [SCENE14]: 200

    Link to comment
    Share on other sites

    • 0

    i'm not sure if it should be 

     

    sceneId=25173

     

    or

     

    sceneid=25173

     

    The first one syntax is taken from the original plugin. Try maybe different scene ID, one which works from plugin

     

    try this

     

    Please login or register to see this code.

     

    Edited by tinman
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Posted (edited)

     

    17 minutes ago, tinman said:

    i'm not sure if it should be 

     

    sceneId=25173

     

    or

     

    sceneid=25173

     

    The first one syntax is taken from the original plugin. Try maybe different scene ID

     

    When i paste the url in chrome with a lower case i, it doesnt work. With a uppercase it works in the browser

    Any other scene Id also works in the browser. Still get the "200" Debug msg. And no action on the shades.


    Also i checked in de plugin - examples tab. Selecting a scene there also works.

     

    200 should be succes :)

     

     

    Edited by ppeterr
    Link to comment
    Share on other sites

    • 0

    check what i just posted

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 2 minutes ago, tinman said:

    check what i just posted

     

    [10.07.2021] [21:14:24] [DEBUG] [SCENE14]: {"scene":{"roomId":46469,"name":"TGlua3MgQWxsZWVuIERpY2h0","colorId":8,"iconId":0,"networkNumber":107,"id":25173,"order":6,"hkAssist":false}}

    Link to comment
    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
    Answer this question...

    ×   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.

     Share

    ×
    ×
    • Create New...