Plugin: Razberry support for openLuup/ALTUI

as part of ALTUI package, I am adding a Razberry (http://razberry.z-wave.me/) support to build a fully autonomous zwave controller

WHAT DO YOU NEED
it will work on a platform made of a rasberry PI2 card and openLuup framework.

HOW TO INSTALL
prerequisite setup: a working OS, a working openLuup system, a working ZWAY software on http://:8083/smarthome/#/dashboard and on http://:8083/expert/#/

Installation: this is available in the ALT App Store ( as it runs only on openLuup , it wont work on VERA ).

FOR WHO
For now this is ALPHA, it is only recommended to technical users. it will be very disappointing for non techy users at this point. but it will improve
[glow=red,2,300]warning[/glow]: until development stabilizes I cannot garantee compability between various versions

until I am in development mode it will be available to all in full open source mode, but once a critical mass of functionality is there, I will restrict it to registered users of ALTUI. Commercial use forbidden unless formally agreed otherwise.

I am open to any contributions from the community ( actually it would be cool to increase device support coverage ) and will offer ALTUI registration to significant contributors

WHAT IT DOES NOT DO (yet)

  • Inclusion Exclusion : you have to do this using zway software
  • various admin functions

WHAT IT INTENDS TO DO

  • detect zwave devices and try to create the most appropriate VERA style shadow devices for it with the usual UPNP services and variables
  • create a default dummy device otherwise
  • updates status and run actions on these devices
  • classical ALTUI features ( scene workflows watches etc )

WHAT WORKS SO FAR

  • Fibaro Wall Plug: on off status & actions, wattage display
  • Fibaro Window Sensor : tripped status, armed status, lasttrip support
  • Battery device battery level reporting

HOW TO CONTRIBUTE
a) bug fixes

b) making sure the cmd class decodes is correct and exhaustive to mimick Vera behavior and variables ( not trivial as not documented and sometime variable are only Vera’s concept. like “Armed” for sensors

c) adding new zwave command class decodes

d) having a smart device recognition logic which create the right device type and variables at creation time ( when we got zway devices and sync the vera devices ), need to be a table driven algorythm so that later one we can deport it into a web service for instance to allways have an up to date table

e) implementing and adding more UPNP vera device actions into the ActionMap data structure

f) testing with more devices.

in case of issues, try to capture the result of http://:8083/ZWave.zway/Data/0 and send along with your bug report

This is great news, can you provide a link to your App Store?

Just ordered a Razberry board, and paid extra for Saturday delivery! :slight_smile:

I’m keeping this 100% isolated from my Vera Plus. Tonight (and maybe tomorrow depending on my luck) I’m going to see if I can get the Caseta plugin working on OpenLuup without the Vera Bridge bringing it along. Long term I’m hoping this can replace the buggy Vera (unless they actually fix the plus, then I’ll let them play together). Otherwise I may have to finally learn some python and play with Home-Assistant.

I have a spare rPi so I just placed my order for the raz… Have numerous/various z-wave products I can work with to assist in support.
As always, outstanding work…

The App Store is built in altUI as a App Store page.
You do need ak’s altappstore Lua plugin also

The App Store is built in altUI as a App Store page.
You do need ak’s altappstore Lua plugin also[/quote]

The latest openLuup versions include a pre-loaded AppStore plugin (required anyway to make AltUI updates!)

The plugin can update itself either from the Updates page (easiest and preferred method) or from the AppStore (if you specifically wanted to upload an old version for some reason.)

Interesting, how are you handling status updates from Z-Way? Polling or something on Z-Way to push them to altUI?

As an aside if you didn’t already know, Z-Way is probably the most technically complaint Z-Wave controller there is and the way they approach Inclusion of devices is outstanding. By splitting out the management of Z-Wave from the UI itself it means devices should always Include correctly and be fully exposed at the protocol level.

Essentially they use the Inclusion process to create entities to match every Command Class that the device reports to support - it’s then up to the UI to interpret those and create a UI device for each - and then finally up to the end-user to disable / delete anything that they don’t need. This approach means that you will often get duplication, for example where the device supports multiple Command Classes that do similar things (for example Basic Command Class for a PIR as well as Notification Command Class). But that’s a much better way to handle things than other controllers that may just present a single or subset of functions from a complicated device.

Once you know your way around the ExpertUI of Z-Way and how the front-end (simple) UI works you can pretty much get any Z-Wave device fully functional - I tested recently with a lot of funky devices that prove problematic in other controllers - MS6, Fibaro Motion (with tamper, vibration, acceleration, etc), Qubino devices (with multiple inputs, multi-instance end-points, etc) and managed to get them all working well.

