Page 1 of 2
OpenRemoteHelpers under version 2.0.0
Posted: 02 Oct 2014 19:07
by pz1
It seems that the OpenRemoteHelpers module is not working anymore under version 2.0.-rc8. I do get error message
Invalid ZAutomation request
That can be tested with the WEBbrowser. For example I took command
Code: Select all
http://raspberry:8083/ZAutomation/OpenRemote/TemperatureLevel/13/3
Which is supposed to read the temperature level of the fist sensor of the Fibaro FGBS001. This did work well in 1.7.2.
As a matter of fact none of OpenRemote calls does return a value. I guess the module needs adaptation for the new 2.0.0. Or can I find somewhere an update? I just use wgat comes with the RC.
Re: OpenRemoteHelpers under version 2.0.0
Posted: 02 Oct 2014 23:21
by pofs
Yes, url access is changed in 2.0.
But you may fix it quite simple. Just add the following line in the end of OpenRemoteHelpers:
Code: Select all
allowExternalAccess("OpenRemote");
And drop /ZAutomation part from the url, so it would be
http://ip:8083/OpenRemote/…
Re: OpenRemoteHelpers under version 2.0.0
Posted: 03 Oct 2014 14:03
by pz1
I have added the allowExternalAccess at the end of the index.js of module OpenRemoteHelpers:
Code: Select all
OpenRemoteHelpers.prototype.stop = function () {
OpenRemoteHelpers.super_.prototype.stop.call(this);
OpenRemote = null;
};
allowExternalAccess("OpenRemote");
// ----------------------------------------------------------------------------
// --- Module methods
// ----------------------------------------------------------------------------
Restarted Z-Way server
Command
http://raspberry:8083/OpenRemote/TemperatureLevel/15/3
reports now 404 Not Found
Re: OpenRemoteHelpers under version 2.0.0
Posted: 03 Oct 2014 15:56
by pofs
Has it even loaded? Do you have any errors in log?
I've tried to do the same, and it kinda works
Just not sure about response format, as strings like "on" and "off" are returned with quotes (default JSON serialization)
Re: OpenRemoteHelpers under version 2.0.0
Posted: 03 Oct 2014 16:11
by pz1
Just got this solved: I did a complete reboot of the Pi
Apparantly restart Z-Way-server was not enough.
I have it working for Switches and Universal sensors. I am now confident to change all urls to my 10 StellaZ devices.
CPU usage seems the same as under 1.7, not yet the 1-2% predicted for release 2.x

- top.PNG (17.53 KiB) Viewed 7852 times
PS: Shouldn't you guys add this line:
Code: Select all
allowExternalAccess("OpenRemote");
To the OpenRemoteHelpers JS file?
I'll make a prelimenary write-up of this transition from 1.x to 2.x under Recipes
Re: OpenRemoteHelpers under version 2.0.0
Posted: 03 Oct 2014 16:25
by pofs
Sure, we'll add it.
About CPU usage: 1-2% was measured on my laptop (against 3-4% on 1.7), not on RPi. Sure it would be a bit higher on RPi because of different architecture and computing power.
We don't have influence on resources used by v8 engine on a specific platform. Just watch mem and CPU usage isn't growing too much

Re: OpenRemoteHelpers under version 2.0.0
Posted: 04 Oct 2014 16:02
by pz1
Can confirm that StellaZ main functions work fine now with OpenRemoteHelpers. There are a few minor functions e.g. device location/name that were in the old RaZOR module, which are (not yet) in the OpenRemoteHelpers.
Re: OpenRemoteHelpers under version 2.0.0
Posted: 04 Oct 2014 18:37
by PoltoS
You can add allowExternalAccess in OpenRemote module if you want to shorten URLs from /ZAutomation/OpenRemote to /OpenRemote.
@pofs: why allowExternalAccess is global and not in ws?
Re: OpenRemoteHelpers under version 2.0.0
Posted: 06 Oct 2014 16:57
by pz1
On my own machine I have extended the index.js op OpenRemoteHelpers a bit. For my OR-GUI I do use devicename and location as they are stored in my StellaZ devices.
Just before case "metrics" I added:
Code: Select all
case "DeviceName":
return zway.devices[N].instances[I].NodeNaming.data.nodename.value;
case "DeviceLocation":
return zway.devices[N].instances[I].NodeNaming.data.location.value;
By the way, what is the "metrics" suposed to do for me?
Code: Select all
http://raspberry:8083/OpenRemote/metrics/21
Uncaught TypeError: Cannot read property 'get' of undefined
Re: OpenRemoteHelpers under version 2.0.0
Posted: 07 Oct 2014 00:24
by PoltoS
metrics are to fetch directly metrics from HA. Out /ZAutomation/api/v1/devices/StellaZ1 returns JSON object, while OpenRemote can not parse it. This 'metrics' is made ti fetch data from it.