NEWS
Gelöst: Anzahl der Zigbee Geräte ermitteln
Skripten / Logik
22
Beiträge
2
Kommentatoren
1.5k
Aufrufe
1
Watching
-
@michihorn
Versuche es so:const ids = $("tuya.1.*.online"); const idCAS = "0_userdata.0.System.Tuya.CAS_Count"; const idNL = "0_userdata.0.System.Tuya.NL_Count"; let cntCAS = 0; let cntNL = 0; ids.each(function(id) { id = id.substring(0, id.lastIndexOf('.')); const devName = getObject(id).common.name; if(devName.includes('CAS')) cntCAS++; if(devName.includes('NL')) cntNL++; }); setState(idCAS, cntCAS, true); setState(idNL, cntNL, true); log('CAS: ' + cntCAS + ', NL: ' + cntNL); -
@michihorn
Versuche es so:const ids = $("tuya.1.*.online"); const idCAS = "0_userdata.0.System.Tuya.CAS_Count"; const idNL = "0_userdata.0.System.Tuya.NL_Count"; let cntCAS = 0; let cntNL = 0; ids.each(function(id) { id = id.substring(0, id.lastIndexOf('.')); const devName = getObject(id).common.name; if(devName.includes('CAS')) cntCAS++; if(devName.includes('NL')) cntNL++; }); setState(idCAS, cntCAS, true); setState(idNL, cntNL, true); log('CAS: ' + cntCAS + ', NL: ' + cntNL);