So an altUI / openLuup / Z-Way mash-up has a great deal of promise IMO ;D

Hi amg0 it’s fantastic ,

I asked akbooer about this solution and its feasibility some posts ago .
I’m very interested to partecipate to the tests .

Donato

Yes, and at that point I said:

[quote=“akbooer, post:528, topic:186018”]Other radio protocols, like the one used by MySensors Arduino and similar solutions, are also easily supported by the appropriate plugin. In fact, that plugin shows just how easy it should be to decouple any protocol from openLuup

So all you need is a ZWave to IP (or serial) bridge with a coherent API and you can link it to openLuup. For the time being, Vera is the only ZWave bridge in openLuup.[/quote]

…and way back last year I also said:

…so the only change is that @amg0 has actually ‘bitten the bullet’ and made a start!

I’m a bit confused here as to the setup procedure.

I have RP2 with Z Wave daughter board and Z-Wave whatever loaded and am starting from the opposite end.
I’m not clear on how to load OpenLuup and ALTUI onto it and make them work?

Use the documentation on GitHub to do a baseline install of openLuup. It’s nowadays very easy:

[ol][li]three commands to install the Lua libraries you need…[list]
[li]# apt-get install lua-socket[/li]
[li]# apt-get install lua-filesystem[/li]
[li]# apt-get install lua-sec[/li][/list]
[/li]
[li]run the install script in openLuup_install.lua from GitHub… [list]
[li]# lua5.1 openLuup_install.lua[/li][/list][/li][/ol]

… leaves you with a new openLuup system, running AltUI, with the AltAppStore plugin installed.

I appreciate all our help, now and in the past but… is this all a fresh install or am I overwriting the ZWave.me install?

It is parallel , the 2 do not interfere at install time. Get a working openLuup & altUI first following ak’s doc and you should be running

Install was very straightforward.

[1] Loaded my Raspbian turn-key image to my spare Pi2.
[2] With the unit powered down, inserted the daughter board within the proper GPIO slot (will include photo if anyone is in question where to insert).
[3] Booted the Pi.
[4] Installed z.way > wget -q -O - http://razberry.z-wave.me/install | bash
[5] Loaded latest v8(dev branch) openLuup files. Reload…
[6] Navigated to App Store and installed RaZberry (ALPHA).
[7] Navigatedt http://{ip_address}:8083 and setup my admin password.
[8] Added my Admin password within AltUI/RaZberry.

I navigated to http://{ip_address}:8083 then Network Control. I first started an exclusion for my MultiSensor 6. Then ran the inclusion.
Puts a major shame on MCV… I added a few screen shots… Looks like a single device was created (Routing Multilevel Sensor_2) within AltUI. I’ll add more screen shots…

And the device within AltUI. Edit: Added logs… If anyone is adding logs be careful to remove your credentials (Admin password) from the log…

And Z.Wave logs…

great. this 6 in 1 is not the easiest device to start with but let’s try
thanks for the screens and json data, it is quite useful
do you know how does it look like on a real vera ? (how many devices and of which type )

also : try to install latest version from Github ( master branch ) as AK and I are making quite a number of changes in the device detection & creation. would be curious that you a) update ALTUI and RAZB code to the latest from Github and b) delete the 6in1 device and let luup reload. it should recreate several devices

thx

A screen cap of Vera and JSON extract of the nodes in question. Let me check AK’s branch and see what I’m running. I’ll post back versions…
Edit: I grabbed the latest AltUI from the AppStore, and I think the latest of Raz… Hard to tell which is latest, 0.4 or 0.latest. Rolling the dice I opted for 0.latest. I’m running AK’s dev branch which looks to have the latest files. Just in case, I posted the startup…

