Android application and SSL certificate

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
angelbast
Posts: 5
Joined: 20 Apr 2013 20:52

Android application and SSL certificate

Post by angelbast » 18 May 2013 21:51

Hi everyone,
I'm developing an android application to send commands to the zcloud.
Currently I can recover all the scenes and launch them with my application.
I can recover the devices too and control them with it.

But i have only switches in my configuration and i would like to know how to differentiate all the devices to classify them in my application and to make it consider all type of devices : switches, locks, sensors, meters to control them.
Can anyone help me with that ?

I have a second question : In my application, I use a SSL certificate to connect to the Zcloud via the https connection, but are the certificate differents for each port of connection or not ?
More clearly : If I release my application for everyone with the certificate in it, will the application work for everyone when they provide their port, username and password, or do they have to use their own certificate too ?

Last question : My devices are Duwï motor switches and when I used the standalone server running on my razberry, i had access to the level of the device by getting an update and asking the level data. But now, i'm only getting a pair of empty brackets as response of the level data's request. Is there any other solution to get the level ?

Thank in advance for the help and sorry for my english.

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

1. You can look into our JS

Post by PoltoS » 18 May 2013 21:51

1. You can look into our JS Web UI to get how to we sort devices by types. There are two ways: by Device Class (accessed by devices[N].data.genericType and .data.specificType, which both gives Device Class (verbal string is accessible as .data.deviceTypeString)). Another approach we use is to search for Command Classes (let's say, SwitchMultilevel) and add the device to apropriate category (Light or Shades - still might depend on Device Class).

2. In Z-Cloud the certificate for each user is different. But you just need to ignore self-signed certs and it will work.

Please make sure your app works with RaZberry. The latter has a slightly extended API, which is better for integration, but still no schedules, scenes, rules.

3. Please paste an example to let us understand the question in more details.

angelbast
Posts: 5
Joined: 20 Apr 2013 20:52

Thank for the reply, for the

Post by angelbast » 18 May 2013 21:51

Thank for the reply, for the first point i will check the source code of the razberry server to understand it, i knew it was something about getting commandClasses to access the differents functions of devices but i will try to figure out which commandClasses belong to each group of devices.

For the second question, i'm not really a specialist for the SSL security but i will check if there is a way in android to accept all certificates. for the moment, the application accept only the certificate i gave it.

And for the last point, i managed to get the value, i had just forgot a point, i was sending the post request to this adress : https://z-cloud.z-wave.me:XXXXX/ZWaveAPI/Run/devices[X].instances[0].commandClasses[38].data.level
but i forgot to add ".value" at the end, now it work.

My application works with a Razberry connected to the Z-cloud, it don't work if the Razberry is in standalone version, but i think, i can just change a parameter (the server adress changed to the raspberry ip) to make it work for a standalone version.

Just to ask, if i manage to authorize self-signed certificates, is it ok if I release my application as OpenSource for people who would like to use it as it is or make it better ?

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

Lights are 0x25 (SwitchBinary

Post by PoltoS » 18 May 2013 21:51

Lights are 0x25 (SwitchBinary) and 0x26 (SwitchMultilevel)
Semsors and Meters are 0x30 (SensorBinary), 0x31 (SensorMultilevel) and 0x32 (Meter).
Thermostats are 0x40 (ThemrostatMode) and 0x43 (ThermostatSetoint). (ThermostatFan is not implemented yet).
Locks are 0x62 (DoorlLock)

Should be enough to begin with. You can also use our iOS App to investigate the issue.

Please make sure your app works with locally installed Z-Way on RaZBerry (it has no scenes and areas).

You are free to publish your app. Best place would be github. We can make a link to your project on git-hub on our forum and web site once you publish it.

Thanks for your effort!

angelbast
Posts: 5
Joined: 20 Apr 2013 20:52

Thank for your answer, I will

Post by angelbast » 18 May 2013 21:51

Thank for your answer, I will try to get rid off the certificate first and then classify the devices with the infos you gave me.
And last, I will deal with the razberry in standalone mode because i think that's the easiest part...
I will publish it when the certificate part is working because for the moment it won't work for nobody except me because of the certificate included in the application.

angelbast
Posts: 5
Joined: 20 Apr 2013 20:52

Hi again,

Post by angelbast » 18 May 2013 21:51

Hi again,
I've pushed my android app to GitHub, https://github.com/angelbast/ZCloudControler
Now, the application work without certificate but control only the Z-Cloud, and without classification of devices.
The devices controlled currently are only blind controls, but you can activate every scene without problem.
This is just the beginning of the application, I will try to update it as soon as I can to control every devices and standalone razberry's.

Post Reply