openLuup - running unmodified plugins on any machine

[quote=“vosmont, post:39, topic:187412”]As I am on Windows, I’m not sure that the script “.sh” will work.
For the moment I’ve modified the function getIP in L_ALTUI.lua, and it’s OK.[/quote]
I never imagined that openLuup would be run on a Windows machine! A fair number of plugins will be written with the assumption that the underlying system is Unix. In particular, anything with an [tt]os.execute(…)[/tt] call will likely fail. Your ALTUI fix is what I originally did - hooray for open source!

[quote=“vosmont, post:40, topic:187412”][quote=“vosmont, post:39, topic:187412”]The plugin RGB Controller doesn’t work :
http://ip:3480/data_request?id=action&output_format=json&DeviceNum=41&serviceId=urn:upnp-org:serviceId:RGBController1&action=GetColorChannelNames
returns “-1”[/quote]

I think the problem is that this action is for the distant Vera (the plugin is installed on it). So when it is executed on openLuup, it can’t respond.
So for the javascript in the tab of the distant plugin, it lacks perhaps a proxy.[/quote]

A couple of points here:

[ul][li]An action call to a device bridged by VeraBridge will be re-routed to the remote machine device - this is how turning on lights, etc., works. So the underlying mechanism should be working. Actions which have return variables are not fully working at this time. The definition of which variables to return is given in the service .xml files and I’ve been trying to avoid them, since this brings me too close to UPnP syntax nonsense. The same with scene triggers.[/li]
[li]Obviously, a plugin which assumes that it’s manipulating the local machine GUI is going to struggle when bridged. The solution is surely, simply to run RGB Controller on the openLuup machine - this is what it’s for, to offload things from the original Vera. **** see edit below ***[/li][/ul]

Sounds like you’ve made a lot of progress. Interested in hearing further.


Edit: having re-read my reply, I suddenly realise that the action call you are making, which needs to be handled by VeraBridge, is NOT in its list of implemented actions (as given in the implementation file.) This is perhaps what you implied by mentioning a proxy. It would be a step forward to insert that action into I_VeraBridge.xml, but you may still have difficulties with the JavaScript. Running it locally still makes sense to me.

Just for the sake of completeness, the serviceId / actions currently handled by VeraBridge are:

<serviceId>urn:upnp-org:serviceId:SwitchPower1</serviceId>
<name>SetTarget</name>

<serviceId>urn:upnp-org:serviceId:Dimming1</serviceId>
<name>SetLoadLevelTarget</name>

<serviceId>urn:micasaverde-com:serviceId:DoorLock1</serviceId>
<name>SetTarget</name>
  
<serviceId>urn:upnp-org:serviceId:TemperatureSetpoint1_Heat</serviceId>
<name>SetCurrentSetpoint</name>

<serviceId>urn:upnp-org:serviceId:HVAC_UserOperatingMode1</serviceId>
<name>SetModeTarget</name>

<serviceId>urn:upnp-org:serviceId:WindowCovering1</serviceId>
<name>Up</name>

<serviceId>urn:upnp-org:serviceId:WindowCovering1</serviceId>
<name>Down</name>

<serviceId>urn:upnp-org:serviceId:WindowCovering1</serviceId>
<name>Stop</name>

<serviceId>urn:micasaverde-com:serviceId:SecuritySensor1</serviceId>
<name>SetArmed</name>

Hi
I tried this in Ubuntu and get the following response:

/etc/cmh-ludl$ sudo lua5.1 openLuup_release_1.lua /dev/null

lua5.1: ./openLuup/logs.lua:6: module ‘socket’ not found:
no field package.preload[‘socket’]
no file ‘./socket.lc’
no file ‘./socket.lua’
no file ‘/usr/local/share/lua/5.1/socket.lua’
no file ‘/usr/local/share/lua/5.1/socket/init.lua’
no file ‘/usr/local/lib/lua/5.1/socket.lua’
no file ‘/usr/local/lib/lua/5.1/socket/init.lua’
no file ‘/usr/share/lua/5.1/socket.lua’
no file ‘/usr/share/lua/5.1/socket/init.lua’
no file ‘./socket.so’
no file ‘/usr/local/lib/lua/5.1/socket.so’
no file ‘/usr/lib/x86_64-linux-gnu/lua/5.1/socket.so’
no file ‘/usr/lib/lua/5.1/socket.so’
no file ‘/usr/local/lib/lua/5.1/loadall.so’