2016-07-09 19:31:51.364   :: openLuup STARTUP :: 
2016-07-09 19:31:51.364   openLuup.init::        version 2016.06.30  @akbooer
2016-07-09 19:31:51.433   openLuup.scheduler::   version 2016.04.30  @akbooer
2016-07-09 19:31:51.436   openLuup.wsapi::       version 2016.07.05  @akbooer
2016-07-09 19:31:51.438   openLuup.server::      version 2016.06.09  @akbooer
2016-07-09 19:31:51.451   openLuup.rooms::       version 2016.06.23  @akbooer
2016-07-09 19:31:51.460   openLuup.scenes::      version 2016.05.19  @akbooer
2016-07-09 19:31:51.469   openLuup.chdev::       version 2016.06.02  @akbooer
2016-07-09 19:31:51.471   openLuup.userdata::    version 2016.06.30  @akbooer
2016-07-09 19:31:51.472   openLuup.requests::    version 2016.06.22  @akbooer
2016-07-09 19:31:51.475   openLuup.io::          version 2016.04.30  @akbooer
2016-07-09 19:31:51.476   openLuup.luup::        version 2016.06.06  @akbooer
2016-07-09 19:31:51.479   luup.create_device:: [1] D_ZWaveNetwork.xml /  / 
2016-07-09 19:31:51.500   luup.create_device:: [2] D_openLuup.xml / I_openLuup.xml / D_openLuup.json
2016-07-09 19:31:51.502   openLuup.init:: loading configuration user_data.json
2016-07-09 19:31:51.503   openLuup.userdata:: loading user_data json...
2016-07-09 19:31:51.548   openLuup.userdata:: loading rooms...
2016-07-09 19:31:51.548   openLuup.userdata:: ...room loading completed
2016-07-09 19:31:51.548   openLuup.userdata:: loading devices...
2016-07-09 19:31:51.549   luup.create_device:: [1] D_ZWaveNetwork.xml /  / 
2016-07-09 19:31:51.659   luup.create_device:: [3] D_ALTUI.xml / I_ALTUI.xml / D_ALTUI_UI7.json
2016-07-09 19:31:51.675   luup.create_device:: [4] D_AltAppStore.xml / I_AltAppStore.xml / D_AltAppStore.json
2016-07-09 19:31:51.706   luup.create_device:: [5] D_RAZB.xml / I_RAZB.xml / D_RAZB.json
2016-07-09 19:31:51.707   openLuup.userdata:: loading scenes...
2016-07-09 19:31:51.707   openLuup.userdata:: number of scenes = 0
2016-07-09 19:31:51.707   openLuup.userdata:: ...scene loading completed
2016-07-09 19:31:51.707   openLuup.userdata:: loading installed plugin info...
2016-07-09 19:31:51.708   openLuup.userdata:: [openLuup] openLuup (.baseline.)
2016-07-09 19:31:51.708   openLuup.userdata:: [8246] Alternate UI (not.installed)
2016-07-09 19:31:51.708   openLuup.userdata:: [AltAppStore] Alternate App Store (.baseline.)
2016-07-09 19:31:51.708   openLuup.userdata:: [VeraBridge] VeraBridge (not.installed)
2016-07-09 19:31:51.708   openLuup.userdata:: [8211] DataYours (not.installed)
2016-07-09 19:31:51.708   openLuup.userdata:: [razberry-altui] RaZberry (ALPHA) (0.latest)
2016-07-09 19:31:51.708   openLuup.userdata:: ...user_data loading completed
2016-07-09 19:31:51.708   openLuup.init:: running _openLuup_STARTUP_
2016-07-09 19:31:51.710   luup_log:0: startup code completed
2016-07-09 19:31:51.710   openLuup.init:: init phase completed
2016-07-09 19:31:51.711   openLuup.server:: starting HTTP server on 10.0.4.122:3480 tcp{server}: 0x573c68
2016-07-09 19:31:51.711   openLuup.scheduler:: starting
2016-07-09 19:31:51.711   openLuup.scheduler:: [2] device startup
2016-07-09 19:31:51.711   luup_log:2: synch in 8.3 s
2016-07-09 19:31:51.712   luup.variable_set:2: 2.urn:upnp-org:serviceId:altui1.DisplayLine2 was: EMPTY now:  #hooks:0
2016-07-09 19:31:51.712   luup.variable_set:2: 2.openLuup.Version was: EMPTY now: 16.7.5 #hooks:0
2016-07-09 19:31:51.713   luup.register_handler:2: global_function_name=HTTP_openLuup, request=openLuup
2016-07-09 19:31:51.713   luup.register_handler:2: global_function_name=HTTP_openLuup, request=openluup
2016-07-09 19:31:51.713   luup.chdev.append:: [AltAppStore] Alternate App Store
2016-07-09 19:31:51.713   luup.chdev.sync:: syncing children
2016-07-09 19:31:51.713   luup.variable_set:2: 2.openLuup.Memory_Mb was: EMPTY now: 2.2 #hooks:0
2016-07-09 19:31:51.714   luup.variable_set:2: 2.openLuup.CpuLoad was: EMPTY now: 0.3 #hooks:0
2016-07-09 19:31:51.714   luup.variable_set:2: 2.openLuup.Uptime_Days was: EMPTY now: 0 #hooks:0
2016-07-09 19:31:51.715   luup.variable_set:2: 2.urn:upnp-org:serviceId:altui1.DisplayLine1 was: EMPTY now: 2 Mb, cpu 0.3%, 0 days #hooks:0
2016-07-09 19:31:51.715   luup_log:2: 2 Mb, cpu 0.3%, 0 days
2016-07-09 19:31:51.715   openLuup.scheduler:: [2] device startup completed: status=true, msg=synch in 8.3 s, name=L_openLuup
2016-07-09 19:31:51.715   openLuup.scheduler:: [3] device startup
2016-07-09 19:31:51.715   luup_log:3: ALTUI: initstatus(3) starting version: v1.60
2016-07-09 19:31:51.716   openLuup.scheduler:: [3] device startup completed: status=nil, msg=nil, name=nil
2016-07-09 19:31:51.716   openLuup.scheduler:: [4] device startup
2016-07-09 19:31:51.716   luup_log:4: AltAppStore : starting...
2016-07-09 19:31:51.717   luup.variable_set:4: 4.urn:upnp-org:serviceId:altui1.DisplayLine1 was: AltAppStore now: AltAppStore #hooks:0
2016-07-09 19:31:51.717   luup.variable_set:4: 4.urn:upnp-org:serviceId:altui1.DisplayLine2 was:  now:  #hooks:0
2016-07-09 19:31:51.717   luup.set_failure:4: status = 0
2016-07-09 19:31:51.718   luup.variable_set:4: 4.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: 0 now: 0 #hooks:0
2016-07-09 19:31:51.718   luup.variable_set:4: 4.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: 0 now: 0 #hooks:0
2016-07-09 19:31:51.718   openLuup.scheduler:: [4] device startup completed: status=true, msg=OK, name=AltAppStore
2016-07-09 19:31:51.718   openLuup.scheduler:: [5] device startup
2016-07-09 19:31:51.718   luup_log:5: RAZB: initstatus(5) starting version: v0.03
2016-07-09 19:31:51.719   openLuup.scheduler:: [5] device startup completed: status=nil, msg=nil, name=nil
2016-07-09 19:31:52.333   openLuup.server:: new client connection: tcp{client}: 0x57b9d0
2016-07-09 19:31:52.334   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=110632409&Timeout=60&MinimumDelay=1500&_=1468110535775 tcp{client}: 0x57b9d0
2016-07-09 19:31:52.835   luup_log:3: ALTUI: startupDeferred, called on behalf of device:3
2016-07-09 19:31:52.836   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.LocalHome was:  now:  #hooks:0
2016-07-09 19:31:52.847   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Version was: v1.60 now: v1.60 #hooks:0

