RaZberry as device

Discussions about RaZberry - Z-Wave board for Raspberry computer
CristianMori
Posts: 3
Joined: 20 Jan 2013 02:25

RaZberry as device

Post by CristianMori »

Will it be possible to program the RaZberry to act as a device instead of a gateway?
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

It is a device ;)

Post by PoltoS »

Well, what do you mean by gateway/device? You can use it as a secondary controller (as any other remote in Z-Wave). It also can trap commands from other devices and do some JavaScript job. Of course this can lead to program execution on Raspberry Pi OS.
CristianMori
Posts: 3
Joined: 20 Jan 2013 02:25

What I was willing to to is

Post by CristianMori »

What I was willing to to is to use it to ,for example, create a device that handle my garage door or that monitor and feed my fish tank... I am not interested in using it as a controller, but as a device in my zwave network like any other switch or outlet that I already have.
I may lack info on the real difference between a controller and a device, thou...
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

The controller is the device

Post by pz1 »

The controller is the device from which commands are sent to your light switch to switch on or off. Or to read the status to see if it is on or off. The same for the motor that opens your garage door.
Under the Documentation menu item at the top you will find a quick starter guide and an extensive user manual. Read that first to get a global insight on how these things work.
Since 29-12-2016 I am no longer a moderator for this forum
CristianMori
Posts: 3
Joined: 20 Jan 2013 02:25

I read the docs.

Post by CristianMori »

I read the docs.
I still have the question. Can I use is to create a device that gets commands from my actual controller?

I want to do a fish-feedig device, and report to the controller when the last feed was done, the amount of feed left etc, and get from the controller the command to initiate a new feed cycle
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

You still don't make clear

Post by pz1 »

You still don't make clear how your existing Z-Wave is controlled. Can't that existing controller do the smart? feed control?
Since 29-12-2016 I am no longer a moderator for this forum
kgrr
Posts: 1
Joined: 17 Feb 2013 22:11

Raspberry as a DEVICE, not a Controller or Secondary Controller

Post by kgrr »

Yes, I too have read the documentation.

I have a Controller. This could be a Razberry under its normal functionality (or it could be another controller). This is not important to this discussion. I also have remote controls that act as Secondary Controllers. This is also not important to this discussion. The discussion is about Z-Wave Devices, not controllers. Let me explain.

I would like to build custom Z-Wave DEVICES to do things that there are not off-the-shelf products for. I want to build devices that can be controlled with another Razberry (or another controller like my MiCasaVerde)
For example, I would like to build
1) A gas fireplace controller -- looks like a special switch to the Z-Wave controller. However, it has an ISOLATED relay which can close the low-voltage circuit to light the fireplace. Unlike switches that do this, the fireplace controller would shut-off the fireplace off if the heat is too high, CO is detected, or smoke is detected.
2) A garage door controller -- looks like a special dimmer to the Z-Wave controller. If the door is open, it reports "ON". If the door is closed, it reports "OFF". If the door is in progress of opening or closing, it reports a dimmed value of 50%. The device receives a command to either open or close the garage door from the controller. The device reads the state of the door from sensors and reports the status when it is done to the controller.
3) A doorbell and phone ring detector. The device reports the event to the controller like a window or door sensor.
4) A water detector. The detector sits in a basement, under a hot water heater, under the sinks or near the tub and toilet in the bathrooms and detects water spills. When the event is detected, it is reported to the controller just like a window or door sensor.
5) A IR Blaster. The device sits in the living room with the rest of my entertainment gear. It transmits IR coded to turn on and off the TV, change channels on the TV, raise or lower the volume on the TV. It also interfaces to the stereo and can turn it on and off, change stations, raise or lower the volume, etc.
6) Interface to motorized window shades. Looks just like a dimmer to the controller.
7) Fish feeder
8) Plant feeder
9) Custom power strip
etc. etc.

There are many DEVICES that experimenters might want on their Razberry or existing Z-Wave network.
Can the existing controller do these things? Yes, if it were next to the fireplace, the garage door, the doorbell transformer, the water heater and bathrooms, the fish tank, the plants, etc. The point is that we both want devices that can be REMOTE CONTROLLED by the controller over Z-Wave.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Some of the things you want

Post by pz1 »

Some of the things you want to do can be done with the Fibaro Universal Sensor. To detect a fully open, or fully closed door you may need to separate sensors. For sunshades I know Somfy has a Z-Wave gateway. A Z-wave water detector is available. Google is your friend here. You may have a look at the supplier site http://www.zwaveeurope.com
Quite a lot of the required functions can be done via the Z-wave Basic Command which is implemented in Z-Way afaik.
Since 29-12-2016 I am no longer a moderator for this forum
manuelokelly
Posts: 7
Joined: 21 Jan 2013 11:14

I still haven't seen an

Post by manuelokelly »

I still haven't seen an answer to CristianMori & kgrr's question.

Can RaZberry act as a remote *device* which receives commands from a controller such as MiCasaVerde and acts on those commands?

Seems like a yes/no question.
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Short answer is YES.

Post by PoltoS »

Short answer is YES.

The long is stil YES, but with more details on the implementation.

RaZberry announce a list of Command Classes it supports as any other Z-Wave Device (this list is called NIF, Node Information Frame). Vera and other controllers (Z-Way, HC2, ...) uses NIF to detect device capabilities. The NIF content is taken from config/Defaults.xml file. Make sure to list only those Command Classes, which are supported by RaZberry.

Each Command Class have it's own dataholder that stores it's own variable. In this dataholder there are values reported by a remote device with Report packet and for some Command Classes which are sent to RaZberry from a remote.

Let's consider Switch Multilevel Command Class (let' assume we are trying to make a "special dimmer" device. In this case values sent from remote devices to RaZberry are stored in "mylevel" value. Hence, to access it use devices[N].instances.commandClasses[0x26].data.mylevel

Next step is to bind a change of this value to some action:
zway.devices[N].instances.commandClasses[0x26].data.mylevel.bind(function() { debugPrint("I've just got new value: " + this.valueOf()) });

On Monday we will release new version of RaZberry s/w that will allow to execute external scripts from JS code, so you will be able to do system("gpio write 0 " + (this.valueOf()!=0));

As you see, quite easy! RaZberry really gives you the full access to Z-Wave events in a very simple way with JavaScript.

We will include some examples in our big HowTo we are preparing. Hope to publish it next week.

As for Z-Wave terminology, RaZberry is still a controller device (since f/w of the PCB board is based on Z-Wave controller SDK), which means it keeps the topology of the network in it's memory.
Post Reply