Page 1 of 1
UserModule Get device metric
Posted: 09 Jul 2015 11:41
by Isaksson
Hello.
When update event listener is created then it is possible to get metric from device.
Code: Select all
this.controller.devices.on(this.config.device, 'change:metrics:level', this.handler);
Now its easy to get metric from device with
But i need to fetch the metric from an device direct from the configuration file.
This is what i have right now that i thought should work.
Code: Select all
controller.devices.get(self.config.device).get("metrics:level");
But that did now work, could someone point me in the right direction.
Re: UserModule Get device metric
Posted: 09 Jul 2015 12:21
by pz1
You just can't. I have had a long discussion about in a
different thread. No answer about why you can't get there.
It has been implemented in module OpenRemoteHelpers. It is a simple call there.
For example:
Code: Select all
http://raspberry_ip:8083/OpenRemote/metrics/SolQoS_77/QoS
Re: UserModule Get device metric
Posted: 09 Jul 2015 15:48
by Isaksson
Thanks for the reply, but i have to say that this is very strange, this is one of the most basic task that you want an module to handle.
Re: UserModule Get device metric
Posted: 09 Jul 2015 17:03
by pz1
I could not agree more...
Re: UserModule Get device metric
Posted: 10 Jul 2015 19:35
by Isaksson
Maybe PoltoS or someone in the team could dig a little deeper in this?
Re: UserModule Get device metric
Posted: 26 Jul 2015 10:53
by Isaksson
Anyone from the development team?
Re: UserModule Get device metric
Posted: 01 Aug 2015 02:39
by PoltoS
This works:
http://localhost:8083/JS/Run/this.contr ... rics:level")
So, your example should work in JS too
Just make sure that controller is not oveloaded by any local var. May be write this.controller (if this refers to global context).
Also make sure that self.config.device is correct - may be self is not correctly defined.
Re: UserModule Get device metric
Posted: 03 Aug 2015 09:39
by Isaksson
Thanks, i will make some more tests.
What do you say pz1, maybe you also will spend some time on this and maybe we could solve the issue?
Re: UserModule Get device metric
Posted: 03 Aug 2015 09:58
by pz1
Isaksson wrote:What do you say pz1, maybe you also will spend some time on this and maybe we could solve the issue?
Would it be an option for you to put your module on Github?