HomeGenie Forum

General Category => Troubleshooting and Support => Topic started by: KaZe on December 13, 2016, 07:34:53 PM

Title: Sensor widget don't show Sensor. parameters
Post by: KaZe on December 13, 2016, 07:34:53 PM
Hi!

In HG r525 the Sersor widget don't show all Sensor. parameter with web UI. Android plus app show...The web UI show the default parameters, like temperature, humidity....but don't show unique parameters.
What changed in widgets?
Title: Re: Sensor widget don't show Sensor. parameters
Post by: nolio on December 18, 2016, 08:17:50 AM
Hi,

In the javascript code of the widget "homegenie/generic/sensor", there ctx.isUnknown that filter which parameter to show :
Code: [Select]
var ctx = $$.ui.GetParameterContext($$.module, parameter.Name, parameter.Value);
if (!ctx.isUnknown) {
I try to comment this check, but there is a lot of parameters in a module that are not interesting, but you can add parameter you want with something like this :
Code: [Select]
if (!ctx.isUnknown || parameter.Name == "Betti") {
Are you sure it was previously working ?
Title: Re: Sensor widget don't show Sensor. parameters
Post by: KaZe on December 19, 2016, 10:21:52 AM
Hi,

In the javascript code of the widget "homegenie/generic/sensor", there ctx.isUnknown that filter which parameter to show :
Code: [Select]
var ctx = $$.ui.GetParameterContext($$.module, parameter.Name, parameter.Value);
if (!ctx.isUnknown) {
I try to comment this check, but there is a lot of parameters in a module that are not interesting, but you can add parameter you want with something like this :
Code: [Select]
if (!ctx.isUnknown || parameter.Name == "Betti") {
Are you sure it was previously working ?


Hi!

Yes, it was previously working. This is the program: http://www.homegenie.it/forum/index.php?topic=1174.msg7407#msg7407 (http://www.homegenie.it/forum/index.php?topic=1174.msg7407#msg7407)
You can see, the program was show the parameters with the previously widget version.

I will try your suggestions today.

Thanks your help!
Title: Re: Sensor widget don't show Sensor. parameters
Post by: KaZe on December 20, 2016, 09:59:16 PM
Hi,

In the javascript code of the widget "homegenie/generic/sensor", there ctx.isUnknown that filter which parameter to show :
Code: [Select]
var ctx = $$.ui.GetParameterContext($$.module, parameter.Name, parameter.Value);
if (!ctx.isUnknown) {
I try to comment this check, but there is a lot of parameters in a module that are not interesting, but you can add parameter you want with something like this :
Code: [Select]
if (!ctx.isUnknown || parameter.Name == "Betti") {
Are you sure it was previously working ?

Hi!

I try this, but nothing change.
Title: Re: Sensor widget don't show Sensor. parameters
Post by: KaZe on December 20, 2016, 10:06:55 PM
Hi!

It's work, with other parameter.

Code: [Select]
if (!ctx.isUnknown || parameter.Name == "Sensor.Betti") {
Thanks!