Fast Forward to Razberry

Discussions about RaZberry - Z-Wave board for Raspberry computer
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

http interface example

Post by pz1 »

I intend to integrate Z-wave and other protocols (a.o. 1-Wire) with OpenRemote the http interface is of interest to me. It would be helpful if you could provide sample calls (and responses) for switching my Zwave.Me binary switch, and how to read it's Status. Openremote http calls can deal with parsing JSON responses. I would like to test this in my present Z-Cloud before purchasing a Razberry
Since 29-12-2016 I am no longer a moderator for this forum
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

I have read the latest documentation

Post by pz1 »

I run the Z-Cloud client on a Synology DS212+. On the same machine I run the OpenRemote controller. In the latter I have deactivated the native Z-Wave protocol. As a starter I try to read the status of one of my Zwave.me switches using the http protocol of OpenRemote. I therefor use the call that I took from your Razberry documentation:
https://z-cloud.z-wave.me:xxxxx/
ZWaveAPI/Run/devices[7].instances[0].commandClasses[0x30].Get()

(xxxxx is my portnumber; for readability here I put a CR in the URL)

Nothing happens.

Also if I paste the URL in Chrome the browser hangs almost forever. I would expect 0 or 255 being returned. After a long time I get error 404 Message: Command not found: /htdocs//ZWaveAPI/Run/devices[7].instances[0].commandClasses[0x30].Get().

Apparantly I am doing something wrong.
- Could you tell what I am doing wrong from the z-cloud perpective?
- Those with OpenRemote experience are welcome to comment on that end.

Thank you for your attention
Pieter
Since 29-12-2016 I am no longer a moderator for this forum
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

You have two problems in your

Post by PoltoS »

You have two problems in your tries:
1) 0x30 is the SensorBinary Command Class. You need to use 0x26 (SwitchBinary) or 0x20 (Basic)
2) The .Get() only put a packet in the queue. Since Z-Way/Z-Cloud is asynchronous, you should not expect to get a result back. The result somes in the data holder devices[7].instances[0].commandClasses[0x20].data.level.value (not sure it will work on Z-Cloud, but works for RaZberry)
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Do I understand correctly?

Post by pz1 »

Do I understand correctly that I have to make 2 Http calls?
1) the .Get() followed by
2) read the data holder?

Can I test these calls directly from Chrome? I don't get a response there if I use 0x26 (SwitchBinary) or 0x20 (Basic). (I did make a connection to my Z-Cloud as a first step)

Since 29-12-2016 I am no longer a moderator for this forum
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Yes, you are right! Get()

Post by PoltoS »

Yes, you are right! Get() send a packet and invalidate the value in data holder, which is updated upon a Report comre back.

Z-Cloud do not answer that way, but RaZberry does. It has a bit better HTTP server engine inside ;)

But with Z-Cloud you can get the tree updates to lookup for the data value change.
controlom
Posts: 2
Joined: 13 Feb 2013 13:26

Hello,

Post by controlom »

Hello,

When i use the ZWaveAPI/Run/devices[2].instances[0].commandClasses[0x20].data.level.value" the data value is "null" in razberry :(

Can you help me ?

User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Please use standard

Post by PoltoS »

Please use standard JavaScript .valueOf() instead of .value

In next version all these things will be finally unified (both notation would be possible)
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

With Razberry it works

Post by pz1 »

Thanks, with the Razberry it works now. I was able to switch on/off and read the status using Chrome/Firefox. I have now implemented a switch in OpenRemote via their HTTP protocol. The only thing that works is to switch on. I think it is a problem with status, which they require as "Boolean "on" or "off". As it seems an OpenRemote problem I have opened a new thread (http://www.openremote.org/display/forum ... h+Razberry) there to further discuss the integration.
Pieter
Since 29-12-2016 I am no longer a moderator for this forum
LOCOSP
Posts: 29
Joined: 22 Sep 2013 02:33

Re: Fast Forward to Razberry

Post by LOCOSP »

Hi, I have read all above posts and try all You mentioned, but with no luck

I have Binary Switch (node id 4 ) and all i need to get the status if it's ON or OFF...

I try with

Code: Select all

ZWaveAPI/Run/devices[4].instances[0].commandClasses[0x26].Get()
and the output is:

Code: Select all

Error 500: Internal Server Error
Uncaught TypeError: Cannot read property 'Get' of undefined 
What can be wrong ?


The same switch have power consumption meter and how can i get the amount ?

Thank You in advance.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Fast Forward to Razberry

Post by pz1 »

This thread is mostly about the older Z-Cloud which behaves differently from present RaZberry. Refer to the developers documentation
Since 29-12-2016 I am no longer a moderator for this forum
Post Reply