ioBroker.simple-api icon indicating copy to clipboard operation
ioBroker.simple-api copied to clipboard

difference between object?pattern and states?pattern

Open rewegit opened this issue 6 years ago • 11 comments

First of all, thanks for the adapter! I found an annoying difference between object?pattern and states?pattern. Objects do not take properties after * into account. Can this be corrected?

objectspattern sbjectspattern2 statespattern

thx

rewegit avatar Jan 05 '19 18:01 rewegit

Do you looked into the JSONs? normally "obkect" returns the complete object definition AND the value, state only returns the value (together with the relevant value data like ts, q, ack and such

Apollon77 avatar Jan 05 '19 21:01 Apollon77

I hope I understand you correctly. I just collapsed the objects. Here is an example for an object:

zigbee.0.00158d0001e7bb0f.voltage: {
type: "state",
common: {
name: "Battery voltage",
type: "number",
unit: "V",
read: true,
write: false,
role: "battery.voltage",
icon: "img/battery_v.png",
custom: {
influxdb.0: {
enabled: true,
changesOnly: true,
debounce: "1000",
retention: 0,
changesRelogInterval: 0,
changesMinDelta: 0,
storageType: "Number",
aliasId: "Schlafstube rechts Volt"
}
}
},
from: "system.adapter.zigbee.0",
ts: 1546721648822,
_id: "zigbee.0.00158d0001e7bb0f.voltage",
acl: {
object: 1636,
state: 1636,
owner: "system.user.admin",
ownerGroup: "system.group.administrator"
},
enums: {
enum.functions.Verschluß: "Verschluß",
enum.functions.Batterie betrieben: "Batterie betrieben"
}
},

That's not the problem either. The problem is the wrong pattern selection. I think with the query:

http://192.168.99.119:8087/objects?pattern=zigbee.0.*.battery Should only objects with 'battery' appear as last property, as is the case with 'sates&patter'.

rewegit avatar Jan 05 '19 21:01 rewegit

aahhhhh this was your question ... yes you are right. ned to check that. seems to be a bug

Apollon77 avatar Jan 05 '19 21:01 Apollon77

Rückfrage: Werden deine States in Redis gespeichert?

Apollon77 avatar Jan 05 '19 22:01 Apollon77

Standard installation. Läuft im docker-container ohne Redis. Bis auf das "pattern" Problem kann ich keinerlei Unregelmäßigkeiten entdecken.

rewegit avatar Jan 05 '19 23:01 rewegit

First check seems to be an issue down in js-controler with "getObjectView" but I need to find time to dig into this. Fix would then be in a future js-controller version or adapte rneed to filter additionally :-(

Apollon77 avatar Jan 06 '19 20:01 Apollon77

Ok, thanks for your feedback.

rewegit avatar Jan 06 '19 22:01 rewegit

Because of this: https://github.com/ioBroker/ioBroker.js-controller/blob/master/lib/objects/objectsInMemServer.js#L2744 It will not be possible to fix the issue in js-controller.

But here https://github.com/ioBroker/ioBroker.simple-api/blob/master/lib/simpleapi.js#L910 we can add additional filter:

if (values.pattern && values.pattern.indexOf('*') !== -1 && !values.pattern.match(/\*$/)) {
    // filter out all ids 
}

GermanBluefox avatar Feb 05 '19 13:02 GermanBluefox

still relevant

Apollon77 avatar Jun 10 '20 22:06 Apollon77

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions. Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

stale[bot] avatar Sep 10 '20 03:09 stale[bot]

This issue has been automatically closed because of inactivity. Please open a new issue if still relevant and make sure to include all relevant details, logs and reproduction steps. Thank you for your contributions. Dieses Problem wurde aufgrund von Inaktivität automatisch geschlossen. Bitte öffnet ein neues Issue, falls dies noch relevant ist und stellt sicher das alle relevanten Details, Logs und Reproduktionsschritte enthalten sind. Vielen Dank für Eure Unterstützung.

stale[bot] avatar Sep 17 '20 04:09 stale[bot]