[quote=“tomvanbreda, post:43, topic:187412”]Hi
I tried this in Ubuntu and get the following response:

/etc/cmh-ludl$ sudo lua5.1 openLuup_release_1.lua /dev/null

lua5.1: ./openLuup/logs.lua:6: module ‘socket’ not found:[/quote]

Yes. I think it means what it says - you haven’t installed the LuaSocket library.

See the bottom line of this earlier post: [url=http://forum.micasaverde.com/index.php/topic,32315.msg240753.html#msg240753]http://forum.micasaverde.com/index.php/topic,32315.msg240753.html#msg240753[/url]

It may be that you need a different instruction on Ubuntu to install it, but if you have already managed to install Lua then this should be along the same lines.

@vosmont

So I tried this and got quite a long way using this startup code:

do -- RGB Controller
  local Drgb = luup.create_device ('', '', "RGBW Controller", "D_RGBController1.xml", "I_RGBController1.xml")
  luup.attr_set ("device_json", "D_RGBController1_UI7.json", Drgb)
  luup.variable_set ("urn:upnp-org:serviceId:RGBController1", "DeviceType", "FGRGBWM-441", Drgb)
  luup.variable_set ("urn:upnp-org:serviceId:RGBController1", "DeviceId", "217", Drgb)
end

I had to force the DeviceType and DeviceId variables, because I couldn’t get the settings tab on the control panel to display for some reason. The problem I ran into, however, is that, currently, the VeraBridge does not honour parent/child relationship from the bridged Vera: all remote devices are children of the VeraBridge (I think this is how it works on natively bridged Veras too, so it wouldn’t work there either.) This means that the target master device (Fibaro, in my case) does not have any RGBW children.

If you want to discuss this further, I’d recommend starting a new thread because we are drifting away from the general issues around openLuup. Thanks.

I have now modified the behaviour of VeraBridge and it does now reflect the parent/child relationships. Attached is an ALTUI Parent/Child map now showing clearly that some of the remote machines have Netatmos attached with their plethora of child devices. Also some multi-sensors and an RGBController.

If you want to discuss this further, I'd recommend starting a new thread because we are drifting away from the general issues around openLuup. Thanks.
So I ignored my own advice, because this is a general issue, but I have also discovered why my setup screen is not displaying for the RGBController - I'll raise that on the appropriate thread.

Oh hi there! I was wondering if I should post instructions on transitioning to openLuup, but I thought I would make sure it worked OK for others first! [tt]DataYours[/tt] certainly works for me on this distribution, although I have made one change to it to make startup easier on openLuup.

All you would need to do is add to the startup code:

do -- DataYours 
  local dy7 = luup.create_device ('', '', "DataYours", "D_DataYours7.xml","I_DataYours7.xml")        -- create the device
  luup.variable_set ("urn:akbooer-com:serviceId:DataYours1", "DAEMONS", "Graph, Dash, Cache, Watcher", dy7)
  luup.variable_set ("urn:akbooer-com:serviceId:DataYours1", "LOCAL_DATA_DIR", "/nas/whisper/", dy7)
  luup.variable_set ("urn:akbooer-com:serviceId:DataYours1", "VERAS", "172.16.42.10, 172.16.42.11, 172.16.42.12, 172.16.42.14", dy7)
end

…obviously with IP addresses, etc. tailored to your system.

I’ll post the update to [tt]DataYours[/tt] on that thread, to keep this focused on openLuup issues.

Thanks for the interest.[/quote]

Hi akbooer,

I’ve installed openLuup with AltUI Veraridge on another Rpi and all seems ok.

To install Datayours on this Rpi I’ve to copy all the Datayours Lua files on /etc/cmh-ludl directory and add the code to startup.lua as you indicated in this post ?

tnks

donato

[quote=“d55m14, post:47, topic:187412”]I’ve installed openLuup with AltUI Veraridge on another Rpi and all seems ok.

To install Datayours on this Rpi I’ve to copy all the Datayours Lua files on /etc/cmh-ludl directory and add the code to startup.lua as you indicated in this post ?[/quote]

Excellent! Glad it’s going well - I have a new release of openLuup very soon (with scenes, timers, actions, ALTUI history, …)

You need the full set of installation files, since ALTUI (and, to some extent, openLuup) also need the S_xxx.xml, D_xxx.xml, I_xxx.xml, D_xxx.json information, as well as the actual Lua code - all in the same directory (/etc/cmh-ludl/)

[quote=“akbooer, post:48, topic:187412”][quote=“d55m14, post:47, topic:187412”]I’ve installed openLuup with AltUI Veraridge on another Rpi and all seems ok.

To install Datayours on this Rpi I’ve to copy all the Datayours Lua files on /etc/cmh-ludl directory and add the code to startup.lua as you indicated in this post ?[/quote]

Excellent! Glad it’s going well - I have a new release of openLuup very soon (with scenes, timers, actions, ALTUI history, …)

You need the full set of installation files, since ALTUI (and, to some extent, openLuup) also need the S_xxx.xml, D_xxx.xml, I_xxx.xml, D_xxx.json information, as well as the actual Lua code - all in the same directory (/etc/cmh-ludl/)[/quote]

Hi akbooer,

where can I find the full updated set of Datayours files to upload on Rpi ?

tnks

donato

Release 2 attached, including VeraBridge plugin to connect to remote Veras.

New features include:

[ul][li]scenes (with timers, but not triggers)[/li]
[li]persistence of rooms and scenes[/li]
[li]better integration with ALTUI[/li]
[li]scene and variable history (through ALTUI)[/li]
[li]uses S_xxx.xml files for definition of action return variables[/li][/ul]

This should run on any Unix system - someone even has it running under Windows (some features don’t work there.)

The biggest thing missing is still the luup.io module so some plugins (including Arduino) do not yet run - it’s really the next thing on the list.


Edit: This release has been superseded. Please see link on post #1 of this thread for latest

Hi akooer

I copied all files of Datayours on etc/cmh-ludl directory and modified the startup.lua as you indicated, but when I call the dashboard ("http://xxxxxxxx:3480/data_request?id=lr_dashboard2&page=home) I get the msg “no handler” . Do I have to do any other operation ?

tnks

donato

You should be using the Lua files here?
[url=http://forum.micasaverde.com/index.php/topic,30808.msg242800.html#msg242800]http://forum.micasaverde.com/index.php/topic,30808.msg242800.html#msg242800[/url]

Hi akooer

I’ve installed v2 of Openluup ut when I start it I get the following message :

pi@raspberrypi /etc/cmh-ludl $ lua5.1 openLuup_release_2.lua
lua5.1: openLuup_release_2.lua:6: module ‘openLuup.init’ not found:

Have you any idea ?

I’d like to install a Rpi or similar machine with only Openluup and Datayours (Watcher, Cache, Graph, Dash).

tnks

donato

Have you retained the directory structure of the .zip file? All the openLuup modules should be in a sub directory of the same name within your nominal /etc/cmh-ludl/ directory where all your D_xxx.xml files, etc, live.

Yes I’ve copied your structure of the zip file where is the “openluup” sub directory and within it I’ve copied Datayours, Altui files.

But the error msg is the same.

OK, I’m not convinced we’re quite on the same page re. directory structure.

You should have, at a minimum:

[ul][li]‘home’ directory, usually called /etc/cmh-ludl/ containing:
[list]
[li]all your required device .lua, .xml and .json files[/li]
[li]the openLuup_release_2 startup file
[/li][li]subdirectory ‘openLuup’ containing [list]
[li]only the distribution files[/li]
[/list][/li]
[/list][/li][/ul]

Your current directory, when you start, should be /etc/cmh-ludl/


Edit: added .lua reference

[quote=“akbooer, post:56, topic:187412”]OK, I’m not convinced we’re quite on the same page re. directory structure.

You should have, at a minimum:

[ul][li]‘home’ directory, usually called /etc/cmh-ludl/ containing:
[list]
[li]all your required device .xml and .json files[/li]
[li]the openLuup_release_2 startup file
[/li][li]subdirectory ‘openLuup’ containing [list]
[li]only the distribution files[/li]
[/list][/li]
[/list][/li][/ul]

Your current directory, when you start, should be /etc/cmh-ludl/[/quote]

The lua files (datayours, altui) should be in the /etc/cmh-ludl/ directory ?

Tnks Donato

Yes.

Hi akbooer,

excuse me if I’m doing some mistake but I’ve redo a check and the files location seem ok : the error message is the same.

I’ve substituted the R2 distribution with the R1 and all is ok included Datayours Dashboard.

Can I do any other check to find my error ?

tnks

donato

Can you send me a directory listing of your openLuup directory?