Closed mickym2 closed 2 years ago
So if the iobroker out node does not create a folder object in case of errors the log will contain warnings like this:
`
ode-red.0 | 2021-08-10 22:02:18.991 | warn | This object will not be created in future versions. Please report this to the developer. -- | -- | -- | -- node-red.0 | 2021-08-10 22:02:18.992 | warn | This object will not be created in future versions. Please report this to the developer. node-red.0 | 2021-08-10 22:02:18.990 | warn | Object 0_userdata.0.controll-own.0.logic.states.fensterOffen is invalid: obj.common.type has an invalid value (undefined) but has to be one of number, string, boolean, array, object, mixed, file, json node-red.0 | 2021-08-10 22:02:18.990 | warn | Object 0_userdata.0.controll-own.0.logic.states.fensterOffen.wohnzimmer is invalid: obj.common.type has an invalid value (undefined) but has to be one of number, string, boolean, array, object, mixed, file, json node-red.0 | 2021-08-10 22:02:18.991 | warn | Object 0_userdata.0.controll-own.0.logic.states.fensterOffen.schlafzimmer is invalid: obj.common.type has an invalid value (undefined) but has to be one of number, string, boolean, array, object, mixed, file, json node-red.0 | 2021-08-10 22:02:18.991 | warn | Object 0_userdata.0.controll-own.0.logic.states.fensterOffen.buero is invalid: obj.common.type has an invalid value (undefined) but has to be one of number, string, boolean, array, object, mixed, file, json node-red.0 | 2021-08-10 22:02:18.990 | warn | This object will not be created in future versions. Please report this to the developer. node-red.0 | 2021-08-10 22:02:18.989 | warn | This object will not be created in future versions. Please report this to the developer. node-red.0 | 2021-08-10 22:02:18.989 | warn | This object will not be created in future versions. Please report this to the developer. node-red.0 | 2021-08-10 22:02:18.990 | warn | This object will not be created in future versions. Please report this to the developer. node-red.0 | 2021-08-10 22:02:18.988 | warn | Object 0_userdata.0.controll-own.0.logic.alarm.battery is invalid: obj.common.type has an invalid value (undefined) but has to be one of number, string, boolean, array, object, mixed, file, json `Perhaps it is possible that the iobroker system (or JS) creates automatically folder objects, if object type is undefined.
These errors do not come from missing folder objects. It is more that the relevant real objects do not have a type ... question is now if we should derive the type from the value (which might be problematic iv datatype changes) or if we better should use "mixed"
OK - I was able to copy a tree, when iobroker out is configured to write "writeable" objects and with ACK-Flag without warnings and errors in the log. However the main problem is still the problem that folder objects have to be created or iobroker out creates no folder objects for each hierachy level. See the following screenshot with the source and the target tree created reading the objects with the objects list node and the iobroker out node
source = mqtt.1.*
target = 0_userdata.0.testcopy
So even if the source has folder objects now - writing to the target path does not create folder objects on each level.
All ok, but the error slisted in first post and the "create folder objects where missing" are two separate topics and so should be two issues? ;-))
I don't think so. As the iobroker out normally write states the problem are the missing folder objects in an id (as path), specified in msg.topic. The same happens if I specify an id for a state in admin. So if folder objects would be created automatically by the system, it wouldn't be necessary that the iobroker out node creates explicitely objects or folders.
@mickym2 WHaat do you think, should the node automatically create the folder objects or should it be configurable?
In my opinion it needs not to be configurable as in long term i guess it is intended to have on each hierarchy level an object and not how it is the case now. If a user doesn't want to create non existing states - this option is already available. For point of view of NodeRed it should be completely transparent.
The folder objects should be created automatically but should have the lowest priority. Means if later a state, device or channel object should be written with the iobroker out node to an existing folder object, this can be replaced by any other object type. As mentioned in the threads discussion - I would also think that it would be no problem if you restrict the NodeRed Adapter to create objects under only under 0_userdata - but must not follow rules as it would be necessary for other adapter name spaces.
Please check Github
There is no difference - no folder object was created in the new tree.
If I create manually a folder object and tried to write a state to the original folder object with the iobroker out node - this does not work and I got the following error in the log:
Hm ... ok ... warte ... aktuell wurdd es nur gemacht wenn ein neues Objekt angelegt wurde ... GitHub ist aktualisiert ... dann wirds immer geprüft. Am bersten vor restart debug log einschalten , dann sollte man es auch sehen
Hmm - ich sehe zwar das an einer anderen Stelle, wohl ein fehlendes Objekt erstellt wurde
2022-03-11 13:48:13.443 - debug: node-red.0 (23978) Create folder object for 0_userdata.0.stromverbrauch
2022-03-11 13:48:13.465 - debug: node-red.0 (23978) Create folder object for 0_userdata.0.dimmer
2022-03-11 13:48:13.468 - debug: node-red.0 (23978) Create folder object for 0_userdata.0.stromverbrauch.shellies
2022-03-11 13:48:13.757 - debug: node-red.0 (23978) Create folder object for 0_userdata.0.stromverbrauch.shellies.shellyplug-s-01E405_0
Aber der Großteil bei den Neuanlagen wird nur der state erstellt. NR Debug Log.txt
Ich hab das Log hier mal angehängt - da es wenn man den Text hier reinkopiert auch in CodeTags komisch aussieht.
Auch beim Beschreiben eines vorhandenen States ....
... funktioniert das - aber die Objekte darüber werden nicht angelegt.
Hm ... ok, hab mal was umgebaut ... kannst bitte nochmal versuchen? und bitte wieder debug log
Leider keine Veränderung. iobroker.current.log
Wtf .. ;-)I added debug ... Hoffentlich wissen wir danach mehr ... nochmal debug bitte
OK hab jetzt mal alles drin gelassen: 2022-03-11 15:50:48.253 - Start Installation 2022-03-11 15:51:52.980 - Alles OK durchgelaufen
danach Adapter Neustart
Klick im Admin mal reload bitte ... laut ihm sind die objekte da :-))
Ich hab nochmal was optimizert das nicht zuvieles mehrfach versucht wird ... von daher bitte nochmal checken ...oder mal baum "Löschen" und ganz neu anlegen lassen. Noch ein letztes Debug log wäre cool
Es tut mir leid - auch wenn das Log was anderes behauptet. Die Objekte sind nicht da!!!
Habe Browsercache gelöscht, alten Objektbaum gelöscht, Browser zu und auf. An dem liegt es nicht. CurrentLog.txt
Also das letzte Log zeigt das node-red nicht neu gestartet ist nach dem GitHub update! ... scheinbar wurde nur der Flow neu laufen gelassen? Kannste bitte mal adapter restarten?
Selbes Bild wie vorher - keine Objekte vorhanden. CurrentLog.txt
Adapterneustart: 2022-03-11 19:55:19.734
Also jetzt blicke ich nix mehr
Mach mal bitte an einer Shell:
iob object get 0_userdata.0.mwReImport.mqtt.1.zigbee2mqtt.temperatur.kueche
`pi@MWHome:~ $ iob object get 0_userdata.0.mwReImport.mqtt.1.zigbee2mqtt.temperatur.kueche
The object 0_userdata.0.mwReImport.mqtt.1.zigbee2mqtt.temperatur.kueche was not found!`
Hier kann man das schlechter als im Forum lesen deshalb nochmal der Screenshot
Bei einem existieren Objekt - also State - bekomme ich dann auf der Kommandozeile den JSON String, der die Objektdefinition enthält.
Please another github update ... think found the issue ... make sure it restarts please
Perfect - 100% done. :) -
Auch das nachträgliche Umwandeln eines Folder Objektes in einen State funktioniert wieder. Klasse!!!
Auch die Folder Objekte wurden von der list Node ausgefiltert!
Fine! Excellent! 1000 Thanks!
Released in 3.0.0
Currently an hierachie is created for non existing objects, if I specify a msg.topic in iobroker.out node. The interim hierachies were correctly shown in admin 4 as folders if there are child objects. As admin 4 didn't check if an hierarchy level is represented by an object - it was always possible to create any object type on any hierarchy level.
With admin 5 you cannot create any child objects - as you have to create all parent objects manually. So it would be useful that all hierachies which are created by an iobroker out node, should be explicitely creates as folder objects.