Hey,
first big thanks for your effort and your offer for the Plugin maybe i will come back to it.
But because im a strange guy and i hate “that does not work” … i just do what a no0b dev do Playing around and see whats happend.
So just change every “Device” in the “SyncDevices” funktion with “Variable” as my first plan
I know now this part will create the “Main-Folder” “Devices” / “Variables” and the “folders” for the “Devices / Varaible” it self:
function syncVariables(variables, callback) {
var objs = [];
var _states = [];
for (var d = 0; d < variables.length; d++) {
var localObjects = [];
var variable = variables[d];
adapter.log.debug('Handle Variables: ’ + JSON.stringify(variable));
var obj = {
_id: adapter.namespace + ‘.Variables.’ + variable.id,
common: {
name: variable.name
},
type: ‘channel’
};
objs.push(obj);
And it looks then like that:
then i changed the line “adapter.log.debug('Handle Variables: ’ + JSON.stringify(variable));” to “…log.Info” to get a littlebit more overview over the massiv log from the adapter. Now i know whats in the Variable “variable” its just the json string and all the Infos.
2020-03-04 18:22:29.620 info (3027) Handle Variables: {“name”:“zwave-wohnzimmerpir-temperatur”,“readonly”:false,“type”:“value”,“value”:22.1,“unit”:""}
pimatic.1 2020-03-04 18:22:29.620 info (3027) Handle Variables: {“name”:“zwave-wohnzimmerpir-luminance”,“readonly”:false,“type”:“value”,“value”:0,“unit”:""}
pimatic.1 2020-03-04 18:22:29.620 info (3027) Handle Variables: {“name”:“zwave-wohnzimmerpir-battery”,“readonly”:false,“type”:“value”,“value”:100,“unit”:""}
pimatic.1 2020-03-04 18:22:29.619 info (3027) Handle Variables: {“name”:“zwave-badpir-battery”,“readonly”:false,“type”:“value”,“value”:100,“unit”:""}
pimatic.1 2020-03-04 18:22:29.619 info (3027) Handle Variables: {“name”:“zwave-badpir-temperatur”,“readonly”:false,“type”:“value”,“value”:21.2,“unit”:""}
pimatic.1 2020-03-04 18:22:29.619 info (3027) Handle Variables: {“name”:“zwave-badpir-luminance”,“readonly”:false,“type”:“value”,“value”:0,“unit”:""}
pimatic.1 2020-03-04 18:22:29.619 info (3027) Handle Variables: {“name”:“zwave-flurpir-battery”,“readonly”:false,“type”:“value”,“value”:100,“unit”:""}
But in the moment it will just create one entry and see its “undefined”, but i think that cant be so hard to move on. …