[quote=“amg0, post:17, topic:192902”]great. this 6 in 1 is not the easiest device to start with but let’s try
thanks for the screens and json data, it is quite useful
do you know how does it look like on a real vera ? (how many devices and of which type )

also : try to install latest version from Github ( master branch ) as AK and I are making quite a number of changes in the device detection & creation. would be curious that you a) update ALTUI and RAZB code to the latest from Github and b) delete the 6in1 device and let luup reload. it should recreate several devices

thx[/quote]

[font=verdana][size=1em]Fateful last words, I had so many problems trying to get openLuup up and going when it was first released that I eventually gave up. I’m sure it’s easy when you know how, but I’m lost at the first line.[/size][/font]

[size=1em]I was never able to get past this point and don’t remember where I obtained it from in the first place.[/size]
[size=1em]I’d love to be part of this, however, I have met my match and can only watch from the stands and cheer for you guy’s breaking new ground.[/size]
[size=1em]Perhaps, one day there will be a one click install.[/size]

Observed an error… This was using the latest Git for Raz… Same thing for 0.latest from AppStore…

2016-07-09 19:47:14.994   luup_log:5: RAZB: debug: resyncZwayDevices(5)
2016-07-09 19:47:14.995   openLuup.context_switch::  ERROR: [string "[5] I_RAZB.xml"]:654: bad argument #1 to 'ipairs' (table expected, got nil)
2016-07-09 19:47:14.995   luup.delay_callback:: function: 0x1e63bf0 ERROR: [string "[5] I_RAZB.xml"]:654: bad argument #1 to 'ipairs' (table expected, got nil)
2016-07-09 19:47:15.502   openLuup.server:: request completed (1743 bytes, 1 chunks, 7708 ms) tcp{client}: 0x1e73868
2016-07-09 19:47:15.605   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=111623411&Timeout=60&MinimumDelay=1500&_=1468111589955 tcp{client}: 0x1e73868