Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getObject(id, "rooms") liefert nicht die Raumnamen #54

Closed
Hypnos3 opened this issue Dec 4, 2017 · 4 comments
Closed

getObject(id, "rooms") liefert nicht die Raumnamen #54

Hypnos3 opened this issue Dec 4, 2017 · 4 comments

Comments

@Hypnos3
Copy link
Contributor

Hypnos3 commented Dec 4, 2017

Ich habe ein Objekt 'hm-rpc.0.NEQ0184905.1', welchem die Räume 'Wohnzimmer' und 'Erdgeschoss' zugewiesen sind:
image

Diese Räume möchte ich jetzt ermitteln. Prinzipiell sollte es auch auf dem untergeordneten Datenpunkt möglioch sein, es wird jedoch ein leeres Array zurückgeliefert:

var id = 'hm-rpc.0.NEQ0184905.1.LEVEL';
var raumobj = getObject(id, "rooms");
log(JSON.stringify(raumobj));

//Ergebnis:
//{"def":0,"type":"number","read":true,"write":true,"min":0,"max":100,"unit":"%","role":"level.dimmer","workingID":"WORKING","name":"K14_110_WZ_Licht_LED_Dimmer.LEVEL"},"native":{"CONTROL":"DIMMER.LEVEL","DEFAULT":0,"FLAGS":1,"ID":"LEVEL","MAX":1,"MIN":0,"OPERATIONS":7,"TAB_ORDER":0,"TYPE":"FLOAT","UNIT":"100%"},"_id":"hm-rpc.0.NEQ0184905.1.LEVEL","acl":{"object":1636,"state":1636,"owner":"system.user.admin","ownerGroup":"system.group.administrator"},"enumIds":[],"enumNames":[]}

Ich kann die Objekte auch einzeln durchprobieren, es kommt das selbe Ergebnis:

var dp = getObject("hm-rpc.0.NEQ0184905.1.LEVEL","rooms");
log ("Raum: " + dp.enumNames);
log ("RaumID: " + dp.enumIds);

var dp = getObject("hm-rpc.0.NEQ0184905.1","rooms");
log ("Raum: " + dp.enumNames);
log ("RaumID: " + dp.enumIds);

var dp = getObject("hm-rpc.0.NEQ0184905","rooms");
log ("Raum: " + dp.enumNames);
log ("RaumID: " + dp.enumIds);

Ergebnis:

23:14:07.292   [info]   javascript.0 script.js.common.Test: Raum:
23:14:07.292   [info]   javascript.0 script.js.common.Test: RaumID:
23:14:07.292   [info]   javascript.0 script.js.common.Test: Raum:
23:14:07.292   [info]   javascript.0 script.js.common.Test: RaumID:
23:14:07.292   [info]   javascript.0 script.js.common.Test: Raum:
23:14:07.292   [info]   javascript.0 script.js.common.Test: RaumID:

Was mache ich falsch?

@Jey-Cee
Copy link
Contributor

Jey-Cee commented Jun 6, 2018

I have tested this (JS Adapter v3.6.4), it seems to work. @Hypnos3 Can we close this issue?

@Hypnos3
Copy link
Contributor Author

Hypnos3 commented Jun 11, 2018

ja, funktioniert mittlerweile.

@Hypnos3 Hypnos3 closed this as completed Jun 11, 2018
@stefanerdmann
Copy link

just a short note: this effect can still happen if rooms are generated during a running javascript instance. The rooms are then only visible after the javascript adapter was restarted

@AlCalzone
Copy link
Collaborator

@stefanerdmann your issue seems related to #109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants