text: var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var c=0;return function(){return c<a.length?{done:!1,value:a[c++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
  $jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,d){a!=Array.prototype&&a!=Object.prototype&&(a[c]=d.value)};$jscomp.getGlobal=function(a){a=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,a];for(var c=0;c<a.length;++c){var d=a[c];if(d&&d.Math==Math)return d}return globalThis};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
  $jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.SymbolClass=function(a,c){this.$jscomp$symbol$id_=a;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:c})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};
  $jscomp.Symbol=function(){function a(d){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(d||"")+"_"+c++,d)}var c=0;return a}();
  $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
  $jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.asyncIterator;a||(a=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("Symbol.asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};
  $jscomp.iteratorFromArray=function(a,c){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var d=0,b={next:function(){if(d<a.length){var e=d++;return{value:c(e,a[e]),done:!1}}b.next=function(){return{done:!0,value:void 0}};return b.next()}};b[Symbol.iterator]=function(){return b};return b};
  $jscomp.polyfill=function(a,c,d,b){if(c){d=$jscomp.global;a=a.split(".");for(b=0;b<a.length-1;b++){var e=a[b];e in d||(d[e]={});d=d[e]}a=a[a.length-1];b=d[a];c=c(b);c!=b&&null!=c&&$jscomp.defineProperty(d,a,{configurable:!0,writable:!0,value:c})}};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a){return a})}},"es6","es3");var xnm=xnm||{};xnm.aio=xnm.aio||{};xnm.aio.hm=xnm.aio.hm||{};
  xnm.aio.hm.Util=function(){var a={"&amp;":"&","&quot;":'"',"&lt;":"<","&gt;":">"};return{formatFloatString:function(a){return"undefined"==typeof a||null==a||""==a?"?":parseFloat(a).toFixed(1)},decodeXml:function(c){return c.replace(/(&quot;|&lt;|&gt;|&amp;)/g,function(c,b){return a[b]})}}}();
  xnm.aio.hm.MHMCCU=function(a,c,d,b,e,f,h,g){var l=require("x.logger.js");this._logger=l?l.getLogger("xnm.aio.hm.MHMCCU"):{log:function(){}};this.type=f?f:1;this.ip=a;this.port=d?d:80;this.username=h;this.password=c;this.tclport=b?b:8181;this.uuid=e;this.cloudmatic=g;this._cloudmaticState="off";this._statebuffer={}};xnm.aio.hm.MHMCCU._cloneJSONObj=function(a){a=JSON.stringify(a);return a=JSON.parse(a)};
  xnm.aio.hm.MHMCCU.prototype={executeCommand:function(a,c,d){if(a)if(c){var b=null,e=1,f=a.type,h={type:a.type,address:a.address,"interface":a["interface"],channels:{}},g=a.address.indexOf(":");0<g&&(e=a.address.substr(g+1),h.address=a.address.substr(0,g));h["interface"]||(h["interface"]=a.data);"on"==c?"DIMMER"==a.type&&(c="dimRaw",b=100):"off"==c?"DIMMER"==a.type&&(c="dimRaw",b=0):"toggle"!=c&&(0==c.indexOf("dimTo")&&(c=c.replace(/dimTo/g,"")),0==c.indexOf("moveTo")&&(c=c.replace(/moveTo/g,"")),
  b=c=c.replace(/%/g,""),"DIMMER"==a.type?c="dimRaw":"FHT80b"==a.subtype&&(c="themoRTempRaw",e=2,f="CLIMATECONTROL_REGULATOR"));XC.debugf(h);c={value:c,ext:b};switch(a.type){case xnm.aio.hm.DM.SYSVAR:this.executeCommandCreator(a,c,d);break;case xnm.aio.hm.DM.PROG:this.executeCommandCreator(a,c,d);break;default:h.channels[f]={address:e},this.executeCommandCreator(h,c,d)}}else d&&d(Error("command invalid"));else d&&d(Error("device invalid"))},executeCCUCommand:function(a,c){if(a){var d=null;"cloudmaticOn"==
  a.value?this._cloudmaticState="on":"cloudmaticOff"==a.value?this._cloudmaticState="off":"cloudmaticToggle"==a.value?this._cloudmaticState="on"==this._cloudmaticState?"off":"on":d=Error("unknown command");c&&c(d)}else c&&c(Error("command invalid"))},getStates:function(a,c,d){if(c&&0!=c.length){for(var b=[],e=0;e<c.length;e++){var f=c[e];switch(f.type){case xnm.aio.hm.DM.SYSVAR:b.push(c[e]);break;case xnm.aio.hm.DM.PROG:break;default:var h=f.channelAddress,g=f.channelName,l={type:f.type,address:f.address,
  "interface":f["interface"],channels:{}},k=f.address.indexOf(":");0<k&&(h=f.address.substr(k+1),l.address=f.address.substr(0,k));l["interface"]||(l["interface"]=f.data);g||(g=f.type);"SWITCH"==f.type?(l.channels.SWITCH={address:1},b.push({id:f.id,device:l,status:{value:"switchState"}}),"meteringSwitch"==f.subtype&&(l.channels.POWERMETER={address:2},b.push({id:f.id+":current",device:l,status:{value:"meterPower"}}))):"FHT80b"==f.subtype?(l.channels.WEATHER={address:1},l.channels.CLIMATECONTROL_REGULATOR=
  {address:2},b.push({id:f.id+":C",device:l,status:{value:"weatherTemp"}}),b.push({id:f.id+":T",device:l,status:{value:"themoRSetTemp"}}),b.push({id:f.id+":M",device:l,status:{value:"themoRMode"}})):(l.channels[g]={address:h},"DIMMER"==f.type&&b.push({id:f.id,device:l,status:{value:"dimmerLevel"}}))}}this.getStatesCreator(a,b,d)}else d&&d(null,{})},executeCommandCreator:function(a,c,d){var b=this,e=function(a,b,c,d){this.device=a;this.command=b;this.channel=c;this.callback=d};e.prototype.execute=function(c,
  d){var e=this;if(c)this.callback&&this.callback(c);else{if("CUxD"==a["interface"])var f=xnm.aio.hm.CUxDChannel[this.channel];else"HmIP-RF"==a["interface"]||"HmIP-HEATING"==a.type?f=xnm.aio.hm.HmIPChannel[k]:"HM-Sec-Sir-WM"!=a.type||"SWITCH_SENSOR_1"!=k&&"SWITCH_SENSOR_2"!=k||(f=xnm.aio.hm.Channel.SWITCH_SENSOR);f||(f=xnm.aio.hm.Channel[this.channel]);f.handleCommandResponse?f.handleCommandResponse(b,this.device,this.command,d,function(){setTimeout(function(){e.callback&&e.callback()},500)}):setTimeout(function(){e.callback&&
  e.callback()},500)}};if(!a||a.ip)this.executeCCUCommand(c,d);else if(c){var f=null;switch(a.type){case xnm.aio.hm.DM.SYSVAR:if(!a["class"]||!xnm.aio.hm.SysVar[a["class"].toUpperCase()]){d&&d(Error("device class invalid"));break}if(!xnm.aio.hm.SysVar[a["class"].toUpperCase()].buildCommandScript){d&&d(Error("do not support command"));break}f=xnm.aio.hm.SysVar[a["class"].toUpperCase()].buildCommandScript(this,a,c);if(!f){d&&d(Error("command is invalid"));break}this._doRequest(f,!0,function(a){d&&d(a)});
  break;case xnm.aio.hm.DM.PROG:f=xnm.aio.hm.Prog.buildCommandScript(this,a,c);if(!f){d&&d(Error("command is invalid"));break}this._doRequest(f,!0,function(a){d&&d(a)});break;default:if(a&&"BidCos-RF"==a["interface"]&&a.type&&xnm.aio.hm.BidCosDevice[a.type]){var h=xnm.aio.hm.BidCosDevice[a.type];if(h.executeCommand){h.executeCommand(this,a,c,d);break}}if(a&&"HmIP-RF"==a["interface"]&&(h=xnm.aio.hm.HmIPDevice.resolveJSON(a))&&h.executeCommand){h.executeCommand(this,a,c,d);break}if(a&&"VirtualDevices"==
  a["interface"]&&a.type&&xnm.aio.hm.VirtualDevice[a.type]&&(h=xnm.aio.hm.VirtualDevice[a.type])&&(h=new h,h.executeCommand)){h.executeCommand(this,a,c,d);break}if(a.channels)if(f=null,"DimmerKey"==a.type)f=xnm.aio.hm.DimmerKey,(f=f.buildCommandScript(this,a,c))?this._doRequestMarked(f,!0,{execute:function(a){setTimeout(function(){d&&d(a)},3E3)}}):d&&d(Error("no correspondent channel for the command is found"));else{var g=a.channels,l=h=!1,k;for(k in g)if(g.hasOwnProperty(k)&&(f=null,"CUxD"==a["interface"]?
  f=xnm.aio.hm.CUxDChannel[k]:"HmIP-RF"==a["interface"]||"HmIP-HEATING"==a.type?f=xnm.aio.hm.HmIPChannel[k]:"HM-Sec-Sir-WM"!=a.type||"SWITCH_SENSOR_1"!=k&&"SWITCH_SENSOR_2"!=k||(f=xnm.aio.hm.Channel.SWITCH_SENSOR),f||(f=xnm.aio.hm.Channel[k]),f&&(h=!0,f.buildCommandScript&&(f=f.buildCommandScript(this,a,a.channels[k],c))))){l=!0;c=new e(a,c,k,d);this._doRequestMarked(f,!0,c);break}h?l||d&&d(Error("no correspondent channel for the command is found")):d&&d(Error("no correspondent channel is found"))}else d&&
  d(Error("device channels invalid"))}}else d&&d(Error("command invalid"))},buildScript:function(a){for(var c='var o;string states="";',d=0;d<a.length;d++){var b=a[d];c+='states = states # "'+d+'=";';c+=b.script;d<a.length-1&&(c+='states = states # "\\r@@@\\n";')}return c},resolveStateResponse:function(a,c,d){var b=[];if(d)for(var e=0;e<d.length;e++){var f=d[e];b.push({id:f.alias,status:f.state})}for(d=0;d<a.length;d++){f=a[d];e=f.alias;var h=f.channel;if(f.device){var g=f.device;switch(g.type){case xnm.aio.hm.DM.SYSVAR:if(!g["class"]||
  !xnm.aio.hm.SysVar[g["class"].toUpperCase()]){b.push({id:e,status:"?"});continue}f=xnm.aio.hm.SysVar[g["class"].toUpperCase()].handleStatusResponse(c[d],f.status);b.push({id:e,status:f});break;case xnm.aio.hm.DM.PROG:b.push({id:e,status:"?"});break;default:if(g&&"BidCos-RF"==g["interface"]&&g.type&&xnm.aio.hm.BidCosDevice[g.type]){var l=xnm.aio.hm.BidCosDevice[g.type];if(l.handleStatusResponse){f=l.handleStatusResponse(c[d],f.status);b.push({id:e,status:f});continue}}if(g&&"HmIP-RF"==g["interface"]&&
  (l=xnm.aio.hm.HmIPDevice.resolveJSON(g))&&l.handleStatusResponse){f=l.handleStatusResponse(c[d],f.status,this);b.push({id:e,status:f});continue}if(g&&"VirtualDevices"==g["interface"]&&g.type&&xnm.aio.hm.VirtualDevice[g.type]&&(l=xnm.aio.hm.VirtualDevice[g.type])&&(l=new l,l.handleStatusResponse)){f=l.handleStatusResponse(c[d],f.status);b.push({id:e,status:f});continue}l=null;"CUxD"==g["interface"]?l=xnm.aio.hm.CUxDChannel[h]:"HmIP-RF"==g["interface"]||"HmIP-HEATING"==g.type?l=xnm.aio.hm.HmIPChannel[h]:
  "HM-Sec-Sir-WM"!=g.type||"SWITCH_SENSOR_1"!=h&&"SWITCH_SENSOR_2"!=h?"HM-WDS30-OT2-SM-2"!=g.type||"WEATHER_1"!=h&&"WEATHER_2"!=h&&"WEATHER_3"!=h&&"WEATHER_4"!=h||(l=xnm.aio.hm.Channel.WEATHER):l=xnm.aio.hm.Channel.SWITCH_SENSOR;l||(l=xnm.aio.hm.Channel[h]);l?l.handleStatusResponse?(f=l.handleStatusResponse(c[d],f.status),b.push({id:e,status:f})):b.push({id:e,status:c[e]}):b.push({id:e,status:"?"})}}else b.push({id:e,status:"?"})}return b},resolveState:function(a,c,d){if(!(a&&a.channels&&c&&c.channel&&
  c.datapoint&&c["interface"]))return null;var b=c.channel.indexOf(":");if(-1==b)return null;if(a&&"BidCos-RF"==a["interface"]&&a.type){var e=xnm.aio.hm.BidCosDevice[a.type];if(e&&e.resolveState)return e.resolveState(a,c,d)}if(a&&"HmIP-RF"==a["interface"]&&a.type&&(e=xnm.aio.hm.HmIPDevice.resolveJSON(a))&&e.resolveState)return e.resolveState(a,c,d);b=c.channel.substr(b+1);var f;for(f in a.channels)if(a.channels.hasOwnProperty(f)&&a.channels[f].address==b){var h=f;"HM-Sec-Sir-WM"!=a.type||"SWITCH_SENSOR_1"!=
  h&&"SWITCH_SENSOR_2"!=h?"HM-WDS30-OT2-SM-2"!=a.type||"WEATHER_1"!=h&&"WEATHER_2"!=h&&"WEATHER_3"!=h&&"WEATHER_4"!=h||(h="WEATHER"):h="SWITCH_SENSOR";break}if(!h)return null;var g;"BidCos-RF"==c["interface"]||"BidCos-Wired"==c["interface"]?g=xnm.aio.hm.Channel[h]:"HmIP-RF"==c["interface"]&&(g=xnm.aio.hm.HmIPChannel[h]);return g&&g.resolveState?g.resolveState(a,c,d):null},resolveDatapointInfo:function(a,c,d){if(!(a&&a["interface"]&&a.type&&a.address&&c)||"SysVar"==a.type||"Prog"==a.type)return null;
  if("BidCos-RF"==a["interface"]||"BidCos-Wired"==a["interface"]){var b=xnm.aio.hm.DM._getChannels(a);var e=xnm.aio.hm.MAP}else if("HmIP-RF"==a["interface"])b=xnm.aio.hm.DM._getHmIPChannels(a),e=xnm.aio.hm.HMIP_MAP;else if("CUxD"==a["interface"])b=xnm.aio.hm.DM._getCUxDChannels(a),e=xnm.aio.hm.CUxDMAP;else return null;var f=null,h=null,g=null,l;for(l in b){var k=b[l],n=e[l];if(n){for(var q in k)if(k=n[q]){if(k=d?k.command:k.status)for(var p=0;p<k.length;p++)if(k[p].ref.value==c){h=q;break}if(h)break}if(h){f=
  l;break}}}if(!f||!h)return null;for(l in a.channels)if(l==f){c=a.address;d=c.indexOf(":");-1!=d&&(c=c.substr(0,d));g=c+":"+a.channels[l].address;break}return g?{"interface":a["interface"],channel:g,channelType:f,datapoint:h}:null},getStatesCreator:function(a,c,d){for(var b=[],e=[],f=null,h=this,g=[],l=[],k=[],n=0;n<c.length;n++){var q=c[n],p=q.id,t=q.status,r=q.device;if(p&&r&&t)if(!r.type&&r.ip)"serviceMsg"==t.value?g.push(q):"ccuTime"==t.value?l.push(q):"cloudmaticState"==t.value&&k.push(q);else switch(r.type){case xnm.aio.hm.DM.SYSVAR:if(!r["class"]||
  !xnm.aio.hm.SysVar[r["class"].toUpperCase()])continue;(f=xnm.aio.hm.SysVar[r["class"].toUpperCase()].buildStateScript(this,r,t))&&b.push({alias:p,script:f,device:r,status:t});break;case xnm.aio.hm.DM.PROG:continue;default:if(r&&"BidCos-RF"==r["interface"]&&r.type&&xnm.aio.hm.BidCosDevice[r.type]){var w=xnm.aio.hm.BidCosDevice[r.type];if(w.buildStateScript&&(f=w.buildStateScript(this,r,t))){b.push({alias:p,script:f,device:r,channel:null,status:t});break}}if(r&&"HmIP-RF"==r["interface"]){if((w=xnm.aio.hm.HmIPDevice.resolveJSON(r))&&
  w.getBufferedState&&(q=w.getBufferedState(this,r,t),null!=q&&"undefined"!=typeof q)){e.push({alias:p,state:q});break}if(w&&w.buildStateScript&&(f=w.buildStateScript(this,r,t))){b.push({alias:p,script:f,device:r,channel:null,status:t});break}}if(r&&"VirtualDevices"==r["interface"]&&r.type&&(q=xnm.aio.hm.VirtualDevice[r.type])&&(q=new q,q.buildStateScript&&(f=q.buildStateScript(this,r,t)))){b.push({alias:p,script:f,device:r,channel:null,status:t});break}if(r.channels){w=r.channels;for(var u in w)if(w.hasOwnProperty(u)){var m=
  null;"CUxD"==r["interface"]?m=xnm.aio.hm.CUxDChannel[u]:"HmIP-RF"==r["interface"]||"HmIP-HEATING"==r.type?m=xnm.aio.hm.HmIPChannel[u]:"HM-Sec-Sir-WM"!=r.type||"SWITCH_SENSOR_1"!=u&&"SWITCH_SENSOR_2"!=u?"HM-WDS30-OT2-SM-2"!=r.type||"WEATHER_1"!=u&&"WEATHER_2"!=u&&"WEATHER_3"!=u&&"WEATHER_4"!=u||(m=xnm.aio.hm.Channel.WEATHER):m=xnm.aio.hm.Channel.SWITCH_SENSOR;m||(m=xnm.aio.hm.Channel[u]);if(m&&m.getBufferedState&&(q=m.getBufferedState(this._statebuffer,r,r.channels[u],t),null!=q&&"undefined"!=typeof q)){e.push({alias:p,
  state:q});break}if(m&&m.buildStateScript&&(f=m.buildStateScript(this,r,r.channels[u],t))){b.push({alias:p,script:f,device:r,channel:u,status:t});break}}}}}this.getCloudmaticStatus(a,k,function(c,k){"undefined"!=typeof a&&null!=a&&"undefined"!=typeof a.reportStates&&null!=a.reportStates&&!c&&k&&0<k.length&&a.reportStates(null,k);h.getServiceMessageStatus(a,g,function(c,g){h.getCCUStatus(a,l,function(a,c){0===b.length?(a=h.resolveStateResponse([],[],e),c&&(a=a?a.concat(c):c),g&&(a=a?a.concat(g):g),
  k&&(a=a?a.concat(k):k),d&&d(null,a||[])):(f=h.buildScript(b),h._doRequest(f,!0,function(a,f){var l=null;if(a)d&&d(a);else{a=f.indexOf("<states>");var m=f.lastIndexOf("</states");if(m>a+8)try{l=f.substring(a+8,m);l=xnm.aio.hm.Util.decodeXml(l);var n=l.split("\r@@@\n");l={};for(f=0;f<n.length;f++){var v=n[f].indexOf("=");if(0<v){var x=n[f].substr(0,v);l[x]=n[f].substr(v+1)}}l=h.resolveStateResponse(b,l,e);c&&(l=l?l.concat(c):c);g&&(l=l?l.concat(g):g);k&&(l=l?l.concat(k):k);d&&d(null,l)}catch(J){d&&
  d(Error("response format error"))}else d&&d(Error("response format error"))}}))})})})},getDeviceList:function(a){this._logger.log("debug","get device list from ccu:"+this.ip);var c=this;this._getDevices(function(d,b){d?a&&a(d):c._getSysvars(function(d,f){d?a&&a(d):c._getProgs(function(d,e){if(d)a&&a(d);else{d={devices:[],sysvars:[],progs:[]};var g,h;b&&b.devices&&(g=c._parseDevices(b.devices))&&0<g.length&&(d.devices=d.devices.concat(g));if(f&&f.systemvars){var n=f.systemvars;for(h in n)if(n.hasOwnProperty(h)){a:{var q=
  f.systemvars[h],p=h;if(q.valuetype){switch(q.valuetype){case "2":g="binary";break;case "4":g="float";break;case "16":g="integer";break;case "20":g="string";break;default:g=null;break a}var t={};t.sys=xnm.aio.hm.DM.SYS;t.id=q.name;t.type=xnm.aio.hm.DM.SYSVAR;t.address=p;t["class"]=g;g=t}else g=null}g&&d.sysvars.push(g)}}if(e&&e.progs)for(h in n=e.progs,n)n.hasOwnProperty(h)&&(g=e.progs[h],q=h,g.name?(p={},p.sys=xnm.aio.hm.DM.SYS,p.id=g.name,p.address=q,p.type=xnm.aio.hm.DM.PROG,g=p):g=null,g&&d.progs.push(g));
  a(null,d)}})})})},_getDevices:function(a){this._logger.log("debug","list devices from ccu:"+this.ip);var c=this;this._doRequest(xnm.aio.hm.MHMCCU._SCRIPT_GET_DEVICES,!0,function(d,b){d?(c._logger.log("debug","list hm devices error:"+d.stack),a&&a(d)):(c._logger.log("debug",b),d=c._xml2json(b),a(null,d))},24E4)},_getSysvars:function(a){this._logger.log("debug","list variables from ccu:"+this.ip);var c=this;this._doRequest(xnm.aio.hm.MHMCCU._SCRIPT_GET_SYSVARS,!0,function(d,b){d?(c._logger.log("debug",
  "list variables error:"+d.stack),a&&a(d)):(c._logger.log("debug",b),d=c._xml2json(b),a(null,d))},24E4)},_getProgs:function(a){this._logger.log("debug","list programs from ccu:"+this.ip);var c=this;this._doRequest(xnm.aio.hm.MHMCCU._SCRIPT_GET_PROGS,!0,function(d,b){d?(c._logger.log("debug","list programs error:"+d.stack),a&&a(d)):(c._logger.log("debug",b),d=c._xml2json(b),a(null,d))},24E4)},_xml2json:function(a){if(!a)return null;var c=a.indexOf("<res>"),d=a.lastIndexOf("</res>");if(d<=c+5)return null;
  try{var b=a.substring(c+5,d);b=xnm.aio.hm.Util.decodeXml(b);b=this._processJsonStr(b);return JSON.parse(b)}catch(e){return null}},_processJsonStr:function(a){var c=a.split("#[");if(1==c.length)return a;for(a=1;a<c.length;a++){var d=c[a].indexOf("]#");if(-1!=d){var b=c[a].substr(0,d);b=JSON.stringify(b);c[a]=c[a].substr(d+2);c[a]=b+c[a]}}c=c.join("");return c=c.replace(/,(?!\s*?[\{\["'\w])/g,"")},_parseDevices:function(a){var c,d=[],b;for(b in a)a.hasOwnProperty(b)&&(c=this._parseDevice(a[b]))&&0<
  c.length&&(d=d.concat(c));return d},_parseDevice:function(a){var c="HM-LC-Sw1-Ba-PCB HM-LC-Sw4-Ba-PCB HM-Sen-LI-O HM-Sec-SD HM-Sec-SD-Generic HM-Sec-Key HM-Sec-SCo HM-Sec-MDIR HM-Sen-MDIR-O HM-WDS40-TH-I HM-WDS40-TH-I-2 HM-WDS10-TH-O HM-WDS100-C6-O-2 HM-WDS100-C6-O HM-PB-6-WM55 HM-PB-2-WM55 HM-PB-4Dis-WM HM-SwI-3-FM HM-SCI-3-FM HM-PBI-4-FM HM-Sec-MDIR-2 HM-PB-2-WM55-2 HM-PB-2-FM HM-OU-CFM-TW".split(" "),d=function(a){return"WRAPPER"==a?!1:!xnm.aio.hm.CHANNEL[a]||"VIRTUAL_DIMMER"==a},b=function(a,
  b){if("CUxD"==a["interface"])if("WEATHER"==b.hsstype){if(a=b.datapoints)a:{b=b.datapoints;for(a=0;a<b.length;a++)if("BRIGHTNESS_WEST"==b[a]){a=!0;break a}a=!1}if(a)return"ENOCEAN_WEATHER2"}else if("SENSOR"==b.hsstype){if(a.channels.WEATHER&&a.channels.CLIMATECONTROL_REGULATOR&&a.channels.SWITCH)return"ENOCEAN_SENSOR_ERROR"}else if("SWITCH"==b.hsstype&&a.channels.SWITCH&&a.channels.POWERMETER)return"ENOCEAN_Bidi_Switch2";return null},e=function(a){var b=[],d=a.channels,e;for(e in d)if(d.hasOwnProperty(e)){var f=
  a.channels[e];if(f.address){var g=f.address.indexOf(":");if(-1!==g){var h=f.address.substring(g+1);(0!=h||-1!=c.indexOf(a.hsstype))&&f.hsstype&&xnm.aio.hm.CHANNEL[f.hsstype]&&(g={},g.sys=xnm.aio.hm.DM.SYS,g.id=f.name?f.name:a.name,g.type=a.hsstype,g.address=f.address,g.rfAddr=a.rfAddr,g["interface"]=a["interface"],g.channels={},g.channels[f.hsstype]={id:f.name,address:h,room:f.room,group:f.func,datapoints:[]},b.push(g))}}}return b};if(!a.channels||!a["interface"])return null;if("VirtualDevices"==
  a["interface"]&&xnm.aio.hm.VirtualDevice)return xnm.aio.hm.VirtualDevice.parseDevice(a);if("HmIP-RF"==a["interface"])return xnm.aio.hm.HmIPDevice.parseDevice(a);var f=[];if("BidCos-RF"==a["interface"]){if(f=xnm.aio.hm.BidCosDevice.parseDevice(a))return f;f=[]}var h=function(a){var b=a.channels;if(!b)return 0;var c=0,e=0,f={},g;for(g in b)if(b.hasOwnProperty(g)){var h=a.channels[g];if(h.address){var l=h.address.indexOf(":");-1!==l&&0!=h.address.substring(l+1)&&h.hsstype&&!d(h.hsstype)&&(c+=1,f[h.hsstype]=
  !0)}}if(0==c)return 0;for(var k in f)f.hasOwnProperty(k)&&(e+=1);return c>e?c:1}(a);if(0==h)return null;if(1<h&&"CUxD"!=a.interface)return e(a);h={};h.sys=xnm.aio.hm.DM.SYS;h.id=a.name;h.type=a.hsstype;h.address=a.address;h.rfAddr=a.rfAddr;h["interface"]=a["interface"];h.channels={};var g=a.channels,l=!1,k;for(k in g)if(g.hasOwnProperty(k)&&(e=a.channels[k],e.address)){var n=e.address.indexOf(":");if(-1!==n&&(n=e.address.substring(n+1),(0!=n||-1!=c.indexOf(a.hsstype))&&e.hsstype)){if("CUxD"==h["interface"]){if(!xnm.aio.hm.CUxDCHANNEL[e.hsstype]&&
  !xnm.aio.hm.CHANNEL[e.hsstype])continue}else if(d(e.hsstype))continue;if(h.channels[e.hsstype]){var q=h.channels[e.hsstype];l=q.id;q=q.address;var p=b(h,e);p?e.hsstype=p:(-1==h.address.indexOf(":")&&1==Object.keys(h.channels).length&&(h.address=h.address+":"+h.channels[e.hsstype].address),"CUxD"==h["interface"]&&(p=xnm.aio.hm.MHMCCU._resolveCUxDType(h))&&(h.cuxd=p),h.id=l?l:q,f.push(h),h={},h.sys=xnm.aio.hm.DM.SYS,h.id=a.name,h.type=a.hsstype,h.address=a.address+":"+n,h["interface"]=a["interface"],
  h.channels={})}l=!0;n={id:e.name,address:n,room:e.room,group:e.func,datapoints:[]};var t;q=n.datapoints;if("CUxD"==h["interface"])n.datapoints=e.datapoints;else for(t in e.datapoints)e.datapoints.hasOwnProperty(t)&&(p=e.datapoints[t],p={name:p.name,valuetype:p.valuetype,operations:p.operations},q.push(p));h.channels[e.hsstype]=n}}l&&f.push(h);"CUxD"==h["interface"]&&(p=xnm.aio.hm.MHMCCU._resolveCUxDType(h))&&(h.cuxd=p);return f},getCloudmaticStatus:function(a,c,d){if(!c||0>=c.length)d&&d(null,[]);
  else{a=[];for(var b=0;b<c.length;b++){var e=c[b];if(e){var f=e.id;e=e.status;if(f&&e)switch(e.value){case "cloudmaticState":a.push({id:f,status:this._cloudmaticState})}}}d(null,a)}},getCCUStatus:function(a,c,d){!c||0>=c.length?d&&d(null,[]):(this._logger.log("debug","get ccu states:"+this.ip),this._doRequest('var ccutime=system.Date("%H:%M:%S").ToString();',!0,function(a,e){if(a)d&&d(a);else{if(!e)return null;a=[];var b=e.indexOf("<ccutime>"),h=e.lastIndexOf("</ccutime>");if(h<=b+9)return null;e=
  e.substring(b+9,h);e=xnm.aio.hm.Util.decodeXml(e);for(b=0;b<c.length;b++){var g=c[b];if(g&&(h=g.id,g=g.status,h&&g))switch(g.value){case "ccuTime":a.push({id:h,status:e})}}d&&d(null,a)}}))},getServiceMessageStatus:function(a,c,d){!c||0>=c.length?d&&d(null,[]):this.getServiceMessage(function(a,e){if(a)d&&d(a);else if(e){a="";for(var b=[],h=0;h<e.length;h++)if(e[h].name&&e[h].error){switch(e[h].error){case "LOWBAT":var g="low battery";break;case "UNREACH":g="communication is interrupted";break;case "STICKY_UNREACH":g=
  "communication was interrupted";break;case "FAULT_REPORTING":g="reporing failure";break;case "ERROR":g="failure";break;default:g=e[h].error}a+=e[h].name+": "+g+"\n"}for(e=0;e<c.length;e++)if(g=c[e])if(h=g.id,g=g.status,h&&g)switch(g.value){case "serviceMsg":b.push({id:h,status:a})}d(null,b)}else d&&d(null,[])})},getServiceMessage:function(a){this._doRequest(xnm.aio.hm.MHMCCU._SCRIPT_GET_SEVICE_MESSAGE,!0,function(c,d){if(c)a&&a(c);else{if(d){c=d.indexOf("<res>");var b=d.lastIndexOf("</res>");b<=c+
  5?d=null:(d=d.substring(c+5,b),d=xnm.aio.hm.Util.decodeXml(d),d=JSON.parse(d))}else d=null;a(null,d)}})},toJSON:function(){return{sys:xnm.aio.hm.DM.SYS,ip:this.ip,port:this.port,uuid:this.uuid,username:this.username,password:this.password,tclport:this.tclport,cloudmatic:this.cloudmatic,type:this.type}},equalsTo:function(a){return a&&a instanceof xnm.aio.hm.MHMCCU?this.ip==a.ip&&this.port==a.port&&this.username==a.username&&this.password==a.password:!1},_doRequestMarked:function(a,c,d){this._doRequest(a,
  c,function(a,c){d&&d.execute.call(d,a,c)},5E3)},_doRequest:function(a,c,d,b){if("on"==this._cloudmaticState)this._doCloudmaticRequest(a,c,d,b);else{var e=this.port,f="/api/homematic.cgi";c&&(e=this.tclport,f="/tclrega.exe");var h=d;c={host:this.ip,port:e,path:f,method:"POST",headers:{"Content-Type":'text/xml; charset="ISO-8859-1"',"Content-Length":a.length,"User-Agent":"mediola",Connection:"close"}};if(this.username||this.password)c.auth=(this.username?this.username:"")+":"+(this.password?this.password:
  ""),c.headers.Authorization="Basic "+(new Buffer((this.username?this.username:"")+":"+(this.password?this.password:""))).toString("base64");var g=this,l="",k=require("http").request(c,function(a){200==a.statusCode?(a.setEncoding("binary"),a.on("data",function(a){l+=a}),a.on("end",function(){h&&h(null,l);h=null})):(g._logger.log("warn","Failed to post request to "+g.ip+" with status code:"+a.statusCode),h&&h(new TypeError("post request failed with status code:"+a.statusCode)),h=null)});k.setEncoding&&
  k.setEncoding("ISO-8859-1");if(k.setTimeout){c=6E4;if(null==b||"undefined"==typeof b)b=0;b=parseInt(b);c=0<=b?b:c;0<c&&k.setTimeout(c,function(){k.abort()})}if(k.on&&"function"==typeof k.on)k.on("error",function(a){a||(a=Error("http request error"));h&&h(a);h=null});k.write(a);k.end()}},_doCloudmaticRequest:function(a,c,d,b){if(this.cloudmatic&&this.cloudmatic.id&&this.cloudmatic.username&&this.cloudmatic.password){var e=this.cloudmatic.id+".meine-homematic.de",f=this.port,h="/api/homematic.cgi";
  c&&(f=this.tclport,h="/tclrega.exe");var g=d;c={host:e,port:f,path:h,method:"POST",headers:{"Content-Type":'text/xml; charset="ISO-8859-1"',"Content-Length":a.length,"User-Agent":"mediola",Connection:"close"}};if(this.cloudmatic.username||this.cloudmatic.password)c.auth=(this.cloudmatic.username?this.cloudmatic.username:"")+":"+(this.cloudmatic.password?this.cloudmatic.password:""),c.headers.Authorization="Basic "+(new Buffer((this.cloudmatic.username?this.cloudmatic.username:"")+":"+(this.cloudmatic.password?
  this.cloudmatic.password:""))).toString("base64");var l=this,k="",n=require("http").request(c,function(a){200==a.statusCode?(a.setEncoding("binary"),a.on("data",function(a){k+=a}),a.on("end",function(){g&&g(null,k);g=null})):(l._logger.log("warn","Failed to post request to "+l.ip+" with status code:"+a.statusCode),g&&g(new TypeError("post request failed with status code:"+a.statusCode)),g=null)});n.setEncoding&&n.setEncoding("ISO-8859-1");if(n.setTimeout){c=6E4;if(null==b||"undefined"==typeof b)b=
  0;b=parseInt(b);c=0<b?b:c;1E4>c&&(c=1E4);0<c&&n.setTimeout(c,function(){n.abort()})}if(n.on&&"function"==typeof n.on)n.on("error",function(a){a||(a=Error("http request error"));g&&g(a);g=null});n.write(a);n.end()}else d&&d(Error("cloudmatic config invalid"))}};
  xnm.aio.hm.MHMCCU._resolveCUxDType=function(a){var c=function(a,b){for(var c=0;c<b.length;c++)if(b[c]==a)return!0;return!1};if(!a.type||!a.channels)return null;if(a.channels.SWITCH&&a.channels.POWERMETER)return"EnOcean_Bidi_Switch";if(a.channels.WEATHER&&a.channels.CLIMATECONTROL_REGULATOR&&a.channels.CLIMATECONTROL_VENT_DRIVE)return"EnOcean_Actuator";if(a.channels.WEATHER&&a.channels.CLIMATECONTROL_REGULATOR&&a.channels.SWITCH&&a.channels.SENSOR)return"EnOcean_Airconditioner";if(a.channels.MOTION_DETECTOR&&
  a.channels.WEATHER&&a.channels.POWER)return"EnOcean_Motion";if(a.channels.KEY&&a.channels.SENSOR&&a.channels.POWER)return"EnOcean_PioTek_Tracker";if(a.channels.WEATHER&&a.channels.CLIMATECONTROL_REGULATOR&&a.channels.SWITCH)return"Thermostat_Device";if(a.channels.WEATHER&&a.channels.CLIMATECONTROL_REGULATOR)return"FHT80b";if(a.channels.CLIMATECONTROL_VENT_DRIVE)return"FHT80v";if(a.channels.CAPACITIVE_FILLING_LEVEL_SENSOR)return"KFM_100_S";if(a.channels.WRAPPER)return"Transform_Device";if(a.channels.KEY){if(c("KEYPRESS_TIME",
  a.channels.KEY.datapoints))return"EnOcean_Key";if(c("CMD_RUNS",a.channels.KEY.datapoints))return"System_Key";if(c("MOTION",a.channels.KEY.datapoints))return"Universal_Key"}else if(a.channels.SWITCH){if(c("EVENTCTR",a.channels.SWITCH.datapoints))return"FS20_Switch_Sensor";if(c("TOGGLE",a.channels.SWITCH.datapoints))return"FS20_Switch";if(c("CMD_RUNS",a.channels.SWITCH.datapoints))return"System_Switch";if(c("MOTION",a.channels.SWITCH.datapoints))return"Universal_Switch";if(c("ENERGY_COUNTER",a.channels.SWITCH.datapoints)&&
  c("POWER",a.channels.SWITCH.datapoints))return"EnOcean_Switch"}else{if(a.channels.DIMMER)return c("TOGGLE",a.channels.DIMMER.datapoints)?"FS20_Dimmer":c("CMD_RUNS",a.channels.DIMMER.datapoints)?"System_Dimmer":c("MOTION",a.channels.DIMMER.datapoints)?"Universal_Dimmer":c("SET_STATE",a.channels.DIMMER.datapoints)?"System_Multi_Dimmer":c("ENERGY_COUNTER",a.channels.DIMMER.datapoints)&&c("POWER",a.channels.DIMMER.datapoints)?"EnOcean_Dimmer":"FHT_Multiventil";if(a.channels.BLIND){if(c("CMD_RUNS",a.channels.BLIND.datapoints))return"System_Blind";
  if(c("MOTION",a.channels.BLIND.datapoints))return"Universal_Blind";if(c("WORKING",a.channels.BLIND.datapoints)&&c("DIRECTION",a.channels.BLIND.datapoints))return"EnOcean_Blind"}else{if(a.channels.WEATHER)return c("HUMIDITYF",a.channels.WEATHER.datapoints)?"Temp/Hum_Sensor":c("RAINING",a.channels.WEATHER.datapoints)&&c("HUMIDITY",a.channels.WEATHER.datapoints)?"KS200/300":c("RAINING",a.channels.WEATHER.datapoints)||c("BRIGHTNESS_WEST",a.channels.WEATHER.datapoints)?"EnOcean_WeatherStation":c("BRIGHTNESS",
  a.channels.WEATHER.datapoints)&&c("MEDIAN",a.channels.WEATHER.datapoints)?"EnOcean_Brightness":"Temperature_Sensor";if(a.channels.ROTARY_HANDLE_SENSOR)return"EnOcean_Handle";if(a.channels.SHUTTER_CONTACT)return c("EVENTCTR",a.channels.SHUTTER_CONTACT.datapoints)?"FS20_Contact":c("MOTION",a.channels.SHUTTER_CONTACT.datapoints)?"Universal_Shutter":"EnOcean_Contact";if(a.channels.MOTION_DETECTOR){if(c("EVENTCTR",a.channels.MOTION_DETECTOR.datapoints))return"FS20_Motion";if(c("MOTION",a.channels.MOTION_DETECTOR.datapoints))return"Universal_Motion"}else{if(a.channels.SENSOR)return c("INFO",
  a.channels.SENSOR.datapoints)?"M-BUS_EnergyCam":c("EVENTCTR",a.channels.SENSOR.datapoints)?"FS20_Sensor":c("MAX5MINUTES",a.channels.SENSOR.datapoints)?"EM1000":c("LAST_TICKS",a.channels.SENSOR.datapoints)?"ESA1000/2000":c("DISTANCE",a.channels.SENSOR.datapoints)?"RS232_Water_Sensor":c("COUNTER",a.channels.SENSOR.datapoints)?"HM-Sec-SC"==a.type?"HMS_100_Contact":"HM-Sec-WDS"==a.type?"HMS_100_W/WD":"Security_Sensor":"FHT_Contact";if(a.channels.DANGER){if(c("EVENTCTR",a.channels.DANGER.datapoints))return"FS20_Alarm";
  if(c("MOTION",a.channels.DANGER.datapoints))return"Universal_Alarm"}else{if(a.channels.EVENT_INTERFACE)return"FS20_Event_Trigger";if(a.channels.RELAIS)return"FS20_Relais";if(a.channels.WRAPPER)return"Transform_Device";if(a.channels.SYSTEM)return"System_Multi_Dimmer"}}}}return null};
  xnm.aio.hm.MHMCCU._getDataPointAddress=function(a,c,d){if(!(a&&a["interface"]&&a.address&&"undefined"!=typeof c.address&&null!=c.address&&d))return null;var b=a.address,e=a.address.indexOf(":");-1!=e&&(b=a.address.substring(0,e));return a["interface"]+"."+b+":"+c.address+"."+d};xnm.aio.hm.MHMCCU._SCRIPT_GET_PROGS='!# Get the device list\r\nstring res = \'{\';\r\n\r\nstring sDevId;\r\nstring sChnId;\r\nstring sDptId;\r\nstring sRoomId;\r\nstring sFunctionId;\r\nobject oDevice;\r\nobject oChannel;\r\nobject oDatapoint;\r\nobject oRoom;\r\nstring sDevInterfaceId;\r\nstring sDevInterfaceName;\r\nboolean dFirst = true;\r\nboolean cFirst = true;\r\nboolean dpFirst = true;\r\nboolean hasRoom = true;\r\ninteger dptCount = 0;\r\n\r\nres = res # \'"progs":{\';\r\ndFirst = true;\r\nforeach(sDevId, dom.GetObject(ID_PROGRAMS).EnumUsedIDs()) {\r\n\tif (dFirst) {\r\n\t\tdFirst=false;\r\n\t} else {\r\n\t\tres = res # \',\';\r\n\t}\r\n\toDevice = dom.GetObject(sDevId);\r\n\r\n  res = res # \'"\' # sDevId # \'":{"name":#[\' # oDevice.Name();\r\n  res = res # \']#,"active":"\' # oDevice.Active() # \'"\';\r\n\r\n  res = res # \'}\';\r\n}\r\n\r\nres = res # \'}}\';\r\nsDevId="";\r\nsChnId="";\r\nsDptId="";\r\nsRoomId="";\r\nsFunctionId="";\r\noDevice="";\r\noChannel="";\r\noDatapoint="";\r\noRoom="";\r\nsDevInterfaceId="";\r\nsDevInterfaceName="";\r\ndFirst="";\r\ncFirst="";\r\ndpFirst="";\r\nsValue="";\r\n';
  xnm.aio.hm.MHMCCU._SCRIPT_GET_SYSVARS='!# Get the device list\r\nstring res = \'{\';\r\n\r\nstring sDevId;\r\nstring sChnId;\r\nstring sDptId;\r\nstring sRoomId;\r\nstring sFunctionId;\r\nobject oDevice;\r\nobject oChannel;\r\nobject oDatapoint;\r\nobject oRoom;\r\nstring sDevInterfaceId;\r\nstring sDevInterfaceName;\r\nboolean dFirst = true;\r\nboolean cFirst = true;\r\nboolean dpFirst = true;\r\nboolean hasRoom = true;\r\ninteger dptCount = 0;\r\n\r\nres = res # \'"systemvars":{\';\r\ndFirst = true;\r\nstring sValue;\r\nforeach(sDevId, dom.GetObject(ID_SYSTEM_VARIABLES).EnumUsedIDs()) {\r\n\tif (dFirst) {\r\n\t\tdFirst=false;\r\n\t} else {\r\n\t\tres = res # \',\';\r\n\t}\r\n\toDevice = dom.GetObject(sDevId);\r\n\r\n  res = res # \'"\' # sDevId # \'":{"name":#[\' # oDevice.Name();\r\n  res = res # \']#,"valuetype":"\' # oDevice.ValueType();\r\n  res = res # \'"}\';\r\n}\r\nres = res # \'}\';\r\nres = res # \'}\';\r\nsDevId="";\r\nsChnId="";\r\nsDptId="";\r\nsRoomId="";\r\nsFunctionId="";\r\noDevice="";\r\noChannel="";\r\noDatapoint="";\r\noRoom="";\r\nsDevInterfaceId="";\r\nsDevInterfaceName="";\r\ndFirst="";\r\ncFirst="";\r\ndpFirst="";\r\nsValue="";\r\n';
  xnm.aio.hm.MHMCCU._SCRIPT_GET_DEVICES='!# Get the device list\r\nstring res = \'{\';\r\n\r\nstring sDevId;\r\nstring sChnId;\r\nstring sDptId;\r\nstring sRoomId;\r\nstring sFunctionId;\r\nobject oDevice;\r\nobject oChannel;\r\nobject oDatapoint;\r\nobject oRoom;\r\nstring sDevInterfaceId;\r\nstring sDevInterfaceName;\r\nboolean dFirst = true;\r\nboolean cFirst = true;\r\nboolean dpFirst = true;\r\nboolean hasRoom = true;\r\ninteger dptCount = 0;\r\n\r\nres = res # \'"devices":{\';\r\nforeach(sDevId, root.Devices().EnumUsedIDs()) {\r\n\tif (dFirst) {\r\n\t\tdFirst=false;\r\n\t} else {\r\n\t\tres = res # \',\';\r\n\t}\r\n\toDevice = dom.GetObject(sDevId);\r\n\tsDevInterfaceId = oDevice.Interface();\r\n    sDevInterfaceName = dom.GetObject(sDevInterfaceId).Name();\r\n\tres = res # \'"\' # sDevId # \'":{"name":#[\' # oDevice.Name();\r\n\tres = res # \']#,"typename":"\' # oDevice.TypeName();\r\n\tres = res # \'","hsstype":"\' # oDevice.HssType();\r\n\tres = res # \'","address":"\' # oDevice.Address();\r\n\tres = res # \'","interface":"\' # sDevInterfaceName;\r\n\tres = res # \'","channels":{\';\r\n\r\n\tcFirst = true;\r\n\tforeach(sChnId, oDevice.Channels()) {\r\n\t\tif (cFirst) {\r\n\t\t\tcFirst=false;\r\n\t\t} else {\r\n\t\t\tres = res # \',\';\r\n\t\t}\r\n\t\tres = res # \'"\' # sChnId# \'":{\';\r\n\t\toChannel = dom.GetObject(sChnId);\r\n\t\tres = res # \'"hsstype":"\' # oChannel.HssType();\r\n\t\tres = res # \'","name":#[\' # oChannel.Name();\r\n\t\tsFunctionId = oChannel.ChnFunction();\r\n\t\tres = res # \']#,"func":"\' # dom.GetObject(sFunctionId);\r\n\t\tres = res # \'","room":[\';\r\n\r\n        hasRoom = false;\r\n\t\tforeach(sRoomId, oChannel.ChnRoom()) {\r\n\t\t  oRoom = dom.GetObject(sRoomId);\r\n\t\t  res = res # \'#[\' # oRoom.Name();\r\n          res = res # \']#,\';\r\n          hasRoom = true;\r\n\t\t}\r\n\t\tif (hasRoom) {\r\n\t\t  res = res.Substr(0, res.Length()-1);\r\n\t\t}\r\n\t\tres = res # \']\';\r\n\t\tres = res # \',"address":"\' # oChannel.Address() # \'"\';\r\n\r\n        !read datapoint for CUxD device\r\n        if (sDevInterfaceName == \'CUxD\') {\r\n          res = res # \',"datapoints":[\';\r\n          !dpFirst = false;\r\n          dptCount = 0;\r\n          foreach(sDptId, oChannel.DPs()) {\r\n            oDatapoint = dom.GetObject(sDptId);\r\n            if (oDatapoint.TypeName() == "HSSDP") {\r\n              dptCount = dptCount + 1;\r\n            }\r\n          }\r\n          foreach(sDptId, oChannel.DPs()) {\r\n            oDatapoint = dom.GetObject(sDptId);\r\n            if (oDatapoint.TypeName() == "HSSDP") {\r\n                res = res # \'"\' # oDatapoint.HssType() # \'"\';\r\n                dptCount = dptCount - 1;\r\n                if (dptCount > 0) {\r\n                    res = res # \',\';\r\n                }\r\n            }\r\n            !dpFirst = true;\r\n          }\r\n          !if (dpFirst) {\r\n          !  res = res.Substr(0, res.Length()-1);\r\n          !}\r\n          res = res # \']\';\r\n        }\r\n        !res = res # \'","datapoints":{\';\r\n        !dpFirst = true;\r\n        !foreach(sDptId, oChannel.DPs()) {\r\n        !    if (dpFirst) {\r\n        !        dpFirst=false;\r\n        !    } else {\r\n        !    \tres = res # \',\';\r\n        !    }\r\n        !    res = res # \'"\' # sDptId# \'":{\';\r\n        !    oDatapoint = dom.GetObject(sDptId);\r\n        !    res = res # \'"name":"\' # oDatapoint.Name();\r\n        !    res = res # \'","typename":"\' # oDatapoint.TypeName();\r\n        !    res = res # \'","valuetype":"\' # oDatapoint.ValueType();\r\n        !    res = res # \'","operations":"\' # oDatapoint.Operations() # \'"}\';\r\n        !}\r\n        !res = res # \'}}\';\r\n        res = res # \'}\';\r\n\t}\r\n\tres = res # \'}}\';\r\n}\r\nres = res # \'}\';\r\n\r\nres = res # \'}\';\r\nsDevId="";\r\nsChnId="";\r\nsDptId="";\r\nsRoomId="";\r\nsFunctionId="";\r\noDevice="";\r\noChannel="";\r\noDatapoint="";\r\noRoom="";\r\nsDevInterfaceId="";\r\nsDevInterfaceName="";\r\ndFirst="";\r\ncFirst="";\r\ndpFirst="";\r\nsValue="";\r\n';
  xnm.aio.hm.MHMCCU._SCRIPT_GET_SEVICE_MESSAGE='! get service message from ccu\r\n! message errors:\r\n! FAULT_REPORTING: communication failure\r\n! STICKY_UNREACH: communication was interrupted\r\n! UNREACH: communication is interrupted\r\n! ERROR: failure\r\n!\r\n\r\nstring sTmp;\r\nstring sdesc;\r\nboolean hasMessage;\r\nobject sdev;\r\nobject ch;\r\nobject trigDP;\r\nobject oTmp;\r\nobject oTmpArray = dom.GetObject(ID_SERVICES);\r\nstring res = "[";\r\nif(oTmpArray) {\r\n  foreach(sTmp, oTmpArray.EnumIDs()){\r\n    object oTmp = dom.GetObject(sTmp);\r\n    if(oTmp){\r\n      if( oTmp.IsTypeOf( OT_ALARMDP ) && ( oTmp.AlState() == asOncoming ) ){\r\n        hasMessage = true;\r\n        trigDP = dom.GetObject(oTmp.AlTriggerDP());\r\n        ch = dom.GetObject(trigDP.Channel());\r\n        sdev = dom.GetObject(ch.Device());\r\n        sdesc = trigDP.HssType();\r\n        res = res # \'{"name":"\'+sdev.Name()#\'","channel":"\'#ch.Address()#\'","error":"\'+sdesc+\'"},\';\r\n      }\r\n    }\r\n  }\r\n}\r\nif (hasMessage) {\r\n  res = res.Substr(0, res.Length()-1);\r\n}\r\nres = res # "]";\r\nsTmp="";\r\nsdesc="";\r\nhasMessage="";\r\nsdev="";\r\nch="";\r\ntrigDP="";\r\noTmp="";\r\noTmpArray="";';
  xnm.aio.hm.TYPE={"HM-PB-4Dis-WM":0,"ZEL STG RM DWT 10":0,"263 155":0,"HM-PB-4Dis-WM-2":0,ASH550I:1,ASH550:1,"HM-WDS10-TH-O":1,"263 158":1,"HM-WDS20-TH-O":1,"HM-WDS40-TH-I":1,"263 157":1,"IS-WDS-TH-OD-S-R3":1,"HM-WDS40-TH-I-2":1,"HM-LC-Bl1-SM":2,"HM-LC-Bl1-FM":2,"HM-LC-Bl1-PB-FM":2,"ZEL STG RM FEP 230V":2,"263 146":2,"HM-LC-BlX":2,"HM-LC-Bl1-SM-2":2,"HM-LC-Bl1-FM-2":2,"HM-LC-Bl1PBU-FM":2,"263 147":2,"HM-CC-RT-DN":3,"HM-CC-RT-DN-BoM":4,"HM-CC-TC":5,"ZEL STG RM FWT":5,"HM-CC-VD":6,"ZEL STG RM FSA":6,
  CENTRAL:7,"HM-RCV-50":7,"HM-OU-CF-Pl":8,"HM-OU-CFM-Pl":9,"HM-OU-CFM-TW":9,"HM-OU-CM-PCB":10,"HM-LC-Dim1L-Pl":11,"HM-LC-Dim1L-Pl-2":11,"HM-LC-Dim1L-CV":11,"263 132":11,"HM-LC-Dim2L-CV":11,"HM-LC-Dim2L-SM":11,"HSS-DX":11,"HM-LC-Dim1L-Pl-3":11,"HM-LC-Dim1L-CV-2":11,"HM-LC-Dim2L-SM-2":11,"HM-LC-Dim1PWM-CV":12,"HM-LC-Dim1PWM-CV-2":12,"HM-LC-Dim1TPBU-FM":13,"HM-LC-Dim1TPBU-FM-2":13,"263 133":13,"HM-LC-Dim1T-Pl":13,"HM-LC-Dim1T-CV":13,"HM-LC-Dim1T-FM":13,"HM-LC-Dim1T-Pl-3":13,"HM-LC-Dim1T-CV-2":13,"HM-LC-Dim1T-FM-2":13,
  "HM-LC-Dim2T-SM":13,"HM-LC-Dim2T-SM-2":13,"HM-LC-Dim1T-Pl-2":13,"263 134":13,"HM-Dis-WM55":14,"HM-MOD-EM-8":15,"HM-ES-PMSw1-Pl":16,"HM-ES-PMSw1-Pl-DN-R1":16,"HM-ES-PMSw1-Pl-DN-R2":16,"HM-ES-PMSw1-Pl-DN-R3":16,"HM-ES-PMSw1-Pl-DN-R4":16,"HM-ES-PMSw1-Pl-DN-R5":16,"HM-ES-PMSw1-DR":16,"HM-ES-PMSw1-SM":16,"HM-Dis-TD-T":17,"HM-LC-Sw4-Ba-PCB":55,"HM-MOD-Re-8":26,"HM-LC-Sw1-Ba-PCB":55,"HM-Sec-Key":18,"HM-Sec-Key-S":18,"HM-Sec-Key-O":18,"HM-Sec-Key-Generic":18,KS550:19,KS888:19,KS550Tech:19,KS550LC:19,"HM-WDS100-C6-O":19,
  "HM-WDS100-C6-O-2":19,"HM-OU-LED16":20,"HM-OU-X":20,"HM-PB-2-WM55-2":21,"HM-PB-2-WM55":21,"ZEL STG RM WT 2":21,"263 135":21,"HM-PB-2-FM":21,"HM-PBI-4-FM":21,"ZEL STG RM FST UP4":21,"263 145":21,"HM-PBI-X":21,"HM-RC-4-2":21,"HM-RC-4-3":21,"HM-PB-6-WM55":21,"HM-RC-8":21,"HM-RC-4":21,"HM-RC-4-B":21,"HM-RC-P1":21,"HM-RC-Sec3":21,"HM-RC-Sec3-B":21,"HM-RC-Key3":21,"HM-RC-Key3-B":21,"HM-PB-4-WM":21,"HM-PB-2-WM":21,"RC-H":21,atent:21,"ZEL STG RM HS 4":21,"HM-RC-X":21,"BRC-H":21,"HM-RC-SB-X":21,"HM-RC-12":21,
  "HM-RC-12-B":21,"HM-RC-12-SW":21,"HM-RC-Key4-2":22,"HM-RC-Sec4-2":22,"HM-RC-19":23,"HM-RC-19-B":23,"HM-RC-19-SW":23,"HM-Sen-RD-O":24,"HM-Sec-RHS":25,"ZEL STG RM FDK":25,"HM-Sec-xx":25,"HM-LC-Sw1-Pl":26,"HM-LC-Sw1-Pl-2":26,"HM-LC-Sw1-SM":26,"HM-LC-Sw2-SM":26,"HM-LC-Sw4-SM":26,"HM-LC-Sw4-PCB":26,"HM-LC-Sw4-WM":26,"HM-LC-Sw1-FM":26,"263 130":26,"HM-LC-Sw2-FM":26,"HM-LC-Sw1-PB-FM":26,"HM-LC-Sw2-PB-FM":26,"HM-LC-Sw4-DR":26,"HM-LC-Sw2-DR":26,"ZEL STG RM FZS":26,"ZEL STG RM FZS-2":26,"HM-LC-SwX":26,"HM-LC-Sw1PBU-FM":26,
  "263 131":26,"HM-LC-Sw1-Pl-3":26,"HM-LC-Sw1-SM-2":26,"HM-LC-Sw4-SM-2":26,"HM-LC-Sw4-PCB-2":26,"HM-LC-Sw4-WM-2":26,"HM-LC-Sw1-FM-2":26,"HM-LC-Sw2-FM-2":26,"HM-LC-Sw4-DR-2":26,"HM-LC-Sw2-DR-2":26,"HM-LC-Sw1-Pl-OM54":26,"HM-LC-Sw1-SM-ATmega168":26,"HM-LC-Sw4-SM-ATmega168":26,S550IA:27,"HM-WDS30-T-O":27,"HM-Sec-SC":28,"ZEL STG RM FFK":28,"HM-Sec-SC-2":28,"HM-SCI-3-FM":29,"HM-CC-SCD":30,"263 160":30,"HM-Sec-MDIR-2":31,"HM-Sec-MDIR":31,"263 162":31,"HM-Sec-MD":31,"HM-Sec-SD":32,"HM-Sec-SD-Generic":32,"HM-Sec-SD-2":58,
  "HM-Sec-SFA-SM":33,"HM-Sen-MDIR-SM":34,"HM-Sen-MDIR-O":34,"HM-MD":34,"HM-Sen-MDIR-O-2":34,"HM-Sen-EP":35,"HM-Sen-X":35,"HM-Sen-Wa-Od":36,"HM-SwI-3-FM":37,"ZEL STG RM FSS UP3":37,"263 144":37,"HM-SwI-X":37,"HM-TC-IT-WM-W-EU":38,"HM-Sec-TiS":39,"HM-WDS30-OT2-SM":40,"HM-WDS30-OT2-SM-2":40,"HM-Sec-WDS":41,"HM-Sec-WDS-2":41,"HM-Sec-Win":42,"HM-Sec-Win-Generic":42,WS550:43,WS888:43,WS550Tech:43,WS550LCB:43,WS550LCW:43,"HM-WDC7000":43,"HMW-IO-12-Sw14-DR":44,"HMW-IO-12-Sw7-DR":45,"HMW-IO-12-FM":46,"HMW-IO-4-FM":46,
  "HMW-LC-Bl1-DR":47,"HMW-LC-Dim1L-DR":48,"HMW-LC-Sw2-DR":49,"HMW-Sen-SC-12-DR":50,"HMW-Sen-SC-12-FM":50,"HM-CC-VG-1":51,"HM-ES-TX-WM":52,"HM-LC-RGBW-WM":53,"HM-Sec-SD-2-Team":54,"HM-Sen-LI-O":56,"HM-Sec-SCo":28,"HM-Sec-Sir-WM":57,"HM-LC-AO-SM":11,"HM-Sec-SD-Team":59,"HM-LC-Ja1PBU-FM":60,"HM-MOD-EM-8bit":61,"HM-LC-DW-WM":62};
  xnm.aio.hm.CATAGORY=[{catagory:"Display-Wandtaster AP",channels:{MAINTENANCE:0,KEY:1}},{catagory:"Temperatur-Feuchte-Sensor",channels:{MAINTENANCE:0,WEATHER:2}},{catagory:"Funk- Jalousieaktor",channels:{BLIND:0}},{catagory:"Heizk\u00f6rperthermostat",channels:{CLIMATECONTROL_RT_TRANSCEIVER:0}},{catagory:"Heizk\u00f6rperthermostat",channels:{CLIMATECONTROL_RT_TRANSCEIVER:1}},{catagory:"Funk- Wandthermostat",channels:{CLIMATECONTROL_REGULATOR:0,WEATHER:2}},{catagory:"Funk- Ventilsteuerung",channels:{CLIMATECONTROL_VENT_DRIVE:0}},
  {catagory:"HomeMatic Zentrale und virtuelle Fernbedienung",channels:{VIRTUAL_KEY:0}},{catagory:"Funk- Gong mit Signalleuchte",channels:{SIGNAL_LED:0,SIGNAL_CHIME:0}},{catagory:"MP3 Funk-Gong mit Signalleuchte und Speicher",channels:{MAINTENANCE:0,SIGNAL_LED:1,SIGNAL_CHIME:1}},{catagory:"Funk-Gongmodul MP3 mit Speicher",channels:{SIGNAL_CHIME:1}},{catagory:"Funk-Anschnitt-Dimmaktor",channels:{DIMMER:1}},{catagory:"Funk-PWM-Dimmaktor",channels:{DIMMER:2,VIRTUAL_DIMMER:0}},{catagory:"Funk-Abschnitt-Dimmaktor",
  channels:{DIMMER:3,VIRTUAL_DIMMER:1}},{catagory:"Display-Statusanzeige AP",channels:{KEY:2}},{catagory:"HomeMatic 8-Kanal Sendemodul",channels:{KEY:1,SHUTTER_CONTACT:2}},{catagory:"Funk-Schaltaktor mit Leistungsmessung",channels:{SWITCH:1,POWERMETER:0,CONDITION_POWER:0,CONDITION_CURRENT:0,CONDITION_VOLTAGE:0,CONDITION_FREQUENCY:0}},{catagory:"Funk- Schaltaktor Bat",channels:{STATUS_INDICATOR:0}},{catagory:"KeyMatic",channels:{MAINTENANCE:0,KEYMATIC:0}},{catagory:"Funk- Kombisensor",channels:{MAINTENANCE:0,
  WEATHER:4}},{catagory:"Statusanzeige 16Kanal LED",channels:{KEY:3}},{catagory:"Funk- Wandsender/Tasterschnittstelle/Handsender/Fernbedienung",channels:{MAINTENANCE:0,KEY:1}},{catagory:"Funk-Handsender Key/Sec V2",channels:{KEY:0}},{catagory:"Funk- Fernbedienung 19 Tasten mit Display",channels:{KEY:1,CENTRAL_KEY:0,DISPLAY:0}},{catagory:"HomeMatic Regensensor",channels:{RAINDETECTOR:0,RAINDETECTOR_HEAT:0}},{catagory:"Funk- Fenster-/Drehgriffkontakt",channels:{ROTARY_HANDLE_SENSOR:0}},{catagory:"Funk- Schaltaktor",
  channels:{SWITCH:1}},{catagory:"Temperatur-Sensor",channels:{WEATHER:0}},{catagory:"Funk- T\u00fcr-/Fensterkontakt",channels:{SHUTTER_CONTACT:1}},{catagory:"Funk-Schlie\u00dfer-Kontakt-Interface",channels:{MAINTENANCE:0,SHUTTER_CONTACT:0}},{catagory:"CO2-Sensor",channels:{SENSOR_FOR_CARBON_DIOXIDE:0}},{catagory:"Funk-Bewegungsmelder",channels:{MAINTENANCE:0,MOTION_DETECTOR:1}},{catagory:"Funk-Rauchmelder",channels:{MAINTENANCE:0,SMOKE_DETECTOR:0}},{catagory:"Alarm-Sirenen",channels:{ALARMACTUATOR:0}},
  {catagory:"Funk-Bewegungsmelder",channels:{MAINTENANCE:0,MOTION_DETECTOR:0}},{catagory:"HM Sensor for Electronic Pulses",channels:{PULSE_SENSOR:0}},{catagory:"HomeMatic Kapazitiver F\u00fcllstandsmesser",channels:{CAPACITIVE_FILLING_LEVEL_SENSOR:0}},{catagory:"Funk-Schalterschnittstelle",channels:{MAINTENANCE:0,SWITCH_INTERFACE:0}},{catagory:"Wandthermostat",channels:{THERMALCONTROL_TRANSMIT:0,WEATHER_TRANSMIT:0}},{catagory:"Tilt-Sensor",channels:{TILT_SENSOR:0}},{catagory:"Temperaturdifferenz-Sensor",
  channels:{WEATHER:1}},{catagory:"Funk-Wassermelder",channels:{WATERDETECTIONSENSOR:0}},{catagory:"WinMatic",channels:{WINMATIC:0,AKKU:0}},{catagory:"Funk-Wetterstation",channels:{WEATHER:3}},{catagory:"I/O-Modul 12 Eing\u00e4nge 14 Schaltausg\u00e4nge",channels:{DIGITAL_OUTPUT:0,DIGITAL_ANALOG_OUTPUT:0,DIGITAL_INPUT:0,DIGITAL_ANALOG_INPUT:0}},{catagory:"I/O-Modul 12 Eing\u00e4nge 7 Schaltausg\u00e4nge Hutschienenmontage",channels:{KEY:0,SWITCH:0}},{catagory:"4/12fach I/O-Modul Unterputzmontage",channels:{INPUT_OUTPUT:0}},
  {catagory:"Jalousieaktor 1fach Hutschienenmontage",channels:{KEY:0,BLIND:0}},{catagory:"Dimmaktor 1fach Hutschienenmontage",channels:{KEY:0,DIMMER:0}},{catagory:"Schaltaktor 2fach Hutschienenmontage",channels:{KEY:0,SWITCH:0}},{catagory:"Schlie\u00dferkontakt-Sensor",channels:{SENSOR:0}},{catagory:"Gruppe 1",channels:{CLIMATECONTROL_RT_TRANSCEIVER:2,SHUTTER_CONTACT:2}},{catagory:"Energiez\u00e4hler-Sensor",channels:{POWERMETER_IGL:0}},{catagory:"Funk-RGBW-Controller",channels:{DIMMER:4,RGBW_COLOR:0,
  RGBW_AUTOMATIC:0}},{catagory:"Funk-Rauchmelder 2 Gruppe",channels:{SMOKE_DETECTOR_TEAM_V2:0}},{catagory:"Funk- Schaltaktor Bat",channels:{MAINTENANCE:0,SWITCH:1}},{catagory:"Light Intensity Sensor",channels:{MAINTENANCE:0,LUXMETER:0}},{catagory:"Funk-Innensirene",channels:{SWITCH_SENSOR:0,SWITCH_PANIC:0,ARMING:0}},{catagory:"Funk-Rauchmelder 2",channels:{SMOKE_DETECTOR:1}},{catagory:"Funk-Rauchmelder Gruppe",channels:{SMOKE_DETECTOR_TEAM:0}},{catagory:"Funk-Jalousieaktor",channels:{JALOUSIE:0}},{catagory:"Funk-Sendemodul 8-bit",
  channels:{KEY:1,MOD_EM8BIT_TRANSMITTER:0}},{catagory:"Funk-Conrtoller f\u00fcr Dual-White-LEDs",channels:{DUAL_WHITE_BRIGHTNESS:0,DUAL_WHITE_COLOR:0}}];
  xnm.aio.hm.CHANNEL={KEY:{_level:0,datapoints:[{PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",access:"we"},INSTALL_TEST:{type:"action",access:"e"}},{PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",access:"we"},PRESS_LONG_RELEASE:{type:"action",access:"e"},PRESS_CONT:{type:"action",access:"e"},INSTALL_TEST:{type:"action",access:"e"}},{PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",access:"we"},PRESS_LONG_RELEASE:{type:"action",access:"e"},PRESS_CONT:{type:"action",
  access:"e"},INSTALL_TEST:{type:"action",access:"e"},SUBMIT:{type:"string",access:"w"}},{PRESS_SHORT:{type:"action",access:"we"},LED_STATUS:{type:"option",access:"rwe",values:{0:"OFF",1:"RED",2:"GREEN",3:"ORANGE"}},ALL_LEDS:{type:"string",access:"w"},LED_SLEEP_MODE:{type:"option",access:"w",values:{0:"OFF",1:"ON"}},INSTALL_TEST:{type:"action",access:"we"}}]},CENTRAL_KEY:{_level:1,datapoints:[{PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",access:"we"},PRESS_LONG_RELEASE:{type:"action",
  access:"e"},PRESS_CONT:{type:"action",access:"e"},INSTALL_TEST:{type:"action",access:"e"}}]},DISPLAY:{_level:2,datapoints:[{TEXT:{type:"string",access:"w"},BULB:{type:"action",access:"w"}}]},VIRTUAL_KEY:{_level:3,datapoints:[{PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",access:"we"},LEVEL:{type:"float",access:"w",min:0,max:1,unit:"100%"}}]},INPUT_OUTPUT:{_level:4,datapoints:[{STATE:{type:"boolean",access:"rwe"},PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",
  access:"we"},INSTALL_TEST:{type:"action",access:"e"}}]},SWITCH:{_level:5,datapoints:[{STATE:{type:"boolean",access:"rwe"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"w"}},{STATE:{type:"boolean",access:"rwe"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"e"}}]},SWITCH_INTERFACE:{_level:6,datapoints:[{PRESS:{type:"action",
  access:"we"},INSTALL_TEST:{type:"action",access:"we"}}]},DIMMER:{_level:7,datapoints:[{LEVEL:{type:"float",access:"rwe",min:0,max:1,unit:"100%"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},DIRECTION:{type:"option",access:"re",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},INSTALL_TEST:{type:"action",access:"w"}},{LEVEL:{type:"float",access:"rwe",min:0,max:1,unit:"100%"},OLD_LEVEL:{type:"action",access:"w"},RAMP_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,
  unit:"s"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},RAMP_STOP:{type:"action",access:"w"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},DIRECTION:{type:"option",access:"re",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},ERROR:{type:"option",access:"re",values:{0:"NO_ERROR",1:"LOAD_FAILURE"}},INSTALL_TEST:{type:"action",access:"w"}},{LEVEL:{type:"float",access:"rwe",min:0,max:1,unit:"100%"},OLD_LEVEL:{type:"action",access:"w"},LEVEL_REAL:{type:"float",
  access:"re",min:0,max:1,unit:"100%"},RAMP_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},RAMP_STOP:{type:"action",access:"w"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},DIRECTION:{type:"option",access:"re",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},ERROR_REDUCED:{type:"boolean",access:"re"},ERROR_OVERHEAT:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"w"}},{LEVEL:{type:"float",
  access:"rwe",min:0,max:1,unit:"100%"},OLD_LEVEL:{type:"action",access:"w"},LEVEL_REAL:{type:"float",access:"re",min:0,max:1,unit:"100%"},RAMP_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},RAMP_STOP:{type:"action",access:"w"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},DIRECTION:{type:"option",access:"re",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},ERROR_REDUCED:{type:"boolean",access:"re"},
  ERROR_OVERLOAD:{type:"boolean",access:"re"},ERROR_OVERHEAT:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"w"}},{LEVEL:{type:"float",access:"rwe",min:0,max:1,unit:"100%"},OLD_LEVEL:{type:"action",access:"w"},RAMP_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},RAMP_STOP:{type:"action",access:"w"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},DIRECTION:{type:"option",access:"re",
  values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},INSTALL_TEST:{type:"action",access:"w"}}]},VIRTUAL_DIMMER:{_level:8,datapoints:[{LEVEL:{type:"float",access:"rwe",min:0,max:1,unit:"100%"},OLD_LEVEL:{type:"action",access:"w"},LEVEL_REAL:{type:"float",access:"re",min:0,max:1,unit:"100%"},RAMP_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},RAMP_STOP:{type:"action",access:"w"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",
  access:"re"},DIRECTION:{type:"option",access:"re",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},ERROR_REDUCED:{type:"boolean",access:"re"},ERROR_OVERHEAT:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"w"}},{LEVEL:{type:"float",access:"rwe",min:0,max:1,unit:"100%"},OLD_LEVEL:{type:"action",access:"w"},LEVEL_REAL:{type:"float",access:"re",min:0,max:1,unit:"100%"},RAMP_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,
  unit:"s"},RAMP_STOP:{type:"action",access:"w"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},DIRECTION:{type:"option",access:"re",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},ERROR_REDUCED:{type:"boolean",access:"re"},ERROR_OVERLOAD:{type:"boolean",access:"re"},ERROR_OVERHEAT:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"w"}}]},BLIND:{_level:9,datapoints:[{LEVEL:{type:"float",access:"rwe",min:0,max:1,unit:"100%"},STOP:{type:"action",access:"w"},
  INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},DIRECTION:{type:"option",access:"re",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},INSTALL_TEST:{type:"action",access:"w"}}]},KEYMATIC:{_level:10,datapoints:[{STATE:{type:"boolean",access:"rwe"},OPEN:{type:"action",access:"w"},RELOCK_DELAY:{type:"float",access:"w",min:0,max:65535,unit:"s",special:{"111600.0":"NOT_USED"}},STATE_UNCERTAIN:{type:"boolean",access:"re"},DIRECTION:{type:"option",access:"re",values:{0:"NONE",1:"UP",
  2:"DOWN",3:"UNDEFINED"}},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"e"},ERROR:{type:"option",access:"re",values:{0:"NO_ERROR",1:"CLUTCH_FAILURE",2:"MOTOR_ABORTED"}}}]},WINMATIC:{_level:11,datapoints:[{LEVEL:{type:"float",access:"rwe",min:0,max:1,unit:"100%",special:{"-0.005":"LOCKED"}},RELOCK_DELAY:{type:"float",access:"w",min:0,max:65535,unit:"s",special:{"111600.0":"NOT_USED"}},SPEED:{type:"float",access:"w",min:0,max:1,unit:"100%"},
  STOP:{type:"action",access:"w"},STATE_UNCERTAIN:{type:"boolean",access:"re"},DIRECTION:{type:"option",access:"re",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},ERROR:{type:"option",access:"re",values:{0:"NO_ERROR",1:"MOTOR_TURN_ERROR",2:"MOTOR_TILT_ERROR"}}}]},CLIMATECONTROL_RT_TRANSCEIVER:{_level:12,datapoints:[{CONTROL_MODE:{type:"option",access:"re",values:{0:"AUTO-MODE",1:"MANU-MODE",2:"PARTY-MODE",3:"BOOST-MODE"}},
  FAULT_REPORTING:{type:"option",access:"re",values:{0:"NO_FAULT",1:"VALVE_TIGHT",2:"ADJUSTING_RANGE_TOO_LARGE",3:"ADJUSTING_RANGE_TOO_SMALL",4:"COMMUNICATION_ERROR",5:"",6:"LOWBAT",7:"VALVE_ERROR_POSITION"}},BATTERY_STATE:{type:"float",access:"re",min:1.5,max:4.6,unit:"V"},VALVE_STATE:{type:"integer",access:"re",min:0,max:99,unit:"%"},BOOST_STATE:{type:"integer",access:"re",min:0,max:30,unit:"min"},ACTUAL_TEMPERATURE:{type:"float",access:"re",min:-10,max:56,unit:"\u00b0C"},SET_TEMPERATURE:{type:"float",
  access:"rwe",min:4.5,max:30.5,unit:"\u00b0C"},AUTO_MODE:{type:"action",access:"w"},MANU_MODE:{type:"float",access:"w",min:4.5,max:30.5,unit:"\u00b0C"},BOOST_MODE:{type:"action",access:"w"},COMFORT_MODE:{type:"action",access:"w"},LOWERING_MODE:{type:"action",access:"w"},PARTY_MODE_SUBMIT:{type:"string",access:"w"},PARTY_TEMPERATURE:{type:"float",access:"rw",min:5,max:30,unit:"\u00b0C"},PARTY_START_TIME:{type:"integer",access:"rw",min:0,max:1410,unit:"minutes"},PARTY_START_DAY:{type:"integer",access:"rw",
  min:1,max:31,unit:"day"},PARTY_START_MONTH:{type:"integer",access:"rw",min:1,max:12,unit:"month"},PARTY_START_YEAR:{type:"integer",access:"rw",min:0,max:99,unit:"year"},PARTY_STOP_TIME:{type:"integer",access:"rw",min:0,max:1410,unit:"minutes"},PARTY_STOP_DAY:{type:"integer",access:"rw",min:1,max:31,unit:"day"},PARTY_STOP_MONTH:{type:"integer",access:"rw",min:1,max:12,unit:"month"},PARTY_STOP_YEAR:{type:"integer",access:"rw",min:0,max:99,unit:"year"}},{CLEAR_WINDOW_OPEN_SYMBOL:{type:"integer",access:"w",
  min:0,max:1},SET_SYMBOL_FOR_HEATING_PHASE:{type:"integer",access:"w",min:0,max:1},CONTROL_MODE:{type:"option",access:"re",values:{0:"AUTO-MODE",1:"MANU-MODE",2:"PARTY-MODE",3:"BOOST-MODE"}},FAULT_REPORTING:{type:"option",access:"re",values:{0:"NO_FAULT",1:"VALVE_TIGHT",2:"ADJUSTING_RANGE_TOO_LARGE",3:"ADJUSTING_RANGE_TOO_SMALL",4:"COMMUNICATION_ERROR",5:"",6:"LOWBAT",7:"VALVE_ERROR_POSITION"}},WINDOW_STATE:{type:"boolean",access:"re"},BATTERY_STATE:{type:"float",access:"re",min:1.5,max:4.6,unit:"V"},
  VALVE_STATE:{type:"integer",access:"re",min:0,max:99,unit:"%"},BOOST_TIME:{type:"integer",access:"re",min:0,max:30,unit:"min"},ACTUAL_TEMPERATURE:{type:"float",access:"re",min:-10,max:56,unit:"\u00b0C"},SET_TEMPERATURE:{type:"float",access:"rwe",min:4.5,max:30.5,unit:"\u00b0C"},AUTO_MODE:{type:"action",access:"w"},MANU_MODE:{type:"float",access:"w",min:4.5,max:30.5,unit:"\u00b0C"},BOOST_MODE:{type:"action",access:"w"},COMFORT_MODE:{type:"action",access:"w"},LOWERING_MODE:{type:"action",access:"w"},
  PARTY_MODE_SUBMIT:{type:"string",access:"w"},PARTY_TEMPERATURE:{type:"float",access:"rw",min:5,max:30,unit:"\u00b0C"},PARTY_START_TIME:{type:"integer",access:"rw",min:0,max:1410,unit:"minutes"},PARTY_START_DAY:{type:"integer",access:"rw",min:1,max:31,unit:"day"},PARTY_START_MONTH:{type:"integer",access:"rw",min:1,max:12,unit:"month"},PARTY_START_YEAR:{type:"integer",access:"rw",min:0,max:99,unit:"year"},PARTY_STOP_TIME:{type:"integer",access:"rw",min:0,max:1410,unit:"minutes"},PARTY_STOP_DAY:{type:"integer",
  access:"rw",min:1,max:31,unit:"day"},PARTY_STOP_MONTH:{type:"integer",access:"rw",min:1,max:12,unit:"month"},PARTY_STOP_YEAR:{type:"integer",access:"rw",min:0,max:99,unit:"year"}},{CONTROL_MODE:{type:"option",access:"re",values:{0:"AUTO-MODE",1:"MANU-MODE",2:"PARTY-MODE",3:"BOOST-MODE"}},ACTUAL_HUMIDITY:{type:"float",access:"re",min:0,max:99,unit:"%"},BOOST_MODE:{type:"action",access:"w"},AUTO_MODE:{type:"action",access:"w"},SET_TEMPERATURE:{type:"float",access:"rwe",min:4.5,max:30.5,unit:"\u00b0C"},
  ACTUAL_TEMPERATURE:{type:"float",access:"re",min:-10,max:56,unit:"\u00b0C"},MANU_MODE:{type:"float",access:"w",min:4.5,max:30.5,unit:"\u00b0C"},COMFORT_MODE:{type:"action",access:"w"},LOWERING_MODE:{type:"action",access:"w"},PARTY_TEMPERATURE:{type:"float",access:"rw",min:5,max:30,unit:"\u00b0C"},PARTY_MODE_SUBMIT:{type:"string",access:"w"},PARTY_START_TIME:{type:"integer",access:"rw",min:0,max:1410,unit:"minutes"},PARTY_START_DAY:{type:"integer",access:"rw",min:1,max:31,unit:"day"},PARTY_START_MONTH:{type:"integer",
  access:"rw",min:1,max:12,unit:"month"},PARTY_START_YEAR:{type:"integer",access:"rw",min:0,max:99,unit:"year"},PARTY_STOP_TIME:{type:"integer",access:"rw",min:0,max:1410,unit:"minutes"},PARTY_STOP_DAY:{type:"integer",access:"rw",min:1,max:31,unit:"day"},PARTY_STOP_MONTH:{type:"integer",access:"rw",min:1,max:12,unit:"month"},PARTY_STOP_YEAR:{type:"integer",access:"rw",min:0,max:99,unit:"year"}}]},THERMALCONTROL_TRANSMIT:{_level:13,datapoints:[{CONTROL_MODE:{type:"option",access:"re",values:{0:"AUTO-MODE",
  1:"MANU-MODE",2:"PARTY-MODE",3:"BOOST-MODE"}},LOWBAT_REPORTING:{type:"boolean",access:"re"},COMMUNICATION_REPORTING:{type:"boolean",access:"re"},WINDOW_OPEN_REPORTING:{type:"boolean",access:"re"},BATTERY_STATE:{type:"float",access:"re",min:1.5,max:4.6,unit:"V"},BOOST_STATE:{type:"integer",access:"re",min:0,max:30,unit:"min"},ACTUAL_TEMPERATURE:{type:"float",access:"re",min:-10,max:50,unit:"\u00b0C"},ACTUAL_HUMIDITY:{type:"float",access:"re",min:0,max:99,unit:"%"},SET_TEMPERATURE:{type:"float",access:"rwe",
  min:4.5,max:30.5,unit:"\u00b0C"},AUTO_MODE:{type:"action",access:"w"},MANU_MODE:{type:"float",access:"w",min:4.5,max:30.5,unit:"\u00b0C"},BOOST_MODE:{type:"action",access:"w"},COMFORT_MODE:{type:"action",access:"w"},LOWERING_MODE:{type:"action",access:"w"},PARTY_MODE_SUBMIT:{type:"string",access:"rw"},PARTY_TEMPERATURE:{type:"float",access:"rw",min:5,max:30,unit:"\u00b0C"},PARTY_START_TIME:{type:"integer",access:"rw",min:0,max:1410,unit:"minutes"},PARTY_START_DAY:{type:"integer",access:"rw",min:1,
  max:31,unit:"day"},PARTY_START_MONTH:{type:"integer",access:"rw",min:1,max:12,unit:"month"},PARTY_START_YEAR:{type:"integer",access:"rw",min:0,max:99,unit:"year"},PARTY_STOP_TIME:{type:"integer",access:"rw",min:0,max:1410,unit:"minutes"},PARTY_STOP_DAY:{type:"integer",access:"rw",min:1,max:31,unit:"day"},PARTY_STOP_MONTH:{type:"integer",access:"rw",min:1,max:12,unit:"month"},PARTY_STOP_YEAR:{type:"integer",access:"rw",min:0,max:99,unit:"year"}}]},CLIMATECONTROL_REGULATOR:{_level:14,datapoints:[{SETPOINT:{type:"float",
  access:"rwe",min:6,max:30,unit:"\u00b0C",special:{"0.0":"VENT_CLOSED","100.0":"VENT_OPEN"}},ADJUSTING_COMMAND:{type:"integer",access:"re",min:0,max:4},ADJUSTING_DATA:{type:"integer",access:"re",min:0,max:250},STATE:{type:"boolean",access:"w"}}]},CLIMATECONTROL_VENT_DRIVE:{_level:15,datapoints:[{VALVE_STATE:{type:"integer",access:"re",min:0,max:99,unit:"%"},ERROR:{type:"option",access:"re",values:{0:"NO_ERROR",1:"VALVE_DRIVE_BLOCKED",2:"VALVE_DRIVE_LOOSE",3:"ADJUSTING_RANGE_TO_SMALL",4:"LOWBAT"}}}]},
  SIGNAL_LED:{_level:16,datapoints:[{STATE:{type:"boolean",access:"rwe"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"w"}},{STATE:{type:"boolean",access:"rwe"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"w"},SUBMIT:{type:"string",access:"w"}}]},
  SIGNAL_CHIME:{_level:17,datapoints:[{STATE:{type:"boolean",access:"rwe"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"w"}},{STATE:{type:"boolean",access:"rwe"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"w"},SUBMIT:{type:"string",access:"w"}}]},
  WEATHER:{_level:18,datapoints:[{TEMPERATURE:{type:"float",access:"re",min:-40,max:80,unit:"\u00b0C"}},{TEMPERATURE:{type:"float",access:"re",min:-150,max:150,unit:"\u00b0C"},LOWBAT:{type:"boolean",access:"re"}},{TEMPERATURE:{type:"float",access:"re",min:-40,max:80,unit:"\u00b0C"},HUMIDITY:{type:"integer",access:"re",min:0,max:99,unit:"%"}},{TEMPERATURE:{type:"float",access:"re",min:-40,max:80,unit:"\u00b0C"},HUMIDITY:{type:"integer",access:"re",min:0,max:99,unit:"%"},AIR_PRESSURE:{type:"integer",
  access:"re",min:500,max:1100,unit:"hPa"}},{TEMPERATURE:{type:"float",access:"re",min:-40,max:80,unit:"\u00b0C"},HUMIDITY:{type:"integer",access:"re",min:0,max:99,unit:"%"},RAINING:{type:"boolean",access:"re"},RAIN_COUNTER:{type:"float",access:"re",min:0,max:9666.265,unit:"mm"},WIND_SPEED:{type:"float",access:"re",min:0,max:1638.3,unit:"km/h"},WIND_DIRECTION:{type:"integer",access:"re",min:0,max:355,unit:"degree"},WIND_DIRECTION_RANGE:{type:"integer",access:"re",min:0,max:67,unit:"degree"},SUNSHINEDURATION:{type:"integer",
  access:"re",min:0,max:255},BRIGHTNESS:{type:"integer",access:"re",min:0,max:255}}]},WEATHER_TRANSMIT:{_level:19,datapoints:[{TEMPERATURE:{type:"float",access:"re",min:-10,max:50,unit:"\u00b0C"},HUMIDITY:{type:"integer",access:"re",min:0,max:99,unit:"%"}}]},RAINDETECTOR:{_level:20,datapoints:[{STATE:{type:"option",access:"re",values:{0:"DRY",1:"RAIN"}},INSTALL_TEST:{type:"action",access:"e"}}]},RAINDETECTOR_HEAT:{_level:21,datapoints:[{STATE:{type:"boolean",access:"rwe"},ON_TIME:{type:"float",access:"w",
  min:0,max:8.58259456E7,unit:"s"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"e"}}]},ROTARY_HANDLE_SENSOR:{_level:22,datapoints:[{STATE:{type:"option",access:"re",values:{0:"CLOSED",1:"TILTED",3:"OPEN"}},ERROR:{type:"option",access:"re",values:{0:"NO_ERROR",1:"SABOTAGE"}},LOWBAT:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"e"}}]},SHUTTER_CONTACT:{_level:23,datapoints:[{STATE:{type:"boolean",access:"re"},LOWBAT:{type:"boolean",
  access:"re"},INSTALL_TEST:{type:"action",access:"e"}},{STATE:{type:"boolean",access:"re"},ERROR:{type:"option",access:"re",values:{0:"NO_ERROR",1:"SABOTAGE"}},LOWBAT:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"e"}},{STATE:{type:"boolean",access:"re"}}]},SENSOR_FOR_CARBON_DIOXIDE:{_level:24,datapoints:[{STATE:{type:"option",access:"re",values:{0:"LEVEL_NORMAL",1:"LEVEL_ADDED",2:"LEVEL_ADDED_STRONG"}},INSTALL_TEST:{type:"action",access:"e"}}]},MOTION_DETECTOR:{_level:25,datapoints:[{BRIGHTNESS:{type:"integer",
  access:"re",min:0,max:255},NEXT_TRANSMISSION:{type:"integer",access:"rw"},MOTION:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"e"}},{BRIGHTNESS:{type:"integer",access:"re",min:0,max:255},NEXT_TRANSMISSION:{type:"integer",access:"rw"},MOTION:{type:"boolean",access:"re"},ERROR:{type:"option",access:"re",values:{0:"NO_ERROR",1:"SABOTAGE"}},INSTALL_TEST:{type:"action",access:"e"}}]},SMOKE_DETECTOR:{_level:26,datapoints:[{STATE:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",
  access:"e"}},{STATE:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"e"},LOWBAT:{type:"boolean",access:"re"}}]},ALARMACTUATOR:{_level:27,datapoints:[{STATE:{type:"boolean",access:"rwe"},ERROR_POWER:{type:"option",access:"re",values:{0:"NO_ERROR",1:"POWER_FAILURE"}},ERROR_SABOTAGE:{type:"option",access:"re",values:{0:"NO_ERROR",1:"SABOTAGE"}},ERROR_BATTERY:{type:"option",access:"re",values:{0:"NO_ERROR",1:"BATTERY_DEFECT"}},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},
  INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},LOWBAT:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"w"}}]},PULSE_SENSOR:{_level:28,datapoints:[{SEQUENCE_OK:{type:"action",access:"we"},INSTALL_TEST:{type:"action",access:"e"}}]},CAPACITIVE_FILLING_LEVEL_SENSOR:{_level:29,datapoints:[{FILLING_LEVEL:{type:"integer",access:"re",min:0,max:100,unit:"%"},INSTALL_TEST:{type:"action",access:"e"}}]},TILT_SENSOR:{_level:30,datapoints:[{STATE:{type:"boolean",access:"re"},
  LOWBAT:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"e"}}]},WATERDETECTIONSENSOR:{_level:31,datapoints:[{STATE:{type:"option",access:"re",values:{0:"DRY",1:"WET",2:"WATER"}},LOWBAT:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"e"}}]},AKKU:{_level:32,datapoints:[{LEVEL:{type:"float",access:"re",min:0,max:1,unit:"100%"},STATUS:{type:"option",access:"re",values:{0:"TRICKLE_CHARGE",1:"CHARGE",2:"DISCHARGE",3:"STATE_UNKNOWN"}}}]},DIGITAL_OUTPUT:{_level:33,datapoints:[{STATE:{type:"boolean",
  access:"rwe"}}]},DIGITAL_ANALOG_OUTPUT:{_level:34,datapoints:[{STATE:{type:"boolean",access:"rwe"},FREQUENCY:{type:"float",access:"rwe",min:0,max:5E4,unit:"mHz"}}]},DIGITAL_INPUT:{_level:35,datapoints:[{STATE:{type:"boolean",access:"rwe"},FREQUENCY:{type:"float",access:"re",min:0,max:35E4,unit:"mHz"}}]},DIGITAL_ANALOG_INPUT:{_level:36,datapoints:[{STATE:{type:"boolean",access:"rwe"},VALUE:{type:"float",access:"re",min:0,max:1E3}}]},SENSOR:{_level:37,datapoints:[{SENSOR:{type:"boolean",access:"re"},
  INSTALL_TEST:{type:"action",access:"e"}}]},POWERMETER:{_level:38,datapoints:[{BOOT:{type:"boolean",access:"re"},ENERGY_COUNTER:{type:"float",access:"re",min:0,max:838860.7,unit:"Wh"},POWER:{type:"float",access:"re",min:0,max:167772.15,unit:"W"},CURRENT:{type:"float",access:"re",min:0,max:65535,unit:"mA"},VOLTAGE:{type:"float",access:"re",min:0,max:6553.5,unit:"V"},FREQUENCY:{type:"float",access:"re",min:48.72,max:51.27,unit:"Hz"}}]},CONDITION_POWER:{_level:39,datapoints:[{DECISION_VALUE:{type:"integer",
  access:"re",min:0,max:255}}]},CONDITION_CURRENT:{_level:40,datapoints:[{DECISION_VALUE:{type:"integer",access:"re",min:0,max:255}}]},CONDITION_VOLTAGE:{_level:41,datapoints:[{DECISION_VALUE:{type:"integer",access:"re",min:0,max:255}}]},CONDITION_FREQUENCY:{_level:42,datapoints:[{DECISION_VALUE:{type:"integer",access:"re",min:0,max:255}}]},STATUS_INDICATOR:{_level:43,datapoints:[{STATE:{type:"boolean",access:"rwe"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},INHIBIT:{type:"boolean",
  access:"rwe"},WORKING:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"e"}}]},POWERMETER_IGL:{_level:44,datapoints:[{BOOT:{type:"boolean",access:"re"},GAS_ENERGY_COUNTER:{type:"float",access:"re",min:0,max:2147483.647,unit:"m3"},GAS_POWER:{type:"float",access:"re",min:0,max:16777.215,unit:"m3"},ENERGY_COUNTER:{type:"float",access:"re",min:0,max:838860.7,unit:"Wh"},POWER:{type:"float",access:"re",min:0,max:167772.15,unit:"W"}}]},RGBW_COLOR:{_level:44,datapoints:[{COLOR:{type:"integer",
  access:"rwe",min:0,max:255}}]},RGBW_AUTOMATIC:{_level:45,datapoints:[{PROGRAM:{type:"integer",access:"rwe",min:0,max:255}}]},SMOKE_DETECTOR_TEAM_V2:{_level:46,datapoints:[{STATE:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"e"}}]},MAINTENANCE:{_level:47,datapoints:[{LOWBAT:{type:"boolean",access:"re"}}]},LUXMETER:{_level:48,datapoints:[{LUX:{type:"float",access:"re",min:0,max:1E5,unit:"Lux"}}]},SWITCH_SENSOR:{_level:49,datapoints:[{STATE:{type:"boolean",access:"rwe"},ON_TIME:{type:"float",
  access:"w",min:0,max:8.58259456E7,unit:"s"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},ERROR_SABOTAGE:{type:"option",access:"re",values:{0:"NO_ERROR",1:"SABOTAGE"}},LOWBAT:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"w"}}]},SWITCH_PANIC:{_level:50,datapoints:[{STATE:{type:"boolean",access:"rwe"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},ERROR_SABOTAGE:{type:"option",
  access:"re",values:{0:"NO_ERROR",1:"SABOTAGE"}},LOWBAT:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"w"}}]},ARMING:{_level:51,datapoints:[{ARMSTATE:{type:"option",access:"rwe",values:{0:"DISARMED",1:"EXTSENS_ARMED",2:"ALLSENS_ARMED",3:"ALARM_BLOCKED"}},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},ERROR_SABOTAGE:{type:"option",access:"re",values:{0:"NO_ERROR",1:"SABOTAGE"}},LOWBAT:{type:"boolean",
  access:"re"},INSTALL_TEST:{type:"action",access:"w"}}]},SMOKE_DETECTOR_TEAM:{_level:52,datapoints:[{STATE:{type:"boolean",access:"re"},INSTALL_TEST:{type:"action",access:"e"}}]},JALOUSIE:{_level:53,datapoints:[{LEVEL:{type:"float",access:"rwe",min:0,max:1,unit:"100%"},STOP:{type:"action",access:"w"},INHIBIT:{type:"boolean",access:"rwe"},WORKING:{type:"boolean",access:"re"},DIRECTION:{type:"option",access:"re",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},INSTALL_TEST:{type:"action",access:"w"},
  LEVEL_SLATS:{type:"float",access:"rwe",min:0,max:1,unit:"100%"},WORKING_SLATS:{type:"boolean",access:"re"},DIRECTION_SLATS:{type:"option",access:"re",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},LEVEL_COMBINED:{type:"string",access:"w"}}]},MOD_EM8BIT_TRANSMITTER:{_level:54,datapoints:[{STATE:{type:"integer",access:"re",min:0,max:255},LOWBAT:{type:"boolean",access:"re"}}]},DUAL_WHITE_BRIGHTNESS:{_level:55,datapoints:[{DIRECTION:{type:"option",access:"re",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},
  ERROR_OVERHEAT:{type:"boolean",access:"re"},ERROR_REDUCED:{type:"boolean",access:"re"},INHIBIT:{type:"boolean",access:"rwe"},INSTALL_TEST:{type:"action",access:"w"},LEVEL:{type:"float",access:"rwe",min:0,max:1,unit:"100%"},LEVEL_REAL:{type:"float",access:"re",min:0,max:1,unit:"100%"},OLD_LEVEL:{type:"action",access:"w"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},RAMP_STOP:{type:"action",access:"w"},RAMP_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},WORKING:{type:"boolean",
  access:"re"}}]},DUAL_WHITE_COLOR:{_level:56,datapoints:[{DIRECTION:{type:"option",access:"re",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}},INHIBIT:{type:"boolean",access:"rwe"},INSTALL_TEST:{type:"action",access:"w"},LEVEL:{type:"float",access:"rwe",min:0,max:1,unit:"100%"},LEVEL_REAL:{type:"float",access:"re",min:0,max:1,unit:"100%"},OLD_LEVEL:{type:"action",access:"w"},ON_TIME:{type:"float",access:"w",min:0,max:8.58259456E7,unit:"s"},RAMP_STOP:{type:"action",access:"w"},RAMP_TIME:{type:"float",
  access:"w",min:0,max:8.58259456E7,unit:"s"},WORKING:{type:"boolean",access:"re"}}]}};
  xnm.aio.hm.MAP={KEY:{PRESS_SHORT:{command:[{type:"enum",name:"short press",ref:{value:"pressShort"}}]},PRESS_LONG:{command:[{type:"enum",name:"long press",ref:{value:"pressLong"}}]},SUBMIT:{command:[{type:"string",name:"set value",ref:{value:"setValue",ext:"%s"}}]},LED_STATUS:{command:[{type:"enum",name:"off",ref:{value:"ledOff"}},{type:"enum",name:"red",ref:{value:"ledRed"}},{type:"enum",name:"green",ref:{value:"ledGreen"}},{type:"enum",name:"orange",ref:{value:"ledOrange"}}],status:[{type:"enum",
  name:"led status",ref:{value:"ledStatus",options:["off","red","green","orange"]}}]},ALL_LEDS:{command:[{type:"string",name:"set value",ref:{value:"setAllLed",ext:"%s"}}]},LED_SLEEP_MODE:{command:[{type:"enum",name:"led sleep mode off",ref:{value:"sleepModeOff"}},{type:"enum",name:"led sleep mode on",ref:{value:"sleepModeOn"}}]}},CENTRAL_KEY:{PRESS_SHORT:{command:[{type:"enum",name:"short press",ref:{value:"pressShort"}}]},PRESS_LONG:{command:[{type:"enum",name:"long press",ref:{value:"pressLong"}}]}},
  VIRTUAL_KEY:{PRESS_SHORT:{command:[{type:"enum",name:"short press",ref:{value:"pressShort"}}]},PRESS_LONG:{command:[{type:"enum",name:"long press",ref:{value:"pressLong"}}]}},INPUT_OUTPUT:{STATE:{command:[{type:"enum",name:"on",ref:{value:"on"}},{type:"enum",name:"off",ref:{value:"off"}},{type:"enum",name:"toggle",ref:{value:"toggle"}},{type:"float",name:"on for",ref:{value:"onFor",ext:"%f",unit:"s"}}],status:[{type:"enum",name:"status",ref:{value:"inoutState",options:["off","on"]}}]},PRESS_SHORT:{command:[{type:"enum",
  name:"short press",ref:{value:"pressShort"}}]},PRESS_LONG:{command:[{type:"enum",name:"long press",ref:{value:"pressLong"}}]}},SWITCH:{STATE:{command:[{type:"enum",name:"on",ref:{value:"on"}},{type:"enum",name:"off",ref:{value:"off"}},{type:"enum",name:"toggle",ref:{value:"toggle"}},{type:"float",name:"on for",ref:{value:"onFor",ext:"%f",unit:"s"}}],status:[{type:"enum",name:"switch status",ref:{value:"switchState",options:["off","on"]}}]}},SWITCH_INTERFACE:{PRESS:{command:[{type:"enum",name:"press",
  ref:{value:"press"}}]}},DIMMER:{LEVEL:{command:[{type:"enum",name:"off",ref:{value:"dimOff"}},{type:"enum",name:"dim up",ref:{value:"dimUp"}},{type:"enum",name:"dim down",ref:{value:"dimDown"}},{type:"enum",name:"dim to",ref:{value:"dimTo",ext:"%d",extMeta:"0-100"}},{type:"int",name:"dim to",ref:{value:"dimRaw",ext:"%d",extMeta:"0-100"}},{type:"enum",name:"toggle to",ref:{value:"toggleTo",ext:"%e",extMeta:"10% 20% 30% 40% 50% 60% 70% 80% 90% 100%".split(" ")}}],status:[{type:"int",name:"dimmer status",
  ref:{value:"dimmerLevel"}}]},OLD_LEVEL:{command:[{type:"enum",name:"on",ref:{value:"dimOn"}}]},DIRECTION:{status:[{type:"enum",name:"dim direction",ref:{value:"dimmerDirection",options:["none","up","down","undefined"]}}]}},VIRTUAL_DIMMER:{LEVEL:{command:[{type:"enum",name:"off",ref:{value:"dimOff"}},{type:"enum",name:"dim up",ref:{value:"dimUp"}},{type:"enum",name:"dim down",ref:{value:"dimDown"}},{type:"enum",name:"dim to",ref:{value:"dimTo",ext:"%d",extMeta:"0-100"}},{type:"int",name:"dim to",ref:{value:"dimRaw",
  ext:"%d",extMeta:"0-100"}},{type:"enum",name:"toggle to",ref:{value:"toggleTo",ext:"%e",extMeta:"10% 20% 30% 40% 50% 60% 70% 80% 90% 100%".split(" ")}}],status:[{type:"int",name:"dimmer status",ref:{value:"dimmerLevel"}}]},OLD_LEVEL:{command:[{type:"enum",name:"on",ref:{value:"dimOn"}}]},DIRECTION:{status:[{type:"enum",name:"dim direction",ref:{value:"dimmerDirection",options:["none","up","down","undefined"]}}]}},BLIND:{LEVEL:{command:[{type:"enum",name:"move up",ref:{value:"blindUp"}},{type:"enum",
  name:"move down",ref:{value:"blindDown"}},{type:"enum",name:"step up",ref:{value:"blindStepUp"}},{type:"enum",name:"step down",ref:{value:"blindStepDown"}},{type:"enum",name:"move to",ref:{value:"blindTo",ext:"%d",extMeta:"0-100"}},{type:"int",name:"move to",ref:{value:"blindRaw",ext:"%d",extMeta:"0-100"}}],status:[{type:"int",name:"blind status",ref:{value:"blindLevel"}},{type:"enum",name:"position description",ref:{value:"blindPosDes",options:["top","middle","bottom"]}}]},STOP:{command:[{type:"enum",
  name:"stop",ref:{value:"blindStop"}}]},DIRECTION:{status:[{type:"enum",name:"blind direction",ref:{value:"blindDirection",options:["none","up","down","undefined"]}}]}},KEYMATIC:{STATE:{command:[{type:"enum",name:"unlock",ref:{value:"keyOpen"}},{type:"enum",name:"lock",ref:{value:"keyLock"}}],status:[{type:"enum",name:"lock status",ref:{value:"keyState",options:["open","lock"]}}]},OPEN:{command:[{type:"enum",name:"open",ref:{value:"keyOpenDo"}}]}},WINMATIC:{LEVEL:{command:[{type:"enum",name:"move up",
  ref:{value:"windowUp"}},{type:"enum",name:"move down",ref:{value:"windowDown"}},{type:"enum",name:"move to",ref:{value:"windowTo",ext:"%d",extMeta:"0-100"}},{type:"enum",name:"lock",ref:{value:"winLock"}},{type:"int",name:"move to",ref:{value:"windowRaw",ext:"%d",extMeta:"0-100"}}],status:[{type:"int",name:"window status",ref:{value:"winLevel"}}]},STOP:{command:[{type:"enum",name:"stop",ref:{value:"winStop"}}]},DIRECTION:{status:[{type:"enum",name:"window direction",ref:{value:"winDirection",options:["none",
  "up","down","undefined"]}}]},ERROR:{status:[{type:"enum",name:"window error",ref:{value:"winError",options:["no_error","motor_turn_error","motor_tilt_error"]}}]}},CLIMATECONTROL_RT_TRANSCEIVER:{CONTROL_MODE:{status:[{type:"enum",name:"mode",ref:{value:"themoMode",options:["auto","manu","party","boost"]}}]},FAULT_REPORTING:{status:[{type:"enum",name:"fault reporting",ref:{value:"themoFault",options:"no_fault valve_tight adjusting_range_too_large adjusting_range_too_small communication_error low_bat valve_error_position".split(" ")}},
  {type:"enum",name:"low battery",ref:{value:"themoLowbat",options:["true","false"]}}]},BATTERY_STATE:{status:[{type:"float",name:"battery state",ref:{value:"themoBattery"}}]},VALVE_STATE:{status:[{type:"int",name:"valve state",ref:{value:"themoValve"}}]},BOOST_STATE:{status:[{type:"int",name:"boost state",ref:{value:"themoBoost"}}]},ACTUAL_TEMPERATURE:{status:[{type:"float",name:"actual temperature",ref:{value:"themoActualTemp",extMeta:"-10.0-56.0",scale:"0.1"}}]},ACTUAL_HUMIDITY:{status:[{type:"float",
  name:"actual humidity",ref:{value:"themoActualHum"}}]},SET_TEMPERATURE:{command:[{type:"enum",name:"temperature up",ref:{value:"themoTempUp"}},{type:"enum",name:"temperature down",ref:{value:"themoTempDown"}},{type:"enum",name:"off",ref:{value:"themoTempOff"}},{type:"float",name:"temperature to",ref:{value:"themoTempRaw",ext:"%f",extMeta:"4.5-30.5",scale:"0.5"}}],status:[{type:"float",name:"set temperature",ref:{value:"themoSetTemp",extMeta:"4.5-30.5",scale:"0.5"}}]},AUTO_MODE:{command:[{type:"enum",
  name:"set auto mode",ref:{value:"themoAutoMode"}}]},MANU_MODE:{command:[{type:"enum",name:"set manual mode",ref:{value:"themoManuMode",ext:"%f",extMeta:"4.5-30.5"}}]},BOOST_MODE:{command:[{type:"enum",name:"set boost mode",ref:{value:"themoBoostMode"}}]},COMFORT_MODE:{command:[{type:"enum",name:"set comfort mode",ref:{value:"themoComfortMode"}}]},LOWERING_MODE:{command:[{type:"enum",name:"set lowering mode",ref:{value:"themoLoweringMode"}}]},WINDOW_STATE:{status:[{type:"enum",name:"window state",
  ref:{value:"themoWinState",options:["open","close"]}}]}},THERMALCONTROL_TRANSMIT:{CONTROL_MODE:{status:[{type:"enum",name:"mode",ref:{value:"themoTMode",options:["auto","manu","party","boost"]}}]},LOWBAT_REPORTING:{status:[{type:"enum",name:"low battery",ref:{value:"themoTLowbat",options:["true","false"]}}]},COMMUNICATION_REPORTING:{status:[{type:"enum",name:"communication",ref:{value:"themoTComm",options:["true","false"]}}]},WINDOW_OPEN_REPORTING:{status:[{type:"enum",name:"window open",ref:{value:"themoTWin",
  options:["open","close"]}}]},BATTERY_STATE:{status:[{type:"float",name:"battery state",ref:{value:"themoTBattery",extMeta:"1.5-4.6",scale:"0.1"}}]},BOOST_STATE:{status:[{type:"int",name:"boost state",ref:{value:"themoTBoost"}}]},ACTUAL_TEMPERATURE:{status:[{type:"float",name:"actual temperature",ref:{value:"themoTActualTemp",extMeta:"-10.0-50.0",scale:"0.1"}}]},ACTUAL_HUMIDITY:{status:[{type:"int",name:"actual humidity",ref:{value:"themoTActualHum"}}]},SET_TEMPERATURE:{command:[{type:"enum",name:"temperature up",
  ref:{value:"themoTTempUp"}},{type:"enum",name:"temperature down",ref:{value:"themoTTempDown"}},{type:"enum",name:"off",ref:{value:"themoTTempOff"}},{type:"float",name:"temperature to",ref:{value:"themoTTempRaw",ext:"%f",extMeta:"4.5-30.5",scale:"0.5"}}],status:[{type:"float",name:"set temperature",ref:{value:"themoTSetTemp",extMeta:"4.5-30.5",scale:"0.5"}}]},AUTO_MODE:{command:[{type:"enum",name:"set auto mode",ref:{value:"themoTAutoMode"}}]},MANU_MODE:{command:[{type:"enum",name:"set manual mode",
  ref:{value:"themoTManuMode",ext:"%f",extMeta:"4.5-30.5"}}]},BOOST_MODE:{command:[{type:"enum",name:"set boost mode",ref:{value:"themoTBoostMode"}}]},COMFORT_MODE:{command:[{type:"enum",name:"set comfort mode",ref:{value:"themoTComfortMode"}}]},LOWERING_MODE:{command:[{type:"enum",name:"set lowering mode",ref:{value:"themoTLoweringMode"}}]}},CLIMATECONTROL_REGULATOR:{SETPOINT:{command:[{type:"enum",name:"temperature up",ref:{value:"themoRTempUp"}},{type:"enum",name:"temperature down",ref:{value:"themoRTempDown"}},
  {type:"enum",name:"close",ref:{value:"themoRTempClose"}},{type:"float",name:"temperature to",ref:{value:"themoRTempRaw",ext:"%f",extMeta:"6-30",scale:"0.5"}}],status:[{type:"float",name:"set temperature",ref:{value:"themoRSetTemp",extMeta:"6-30",scale:"0.5"}}]}},CLIMATECONTROL_VENT_DRIVE:{VALVE_STATE:{status:[{type:"int",name:"valve state",ref:{value:"valveState"}}]},ERROR:{status:[{type:"enum",name:"valve error",ref:{value:"valveError",options:["no_error","valve_drive_blocked","valve_drive_loose",
  "adjusting_range_to_small","low_bat"]}}]}},SIGNAL_LED:{STATE:{command:[{type:"enum",name:"led on",ref:{value:"signalLedOn"}},{type:"enum",name:"led off",ref:{value:"signalLedOff"}},{type:"enum",name:"led toggle",ref:{value:"signalLedToggle"}}],status:[{type:"enum",name:"led state",ref:{value:"signalLedState",options:["on","off"]}}]},SUBMIT:{command:[{type:"string",name:"set led",ref:{value:"setSignalLed",ext:"%s"}}]}},SIGNAL_CHIME:{STATE:{command:[{type:"enum",name:"chime on",ref:{value:"signalChimeOn"}},
  {type:"enum",name:"chime off",ref:{value:"signalChimeOff"}},{type:"enum",name:"chime toggle",ref:{value:"signalChimeToggle"}}],status:[{type:"enum",name:"chime state",ref:{value:"signalChimeState",options:["on","off"]}}]},SUBMIT:{command:[{type:"string",name:"set chime",ref:{value:"setSignalChime",ext:"%s"}}]}},WEATHER:{TEMPERATURE:{status:[{type:"float",name:"temperature",ref:{value:"weatherTemp",extMeta:"-40.0-80.0",scale:"0.1"}}]},HUMIDITY:{status:[{type:"int",name:"humidity",ref:{value:"weatherHum"}}]},
  AIR_PRESSURE:{status:[{type:"int",name:"air pressure",ref:{value:"weatherAirP"}}]},LOWBAT:{status:[{type:"enum",name:"low battery",ref:{value:"weatherLowbat",options:["true","false"]}}]},RAINING:{status:[{type:"enum",name:"raining",ref:{value:"weatherRaining",options:["true","false"]}}]},RAIN_COUNTER:{status:[{type:"float",name:"rain counter",ref:{value:"weatherRainCounter",extMeta:"0.0-9666.265",scale:"0.01"}}]},WIND_SPEED:{status:[{type:"float",name:"wind speed",ref:{value:"weatherWindS",extMeta:"0.0-1638.3",
  scale:"0.1"}}]},WIND_DIRECTION:{status:[{type:"enum",name:"wind direction",ref:{value:"weatherWindD",options:"N NO O SO S SW W NW".split(" ")}},{type:"int",name:"wind direction degree",ref:{value:"weatherWindDRaw",extMeta:"0-355"}}]},WIND_DIRECTION_RANGE:{status:[{type:"int",name:"wind direction range",ref:{value:"weatherWindDRRaw",extMeta:"0-67"}}]},SUNSHINEDURATION:{status:[{type:"int",name:"sunshine duration",ref:{value:"weatherSunD"}}]},BRIGHTNESS:{status:[{type:"int",name:"brightness",ref:{value:"weatherBright"}}]}},
  WEATHER_TRANSMIT:{TEMPERATURE:{status:[{type:"float",name:"temperature",ref:{value:"weatherTTemp",extMeta:"-10.0-50.0",scale:"0.1"}}]},HUMIDITY:{status:[{type:"int",name:"humidity",ref:{value:"weatherTHum"}}]}},RAINDETECTOR:{STATE:{status:[{type:"enum",name:"rain state",ref:{value:"rainState",options:["dry","rain"]}}]}},RAINDETECTOR_HEAT:{STATE:{command:[{type:"enum",name:"on",ref:{value:"rainHeatOn"}},{type:"enum",name:"off",ref:{value:"rainHeatOff"}},{type:"enum",name:"toggle",ref:{value:"rainHeatToggle"}}],
  status:[{type:"enum",name:"heater state",ref:{value:"rainHeatState",options:["on","off"]}}]}},ROTARY_HANDLE_SENSOR:{STATE:{status:[{type:"enum",name:"handle state",ref:{value:"handleState",options:["closed","tilted","open"]}}]},ERROR:{status:[{type:"enum",name:"handle error",ref:{value:"handleError",options:["no_error","sabotage"]}}]},LOWBAT:{status:[{type:"enum",name:"handle low battery",ref:{value:"handleLowbat",options:["true","false"]}}]}},SHUTTER_CONTACT:{STATE:{status:[{type:"enum",name:"shutter state",
  ref:{value:"shutterState",options:["closed","open"]}}]},ERROR:{status:[{type:"enum",name:"shutter error",ref:{value:"shutterError",options:["no_error","sabotage"]}}]},LOWBAT:{status:[{type:"enum",name:"shutter low battery",ref:{value:"shutterLowbat",options:["true","false"]}}]}},SENSOR_FOR_CARBON_DIOXIDE:{STATE:{status:[{type:"enum",name:"co2 state",ref:{value:"co2State",options:["normal","added","added_strong"]}}]}},MOTION_DETECTOR:{BRIGHTNESS:{status:[{type:"int",name:"brightness",ref:{value:"motionBright"}}]},
  MOTION:{status:[{type:"enum",name:"state",ref:{value:"motionState",options:["on","off"]}}]},ERROR:{status:[{type:"enum",name:"error",ref:{value:"motionError",options:["no_error","sabotage"]}}]}},SMOKE_DETECTOR:{STATE:{status:[{type:"enum",name:"state",ref:{value:"smokeState",options:["on","off"]}}]},LOWBAT:{status:[{type:"enum",name:"battery low",ref:{value:"smokeLowbat",options:["true","false"]}}]}},SMOKE_DETECTOR_TEAM:{STATE:{status:[{type:"enum",name:"state",ref:{value:"smokeGroup1State",options:["on",
  "off"]}}]}},SMOKE_DETECTOR_TEAM_V2:{STATE:{status:[{type:"enum",name:"state",ref:{value:"smokeGroupState",options:["on","off"]}}]}},ALARMACTUATOR:{STATE:{command:[{type:"enum",name:"on",ref:{value:"alarmOn"}},{type:"enum",name:"off",ref:{value:"alarmOff"}},{type:"enum",name:"toggle",ref:{value:"alarmToggle"}}],status:[{type:"enum",name:"state",ref:{value:"alarmState",options:["on","off"]}}]},ERROR_POWER:{status:[{type:"enum",name:"power error",ref:{value:"alarmErrPower",options:["no_error","power_failure"]}}]},
  ERROR_SABOTAGE:{status:[{type:"enum",name:"sabotage error",ref:{value:"alarmErrSabo",options:["no_error","sabotage"]}}]},ERROR_BATTERY:{status:[{type:"enum",name:"battery error",ref:{value:"alarmErrBat",options:["no_error","barttery_defect"]}}]},LOWBAT:{status:[{type:"enum",name:"battery low",ref:{value:"alarmLowbat",options:["true","false"]}}]}},PULSE_SENSOR:{SEQUENCE_OK:{command:[{type:"enum",name:"sequence ok",ref:{value:"seqOk"}}]}},CAPACITIVE_FILLING_LEVEL_SENSOR:{FILLING_LEVEL:{status:[{type:"int",
  name:"level",ref:{value:"fillingLevel"}}]}},TILT_SENSOR:{STATE:{status:[{type:"enum",name:"state",ref:{value:"tiltState",options:["on","off"]}}]},LOWBAT:{status:[{type:"enum",name:"battery low",ref:{value:"tiltLowbat",options:["true","false"]}}]}},WATERDETECTIONSENSOR:{STATE:{status:[{type:"enum",name:"state",ref:{value:"waterState",options:["dry","wet","water"]}}]},LOWBAT:{status:[{type:"enum",name:"battery low",ref:{value:"waterLowbat",options:["true","false"]}}]}},AKKU:{LEVEL:{status:[{type:"float",
  name:"level",ref:{value:"akkuLevel",extMeta:"0.0-1.0",scale:"0.1"}}]},STATUS:{status:[{type:"enum",name:"status",ref:{value:"akkuStatus",options:["trickle_charge","charge","discharge","state_unknow"]}}]}},DIGITAL_OUTPUT:{STATE:{command:[{type:"enum",name:"on",ref:{value:"digOutOn"}},{type:"enum",name:"off",ref:{value:"digOutOff"}},{type:"enum",name:"toggle",ref:{value:"digOutToggle"}}],status:[{type:"enum",name:"state",ref:{value:"digOutState",options:["on","off"]}}]}},DIGITAL_ANALOG_OUTPUT:{STATE:{command:[{type:"enum",
  name:"on",ref:{value:"daOutOn"}},{type:"enum",name:"off",ref:{value:"daOutOff"}},{type:"enum",name:"toggle",ref:{value:"daOutToggle"}}],status:[{type:"enum",name:"state",ref:{value:"daOutState",options:["on","off"]}}]},FREQUENCY:{command:[{type:"enum",name:"set frequency",ref:{value:"setOutFreq",ext:"%f"}},{type:"float",name:"set frequency",ref:{value:"setOutFreqRaw",ext:"%f",extMeta:"0.0-50000.0",scale:"0.1"}}],status:[{type:"float",name:"state",ref:{value:"daOutFreq",extMeta:"0.0-50000.0",scale:"0.1"}}]}},
  DIGITAL_INPUT:{FREQUENCY:{status:[{type:"float",name:"freq state",ref:{value:"digInFreq",extMeta:"0.0-350000.0",scale:"0.1"}}]},STATE:{status:[{type:"enum",name:"on/off state",ref:{value:"digInState",options:["on","off"]}}]}},DIGITAL_ANALOG_INPUT:{VALUE:{status:[{type:"float",name:"state",ref:{value:"daInValue",extMeta:"0.0-1000.0",scale:"0.1"}}]},STATE:{status:[{type:"enum",name:"on/off state",ref:{value:"daInState",options:["on","off"]}}]}},SENSOR:{SENSOR:{status:[{type:"enum",name:"state",ref:{value:"sensorState",
  options:["on","off"]}}]}},POWERMETER:{BOOT:{status:[{type:"enum",name:"boot status",ref:{value:"meterBoot",options:["true","false"]}}]},ENERGY_COUNTER:{status:[{type:"float",name:"energy counter",ref:{value:"meterEnergyCounter",extMeta:"0.0-838860.7",scale:"0.1"}}]},POWER:{status:[{type:"float",name:"power",ref:{value:"meterPower",extMeta:"0.0-167772.15",scale:"0.01"}}]},CURRENT:{status:[{type:"float",name:"current",ref:{value:"meterCurrent",extMeta:"0.0-65535.0",scale:"0.1"}}]},VOLTAGE:{status:[{type:"float",
  name:"voltage",ref:{value:"meterVoltage",extMeta:"0.0-6553.5",scale:"0.1"}}]},FREQUENCY:{status:[{type:"float",name:"frequency",ref:{value:"meterFrequency",extMeta:"48.72-51.27",scale:"0.01"}}]}},POWERMETER_IGL:{BOOT:{status:[{type:"enum",name:"boot status",ref:{value:"iglBoot",options:["true","false"]}}]},GAS_ENERGY_COUNTER:{status:[{type:"float",name:"gas energy counter",ref:{value:"iglGasEnergy",extMeta:"0.000-2147483.647",scale:"0.001"}}]},GAS_POWER:{status:[{type:"float",name:"gas power",ref:{value:"iglGasPower",
  extMeta:"0.00-16777.215",scale:"0.01"}}]},ENERGY_COUNTER:{status:[{type:"float",name:"energy counter",ref:{value:"iglEnergy",extMeta:"0.0-838860.7",scale:"0.1"}}]},POWER:{status:[{type:"float",name:"power",ref:{value:"iglPower",extMeta:"0.00-167772.15",scale:"0.01"}}]}},RGBW_COLOR:{COLOR:{command:[{type:"int",name:"color",ref:{value:"color",ext:"%d",extMeta:"0-255"}},{type:"enum",name:"white",ref:{value:"white"}},{type:"rgb",name:"rgb color",ref:{value:"rgb",ext:"%s"}}],status:[{type:"int",name:"color",
  ref:{value:"colorState",extMeta:"0-255"}}]}},RGBW_AUTOMATIC:{PROGRAM:{command:[{type:"int",name:"program",ref:{value:"program",ext:"%d",extMeta:"0-255"}}],status:[{type:"int",name:"program",ref:{value:"programState",extMeta:"0-255"}}]}},STATUS_INDICATOR:{STATE:{command:[{type:"enum",name:"on",ref:{value:"statusIndiOn"}},{type:"enum",name:"off",ref:{value:"statusIndiOff"}},{type:"enum",name:"toggle",ref:{value:"statusIndiToggle"}}],status:[{type:"enum",name:"state",ref:{value:"statusIndiState",options:["on",
  "off"]}}]}},MAINTENANCE:{LOWBAT:{status:[{type:"enum",name:"battery low",ref:{value:"maintLowbat",options:["true","false"]}}]}},LUXMETER:{LUX:{status:[{type:"float",name:"light intensity",ref:{value:"luxState",extMeta:"0.00-100000.00",scale:"0.01"}}]}},SWITCH_SENSOR:{STATE:{command:[{type:"enum",name:"on",ref:{value:"switchSensorOn"}},{type:"enum",name:"off",ref:{value:"switchSensorOff"}},{type:"enum",name:"toggle",ref:{value:"switchSensorToggle"}}],status:[{type:"enum",name:"status",ref:{value:"switchSensorState",
  options:["off","on"]}}]}},SWITCH_PANIC:{STATE:{command:[{type:"enum",name:"on",ref:{value:"switchPanicOn"}},{type:"enum",name:"off",ref:{value:"switchPanicOff"}},{type:"enum",name:"toggle",ref:{value:"switchPanicToggle"}}],status:[{type:"enum",name:"status",ref:{value:"switchPanicState",options:["off","on"]}}]}},ARMING:{STATE:{command:[{type:"enum",name:"disarmed",ref:{value:"armingDisarm"}},{type:"enum",name:"internal armed",ref:{value:"armingIntern"}},{type:"enum",name:"all armed",ref:{value:"armingAll"}},
  {type:"enum",name:"block alarm",ref:{value:"armingBlock"}}],status:[{type:"enum",name:"status",ref:{value:"armingState",options:["disarmed","internal_armed","all_armed","alarm_blocked"]}}]},ERROR_SABOTAGE:{status:[{type:"enum",name:"sabotage error",ref:{value:"armingErrSabo",options:["no_error","sabotage"]}}]},LOWBAT:{status:[{type:"enum",name:"low battery",ref:{value:"armingLowbat",options:["true","false"]}}]}},JALOUSIE:{LEVEL:{command:[{type:"enum",name:"move up",ref:{value:"jalUp"}},{type:"enum",
  name:"move down",ref:{value:"jalDown"}},{type:"enum",name:"step up",ref:{value:"jalStepUp"}},{type:"enum",name:"step down",ref:{value:"jalStepDown"}},{type:"int",name:"move to",ref:{value:"jalRaw",ext:"%d",extMeta:"0-100"}}],status:[{type:"int",name:"status",ref:{value:"jalLevel"}},{type:"enum",name:"position description",ref:{value:"jalPosDes",options:["top","middle","bottom"]}}]},STOP:{command:[{type:"enum",name:"stop",ref:{value:"jalStop"}}]},DIRECTION:{status:[{type:"enum",name:"direction",ref:{value:"jalDirection",
  options:["none","up","down","undefined"]}}]},LEVEL_SLATS:{command:[{type:"enum",name:"lamella up",ref:{value:"jalLmlUp"}},{type:"enum",name:"lamella down",ref:{value:"jalLmlDown"}},{type:"int",name:"lamella step up",ref:{value:"jalLmlStepUp",ext:"%d",extMeta:"5-50"}},{type:"int",name:"lamella step down",ref:{value:"jalLmlStepDown",ext:"%d",extMeta:"5-50"}},{type:"int",name:"lamella to",ref:{value:"jalLmlRaw",ext:"%d",extMeta:"0-100"}}],status:[{type:"int",name:"lamella status",ref:{value:"jalLmlLevel"}}]}},
  SysVar:{binary:{command:[{type:"enum",name:"on",ref:{value:"binaryOn"}},{type:"enum",name:"off",ref:{value:"binaryOff"}},{type:"enum",name:"toggle",ref:{value:"binaryToggle"}}],status:[{type:"enum",name:"state",ref:{value:"binaryState",options:["on","off"]}},{type:"string",name:"mapped state",ref:{value:"mappedState"}}]},"float":{command:[{type:"float",name:"set value",ref:{value:"rawFloatValue",ext:"%f",scale:"0.1"}}],status:[{type:"float",name:"state",ref:{value:"floatState",scale:"0.1"}}]},integer:{command:[{type:"int",
  name:"set value",ref:{value:"rawIntValue",ext:"%d"}}],status:[{type:"int",name:"state",ref:{value:"intState"}},{type:"string",name:"mapped state",ref:{value:"mappedState"}}]},string:{command:[{type:"string",name:"set value",ref:{value:"rawStringValue",ext:"%s"}}],status:[{type:"string",name:"state",ref:{value:"stringState"}}]}},CCU:{command:[{type:"enum",name:"cloudmatic on",ref:{value:"cloudmaticOn"}},{type:"enum",name:"cloudmatic off",ref:{value:"cloudmaticOff"}},{type:"enum",name:"cloudmatic toggle",
  ref:{value:"cloudmaticToggle"}}],status:[{type:"string",name:"service message",ref:{value:"serviceMsg"}},{type:"string",name:"ccu time",ref:{value:"ccuTime"}},{type:"enum",name:"cloudmatic state",ref:{value:"cloudmaticState",options:["on","off"]}}]},MOD_EM8BIT_TRANSMITTER:{STATE:{status:[{type:"int",name:"status",ref:{value:"state8bit"}}]},LOWBAT:{status:[{type:"enum",name:"low battery",ref:{value:"lowbat8bit",options:["true","false"]}}]}},DUAL_WHITE_BRIGHTNESS:{DIRECTION:{status:[{type:"enum",name:"dim direction",
  ref:{value:"dualWBDirection",options:["none","up","down","undefined"]}}]},ERROR_OVERHEAT:{status:[{type:"enum",name:"overheat error",ref:{value:"dualWBErrHeat",options:["no_error","over_heat"]}}]},ERROR_REDUCED:{status:[{type:"enum",name:"reduced error",ref:{value:"dualWBErrReduced",options:["no_error","reduced"]}}]},LEVEL:{command:[{type:"enum",name:"off",ref:{value:"dualWBOff"}},{type:"enum",name:"dim up",ref:{value:"dualWBUp"}},{type:"enum",name:"dim down",ref:{value:"dualWBDown"}},{type:"int",
  name:"dim to",ref:{value:"dualWBTo",ext:"%d",extMeta:"0-100"}},{type:"int",name:"toggle to",ref:{value:"dualWBToggleTo",ext:"%d",extMeta:"1-100"}}],status:[{type:"int",name:"level status",ref:{value:"dualWBLevel"}}]},OLD_LEVEL:{command:[{type:"enum",name:"on",ref:{value:"dualWBOn"}}]}},DUAL_WHITE_COLOR:{DIRECTION:{status:[{type:"enum",name:"color direction",ref:{value:"dualWCDirection",options:["none","up","down","undefined"]}}]},LEVEL:{command:[{type:"enum",name:"color off",ref:{value:"dualWCOff"}},
  {type:"enum",name:"color up",ref:{value:"dualWCUp"}},{type:"enum",name:"color down",ref:{value:"dualWCDown"}},{type:"int",name:"color to",ref:{value:"dualWCTo",ext:"%d",extMeta:"0-100"}},{type:"int",name:"color toggle to",ref:{value:"dualWCToggleTo",ext:"%d",extMeta:"0-100"}}],status:[{type:"int",name:"color status",ref:{value:"dualWCLevel"}}]},OLD_LEVEL:{command:[{type:"enum",name:"color on",ref:{value:"dualWCOn"}}]}}};
  xnm.aio.hm.HM_Sec_Sir_WM_MAP={command:[{type:"enum",name:"internal alarm on",ref:{value:"switchSensorInOn"}},{type:"enum",name:"internal alarm off",ref:{value:"switchSensorInOff"}},{type:"enum",name:"internal alarm toggle",ref:{value:"switchSensorInToggle"}},{type:"enum",name:"external alarm on",ref:{value:"switchSensorExOn"}},{type:"enum",name:"external alarm off",ref:{value:"switchSensorExOff"}},{type:"enum",name:"external alarm toggle",ref:{value:"switchSensorExToggle"}},{type:"enum",name:"panic alarm on",
  ref:{value:"switchPanicOn"}},{type:"enum",name:"panic alarm off",ref:{value:"switchPanicOff"}},{type:"enum",name:"panic alarm toggle",ref:{value:"switchPanicToggle"}},{type:"enum",name:"disarmed",ref:{value:"armingDisarm"}},{type:"enum",name:"internal armed",ref:{value:"armingIntern"}},{type:"enum",name:"all armed",ref:{value:"armingAll"}}],status:[{type:"enum",name:"internal alarm status",ref:{value:"switchSensorInState",options:["off","on"]}},{type:"enum",name:"external alarm status",ref:{value:"switchSensorExState",
  options:["off","on"]}},{type:"enum",name:"panic alarm status",ref:{value:"switchPanicState",options:["off","on"]}},{type:"enum",name:"arming status",ref:{value:"armingState",options:["disarmed","internal_armed","all_armed","alarm_blocked"]}},{type:"enum",name:"sabotage error",ref:{value:"armingErrSabo",options:["no_error","sabotage"]}},{type:"enum",name:"low battery",ref:{value:"armingLowbat",options:["true","false"]}}]};
  xnm.aio.hm.HM_WDS30_OT2_SM_2_MAP={status:[{type:"enum",name:"battery low",ref:{value:"maintLowbat",options:["true","false"]}},{type:"float",name:"temperature 1 (T1)",ref:{value:"weatherTemp1",extMeta:"-150.0-150.0",scale:"0.1"}},{type:"float",name:"temperature 2 (T2)",ref:{value:"weatherTemp2",extMeta:"-150.0-150.0",scale:"0.1"}},{type:"float",name:"temp. differ (T1 -T2)",ref:{value:"weatherTemp3",extMeta:"-150.0-150.0",scale:"0.1"}},{type:"float",name:"temp. differ (T2 -T1)",ref:{value:"weatherTemp4",
  extMeta:"-150.0-150.0",scale:"0.1"}}]};
  xnm.aio.hm.HM_ES_TX_WM_MAP={status:[{type:"enum",name:"ch1 boot status",ref:{value:"iec1Boot",options:["true","false"]}},{type:"float",name:"ch1 gas energy counter",ref:{value:"iec1GasEnergy",extMeta:"0.000-2147483.647",scale:"0.001"}},{type:"float",name:"ch1 gas power",ref:{value:"iec1GasPower",extMeta:"0.00-16777.215",scale:"0.01"}},{type:"float",name:"ch1 energy counter",ref:{value:"iec1Energy",extMeta:"0.0-838860.7",scale:"0.1"}},{type:"float",name:"ch1 power",ref:{value:"iec1Power",extMeta:"0.00-167772.15",
  scale:"0.01"}},{type:"float",name:"ch1 iec energy counter",ref:{value:"iec1IecEnergy",extMeta:"0.0-838860.7",scale:"0.1"}},{type:"float",name:"ch1 iec power",ref:{value:"iec1IecPower",extMeta:"0.00-16777.215",scale:"0.01"}},{type:"enum",name:"ch2 boot status",ref:{value:"iec2Boot",options:["true","false"]}},{type:"float",name:"ch2 gas energy counter",ref:{value:"iec2GasEnergy",extMeta:"0.000-2147483.647",scale:"0.001"}},{type:"float",name:"ch2 gas power",ref:{value:"iec2GasPower",extMeta:"0.00-16777.215",
  scale:"0.01"}},{type:"float",name:"ch2 energy counter",ref:{value:"iec2Energy",extMeta:"0.0-838860.7",scale:"0.1"}},{type:"float",name:"ch2 power",ref:{value:"iec2Power",extMeta:"0.00-167772.15",scale:"0.01"}},{type:"float",name:"ch2 iec energy counter",ref:{value:"iec12ecEnergy",extMeta:"0.0-838860.7",scale:"0.1"}},{type:"float",name:"ch2 iec power",ref:{value:"iec2IecPower",extMeta:"0.00-16777.215",scale:"0.01"}}]};
  xnm.aio.hm.HM_MOD_EM_8BIT_MAP={command:[{type:"enum",name:"ch.1 short press",ref:{value:"ch1pressShort"}},{type:"enum",name:"ch.1 long press",ref:{value:"ch1pressLong"}},{type:"enum",name:"ch.2 short press",ref:{value:"ch2pressShort"}},{type:"enum",name:"ch.2 long press",ref:{value:"ch2pressLong"}}],status:[{type:"int",name:"state",ref:{value:"state8bit",extMeta:"0-255"}},{type:"enum",name:"low battery",ref:{value:"lowbat",options:["true","off"]}}],ipevt:[{type:"enum",name:"ch.1 short press",ref:{value:"ch1pressShort",
  options:["true"]}},{type:"enum",name:"ch.1 long press",ref:{value:"ch1pressLong",options:["true"]}},{type:"enum",name:"ch.2 short press",ref:{value:"ch2pressShort",options:["true"]}},{type:"enum",name:"ch.2 long press",ref:{value:"ch2pressLong",options:["true"]}}]};
  xnm.aio.hm.CUxDTYPE={Temperature_Sensor:{WEATHER:0},"Temp/Hum_Sensor":{WEATHER:1},"KS200/300":{WEATHER:2},FS20_Contact:{SHUTTER_CONTACT:0},FS20_Switch_Sensor:{SWITCH:0},FS20_Alarm:{DANGER:0},FS20_Event_Trigger:{EVENT_INTERFACE:0},FS20_Motion:{MOTION_DETECTOR:0},FS20_Sensor:{SENSOR:0},FS20_Switch:{SWITCH:1},FS20_Dimmer:{DIMMER:0},FS20_Relais:{RELAIS:0},EM1000:{SENSOR:1},"ESA1000/2000":{SENSOR:2},FHT80v:{CLIMATECONTROL_VENT_DRIVE:0},FHT80b:{CLIMATECONTROL_REGULATOR:0,WEATHER:0},FHT_Multiventil:{DIMMER:1},
  FHT_Contact:{SENSOR:3},"HMS_100_W/WD":{SENSOR:4},Security_Sensor:{SENSOR:4},HMS_100_Contact:{SENSOR:4},KFM_100_S:{CAPACITIVE_FILLING_LEVEL_SENSOR:0},Transform_Device:{WRAPPER:0},Thermostat_Device:{WEATHER:3,CLIMATECONTROL_REGULATOR:1,SWITCH:2},System_Key:{KEY:1},System_Switch:{SWITCH:3},System_Dimmer:{DIMMER:2},System_Blind:{BLIND:0},System_Multi_Dimmer:{SYSTEM:0,DIMMER:3},RS232_Water_Sensor:{SENSOR:5},Universal_Key:{KEY:0},Universal_Switch:{SWITCH:4},Universal_Dimmer:{DIMMER:4},Universal_Shutter:{SHUTTER_CONTACT:1},
  Universal_Motion:{MOTION_DETECTOR:1},Universal_Alarm:{DANGER:1},Universal_Blind:{BLIND:1},"M-BUS_EnergyCam":{SENSOR:6},EnOcean_Key:{KEY:2},EnOcean_Handle:{ROTARY_HANDLE_SENSOR:0},EnOcean_Contact:{SHUTTER_CONTACT:2},EnOcean_PioTek_Tracker:{KEY:2,SENSOR:7,POWER:0},EnOcean_Motion:{MOTION_DETECTOR:2,WEATHER:4,POWER:0},EnOcean_Brightness:{WEATHER:5},EnOcean_WeatherStation:{WEATHER:6,ENOCEAN_WEATHER2:0},EnOcean_Switch:{SWITCH:5},EnOcean_Dimmer:{DIMMER:5},EnOcean_Blind:{BLIND:2},EnOcean_Airconditioner:{WEATHER:0,
  CLIMATECONTROL_REGULATOR:3,SWITCH:6,SENSOR:8,ENOCEAN_SENSOR_ERROR:0},EnOcean_Actuator:{WEATHER:0,CLIMATECONTROL_REGULATOR:2,CLIMATECONTROL_VENT_DRIVE:1},EnOcean_Bidi_Switch:{SWITCH:7,POWERMETER:0,ENOCEAN_Bidi_Switch2:0}};
  xnm.aio.hm.CUxDCHANNEL={KEY:{_level:0,datapoints:[{STATE:{type:"boolean",access:"rw"},PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",access:"w"},LEVEL:{type:"float",access:"rw"},STOP:{type:"action",access:"w"},OLD_LEVEL:{type:"action",access:"w"},MOTION:{type:"boolean",access:"r"},SEND_CMD:{type:"string",access:"w"},RCVS:{type:"string",access:"r"},RCVL:{type:"string",access:"r"},CONTROL:{type:"integer",access:"r"},SET_STATE:{type:"float",access:"w"}},{LEVEL:{type:"float",access:"rw"},
  OLD_LEVEL:{type:"action",access:"w"},STOP:{type:"action",access:"w"},STATE:{type:"boolean",access:"rw"},CMD_RUNS:{type:"action",access:"w"},CMD_RUNL:{type:"action",access:"w"},CMD_SETS:{type:"string",access:"rw"},CMD_SETL:{type:"string",access:"rw"},CMD_RETS:{type:"string",access:"r"},CMD_RETL:{type:"string",access:"r"},CMD_QUERY_RET:{type:"action",access:"w"},CMD_EXEC:{type:"string",access:"w"},WORKING:{type:"boolean",access:"r"},CONTROL:{type:"integer",access:"r"},SET_STATE:{type:"float",access:"w"}},
  {PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",access:"w"},WORKING:{type:"boolean",access:"r"},KEYPRESS_TIME:{type:"float",access:"r"}}]},SWITCH:{_level:5,datapoints:[{STATE:{type:"boolean",access:"rw"},VALUE:{type:"integer",access:"rw"},ON_TIME:{type:"float",access:"rw",unit:"s"},WORKING:{type:"boolean",access:"r"},EVENTCTR:{type:"integer",access:"rw"},CONTROL:{type:"integer",access:"r"}},{STATE:{type:"boolean",access:"rw"},ON_TIME:{type:"float",access:"w",unit:"s"},TOGGLE:{type:"action",
  access:"w"},WORKING:{type:"boolean",access:"r"},PROG_TIMER:{type:"float",access:"rw",unit:"s"}},{STATE:{type:"boolean",access:"r"}},{LEVEL:{type:"float",access:"rw"},OLD_LEVEL:{type:"action",access:"w"},STOP:{type:"action",access:"w"},STATE:{type:"boolean",access:"rw"},CMD_RUNS:{type:"action",access:"w"},CMD_RUNL:{type:"action",access:"w"},CMD_SETS:{type:"string",access:"rw"},CMD_SETL:{type:"string",access:"rw"},CMD_RETS:{type:"string",access:"r"},CMD_RETL:{type:"string",access:"r"},CMD_QUERY_RET:{type:"action",
  access:"w"},CMD_EXEC:{type:"string",access:"w"},WORKING:{type:"boolean",access:"r"},CONTROL:{type:"integer",access:"r"},SET_STATE:{type:"float",access:"w"}},{STATE:{type:"boolean",access:"rw"},PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",access:"w"},LEVEL:{type:"float",access:"rw"},STOP:{type:"action",access:"w"},OLD_LEVEL:{type:"action",access:"w"},MOTION:{type:"boolean",access:"r"},SEND_CMD:{type:"string",access:"w"},RCVS:{type:"string",access:"r"},RCVL:{type:"string",access:"r"},
  CONTROL:{type:"integer",access:"r"},SET_STATE:{type:"float",access:"w"}},{STATE:{type:"boolean",access:"rw"},ON_TIME:{type:"float",access:"rw",unit:"s"},WORKING:{type:"boolean",access:"r"},POWER:{type:"float",access:"r"},ENERGY_COUNTER:{type:"float",access:"r"}},{STATE:{type:"boolean",access:"rw"}},{STATE:{type:"boolean",access:"rw"},ON_TIME:{type:"float",access:"w",unit:"s"},INHIBIT:{type:"boolean",access:"rw"},NIGHT_MODE:{type:"boolean",access:"w"},INFO_LED:{type:"integer",access:"w"},WORKING:{type:"boolean",
  access:"r"},ERROR_OVERLOAD:{type:"boolean",access:"r"}}]},DIMMER:{_level:7,datapoints:[{LEVEL:{type:"float",access:"rw",min:0,max:1,unit:"100%"},OLD_LEVEL:{type:"action",access:"w"},RAMP_TIME:{type:"float",access:"w",unit:"s"},ON_TIME:{type:"float",access:"w",unit:"s"},TOGGLE:{type:"action",access:"w"},WORKING:{type:"boolean",access:"r"},PROG_TIMER:{type:"float",access:"rw"},PROG_DIM_UP:{type:"float",access:"rw"},PROG_DIM_DOWN:{type:"float",access:"rw"}},{LEVEL:{type:"float",access:"rw",min:0,max:1,
  unit:"100%"},OLD_LEVEL:{type:"action",access:"w"}},{LEVEL:{type:"float",access:"rw"},OLD_LEVEL:{type:"action",access:"w"},STOP:{type:"action",access:"w"},STATE:{type:"boolean",access:"rw"},CMD_RUNS:{type:"action",access:"w"},CMD_RUNL:{type:"action",access:"w"},CMD_SETS:{type:"string",access:"rw"},CMD_SETL:{type:"string",access:"rw"},CMD_RETS:{type:"string",access:"r"},CMD_RETL:{type:"string",access:"r"},CMD_QUERY_RET:{type:"action",access:"w"},CMD_EXEC:{type:"string",access:"w"},WORKING:{type:"boolean",
  access:"r"},CONTROL:{type:"integer",access:"r"},SET_STATE:{type:"float",access:"w"}},{LEVEL:{type:"float",access:"rw"},OLD_LEVEL:{type:"action",access:"w"},SET_STATE:{type:"float",access:"w"}},{STATE:{type:"boolean",access:"rw"},PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",access:"w"},LEVEL:{type:"float",access:"rw"},STOP:{type:"action",access:"w"},OLD_LEVEL:{type:"action",access:"w"},MOTION:{type:"boolean",access:"r"},SEND_CMD:{type:"string",access:"w"},RCVS:{type:"string",access:"r"},
  RCVL:{type:"string",access:"r"},CONTROL:{type:"integer",access:"r"},SET_STATE:{type:"float",access:"w"}},{LEVEL:{type:"float",access:"rw",min:0,max:1,unit:"100%"},OLD_LEVEL:{type:"action",access:"w"},RAMP_TIME:{type:"float",access:"w",unit:"s"},ON_TIME:{type:"float",access:"w",unit:"s"},WORKING:{type:"boolean",access:"r"},POWER:{type:"float",access:"r"},ENERGY_COUNTER:{type:"float",access:"r"}}]},BLIND:{_level:9,datapoints:[{LEVEL:{type:"float",access:"rw"},OLD_LEVEL:{type:"action",access:"w"},STOP:{type:"action",
  access:"w"},STATE:{type:"boolean",access:"rw"},CMD_RUNS:{type:"action",access:"w"},CMD_RUNL:{type:"action",access:"w"},CMD_SETS:{type:"string",access:"rw"},CMD_SETL:{type:"string",access:"rw"},CMD_RETS:{type:"string",access:"r"},CMD_RETL:{type:"string",access:"r"},CMD_QUERY_RET:{type:"action",access:"w"},CMD_EXEC:{type:"string",access:"w"},WORKING:{type:"boolean",access:"r"},CONTROL:{type:"integer",access:"r"},SET_STATE:{type:"float",access:"w"}},{STATE:{type:"boolean",access:"rw"},PRESS_SHORT:{type:"action",
  access:"we"},PRESS_LONG:{type:"action",access:"w"},LEVEL:{type:"float",access:"rw"},STOP:{type:"action",access:"w"},OLD_LEVEL:{type:"action",access:"w"},MOTION:{type:"boolean",access:"r"},SEND_CMD:{type:"string",access:"w"},RCVS:{type:"string",access:"r"},RCVL:{type:"string",access:"r"},CONTROL:{type:"integer",access:"r"},SET_STATE:{type:"float",access:"w"}},{LEVEL:{type:"float",access:"rw"},STOP:{type:"action",access:"w"},RAMP_TIME:{type:"float",access:"w"},ON_TIME:{type:"float",access:"w"},WORKING:{type:"boolean",
  access:"r"},DIRECTION:{type:"option",access:"r",values:{0:"NONE",1:"UP",2:"DOWN",3:"UNDEFINED"}}}]},CLIMATECONTROL_REGULATOR:{_level:14,datapoints:[{SETPOINT:{type:"float",access:"rw",min:0,max:99.5,unit:"\u00b0C",special:{"5.5":"OFF","30.5":"ON"}},STATE:{type:"boolean",access:"w",0:"VENT_CLOSED",1:"VENT_OPEN"},MODE_TEMPERATUR_REGULATOR:{type:"integer",access:"rw",special:{0:"AUTOMATIC",1:"MANUAL",2:"PARTY"}},TEMPERATUR_COMFORT_VALUE:{type:"float",access:"rw",min:0,max:99.5,unit:"\u00b0C"},TEMPERATUR_LOWERING_VALUE:{type:"float",
  access:"rw",min:0,max:99.5,unit:"\u00b0C"},TEMPERATUR_WINDOW_OPEN_VALUE:{type:"float",access:"rw",min:0,max:99.5,unit:"\u00b0C"},PARTY_END_TIME:{type:"string",access:"rw"}},{SETPOINT:{type:"float",access:"rw",min:0,max:99.5,unit:"\u00b0C",special:{"5.5":"OFF","30.5":"ON"}},STATE:{type:"boolean",access:"r",0:"VENT_CLOSED",1:"VENT_OPEN"},LEVEL:{type:"float",access:"r"},SET_INVERT:{type:"boolean",access:"rw"}},{SETPOINT:{type:"float",access:"rw",min:0,max:99.5,unit:"\u00b0C",special:{"5.5":"OFF","30.5":"ON"}},
  VALVE_STATE:{type:"integer",access:"w",min:0,max:100,unit:"%"},SUMMER_MODE:{type:"boolean",access:"rw"}},{SETPOINT:{type:"float",access:"rw",min:0,max:99.5,unit:"\u00b0C",special:{"5.5":"OFF","30.5":"ON"}}}]},CLIMATECONTROL_VENT_DRIVE:{_level:15,datapoints:[{VALVE_STATE:{type:"integer",access:"r",unit:"%"},VALVE_OFFSET_VALUE:{type:"float",access:"r",unit:"%"}},{VALVE_STATE:{type:"integer",access:"r",unit:"%"},TEMPERATURE:{type:"float",access:"r"},ALARM:{type:"boolean",access:"r"}}]},WEATHER:{_level:18,
  datapoints:[{TEMPERATURE:{type:"float",access:"r",unit:"\u00b0C"}},{TEMPERATURE:{type:"float",access:"r",unit:"\u00b0C"},HUMIDITY:{type:"integer",access:"r",unit:"%"},HUMIDITYF:{type:"float",access:"r",unit:"%"},DEW_POINT:{type:"float",access:"r",unit:"\u00b0C"},ABS_HUMIDITY:{type:"float",access:"r",unit:"g/m3"}},{TEMPERATURE:{type:"float",access:"r",unit:"\u00b0C"},HUMIDITY:{type:"integer",access:"r",unit:"%"},RAINING:{type:"boolean",access:"r",unit:"%"},RAIN_CTR:{type:"float",access:"r",unit:"mm"},
  WIND_SPEED:{type:"float",access:"r",unit:"km/h"},DEW_POINT:{type:"float",access:"r",unit:"\u00b0C"},ABS_HUMIDITY:{type:"float",access:"r",unit:"g/m3"}},{TEMPERATURE:{type:"float",access:"r",unit:"\u00b0C"},HUMIDITY:{type:"integer",access:"r",unit:"%"},DEW_POINT:{type:"float",access:"r",unit:"\u00b0C"},ABS_HUMIDITY:{type:"float",access:"r",unit:"g/m3"},SET_TEMPERATURE:{type:"float",access:"w",unit:"\u00b0C"},SET_HUMIDITY:{type:"float",access:"w",unit:"%"},TEMP_MIN_24H:{type:"float",access:"r",unit:"\u00b0C"},
  TEMP_MAX_24H:{type:"float",access:"r",unit:"\u00b0C"},HUM_MIN_24H:{type:"float",access:"r",unit:"%"},HUM_MAX_24H:{type:"float",access:"r",unit:"%"}},{TEMPERATURE:{type:"float",access:"r",unit:"\u00b0C"},BRIGHTNESS:{type:"integer",access:"r",unit:"lx"}},{BRIGHTNESS:{type:"integer",access:"r",unit:"lx"},MEDIAN:{type:"float",access:"r",unit:"lx"},MEAN:{type:"float",access:"r",unit:"lx"},BAT_VOLTAGE:{type:"float",access:"r"}},{BRIGHTNESS:{type:"integer",access:"r",unit:"lx"},WIND_SPEED:{type:"float",
  access:"r",unit:"km/h"},RAINING:{type:"boolean",access:"r"},TEMPERATURE:{type:"float",access:"r",unit:"\u00b0C"}}]},ROTARY_HANDLE_SENSOR:{_level:22,datapoints:[{STATE:{type:"option",access:"re",values:{0:"CLOSED",1:"TILTED",2:"OPEN"}}}]},SHUTTER_CONTACT:{_level:23,datapoints:[{STATE:{type:"boolean",access:"rw"},VALUE:{type:"integer",access:"rw"},ON_TIME:{type:"float",access:"rw",unit:"s"},WORKING:{type:"boolean",access:"r"},EVENTCTR:{type:"integer",access:"rw"},CONTROL:{type:"integer",access:"r"}},
  {STATE:{type:"boolean",access:"rw"},PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",access:"w"},LEVEL:{type:"float",access:"rw"},STOP:{type:"action",access:"w"},OLD_LEVEL:{type:"action",access:"w"},MOTION:{type:"boolean",access:"r"},SEND_CMD:{type:"string",access:"w"},RCVS:{type:"string",access:"r"},RCVL:{type:"string",access:"r"},CONTROL:{type:"integer",access:"r"},SET_STATE:{type:"float",access:"w"}},{STATE:{type:"boolean",access:"r"}}]},MOTION_DETECTOR:{_level:25,datapoints:[{MOTION:{type:"boolean",
  access:"rw"},VALUE:{type:"integer",access:"rw"},ON_TIME:{type:"float",access:"rw",unit:"s"},WORKING:{type:"boolean",access:"r"},EVENTCTR:{type:"integer",access:"rw"},CONTROL:{type:"integer",access:"r"}},{STATE:{type:"boolean",access:"rw"},PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",access:"w"},LEVEL:{type:"float",access:"rw"},STOP:{type:"action",access:"w"},OLD_LEVEL:{type:"action",access:"w"},MOTION:{type:"boolean",access:"r"},SEND_CMD:{type:"string",access:"w"},RCVS:{type:"string",
  access:"r"},RCVL:{type:"string",access:"r"},CONTROL:{type:"integer",access:"r"},SET_STATE:{type:"float",access:"w"}},{MOTION:{type:"boolean",access:"r"},BRIGHTNESS:{type:"float",access:"r"}}]},CAPACITIVE_FILLING_LEVEL_SENSOR:{_level:29,datapoints:[{FILLING_LEVEL:{type:"float",access:"r"},FREQ:{type:"float",access:"r"}}]},SENSOR:{_level:37,datapoints:[{STATE:{type:"boolean",access:"rw"},VALUE:{type:"integer",access:"rw"},ON_TIME:{type:"float",access:"rw",unit:"s"},WORKING:{type:"boolean",access:"r"},
  EVENTCTR:{type:"integer",access:"rw"},CONTROL:{type:"integer",access:"r"}},{COUNTER:{type:"integer",access:"r"},SUM:{type:"float",access:"r"},MEAN5MINUTES:{type:"float",access:"r"},MAX5MINUTES:{type:"float",access:"r"},SUM_1H:{type:"float",access:"r"},MAX_1H:{type:"float",access:"r"},SUM_24H:{type:"float",access:"r"},MAX_24H:{type:"float",access:"r"},MISS_24H:{type:"integer",access:"r"},METER:{type:"float",access:"r"},CONTROL:{type:"integer",access:"r"}},{COUNTER:{type:"integer",access:"r"},SUM:{type:"float",
  access:"r"},LAST_VALUE:{type:"float",access:"r"},LAST_TICKS:{type:"float",access:"r"},UNITSPTURN:{type:"float",access:"r"},METER:{type:"float",access:"r"},SUM_1H:{type:"float",access:"r"},SUM_24H:{type:"float",access:"r"},CONTROL:{type:"integer",access:"r"}},{STATE:{type:"boolean",access:"r"}},{STATE:{type:"boolean",access:"r"},COUNTER:{type:"integer",access:"r"}},{DISTANCE:{type:"float",access:"r",unit:"cm"},F_PERCENT:{type:"integer",access:"r",unit:"%"},F_LEVEL:{type:"float",access:"r",unit:"cm"},
  F_VOLUME:{type:"float",access:"r",unit:"l"},RELAIS1:{type:"boolean",access:"r"},RELAIS2:{type:"boolean",access:"r"}},{INFO:{type:"string",access:"r"},COUNTER:{type:"integer",access:"r"},METER:{type:"float",access:"r"},SUM_24H:{type:"float",access:"r"},SUM:{type:"float",access:"r"},SUM_DATE:{type:"string",access:"r"},SUM_RESET:{type:"action",access:"w"}},{STATE:{type:"boolean",access:"r"},NOTIFICATION:{type:"action",access:"e"}},{MODE:{type:"integer",access:"rw",special:{0:"auto",1:"heat",3:"cool",
  9:"fan_only",14:"dry"}},VANE:{type:"integer",access:"rw",special:{11:"vertical",12:"horizontal",13:"both",14:"stop"}},SPEED:{type:"integer",access:"rw",special:{0:"auto",1:"low",2:"mid1",3:"mid2",4:"mid3",5:"high"}},ROOM:{type:"option",access:"rw",special:{0:"occupied",1:"standy",2:"unoccupied",3:"off"}}}]},POWERMETER:{_level:38,datapoints:[{POWER:{type:"float",access:"r",unit:"W"},ENERGY_COUNTER:{type:"float",access:"r",unit:"kWh/Wh"},SUM_1H:{type:"float",access:"r"},SUM_24H:{type:"float",access:"r"},
  VOLTAGE:{type:"float",access:"r",unit:"V"}}]},DANGER:{_level:44,datapoints:[{STATE:{type:"boolean",access:"rw"},VALUE:{type:"integer",access:"rw"},ON_TIME:{type:"float",access:"rw",unit:"s"},WORKING:{type:"boolean",access:"r"},EVENTCTR:{type:"integer",access:"rw"},CONTROL:{type:"integer",access:"r"}},{STATE:{type:"boolean",access:"rw"},PRESS_SHORT:{type:"action",access:"we"},PRESS_LONG:{type:"action",access:"w"},LEVEL:{type:"float",access:"rw"},STOP:{type:"action",access:"w"},OLD_LEVEL:{type:"action",
  access:"w"},MOTION:{type:"boolean",access:"r"},SEND_CMD:{type:"string",access:"w"},RCVS:{type:"string",access:"r"},RCVL:{type:"string",access:"r"},CONTROL:{type:"integer",access:"r"},SET_STATE:{type:"float",access:"w"}}]},EVENT_INTERFACE:{_level:45,datapoints:[{STATE:{type:"action",access:"w"},VALUE:{type:"integer",access:"rw"},ON_TIME:{type:"float",access:"rw",unit:"s"},WORKING:{type:"boolean",access:"r"},EVENTCTR:{type:"integer",access:"rw"},CONTROL:{type:"integer",access:"r"}}]},RELAIS:{_level:45,
  datapoints:[{STATE:{type:"boolean",access:"rw"},VALUE:{type:"integer",access:"r"},TRANS:{type:"string",access:"r"},ON_TIME:{type:"float",access:"r",unit:"s"},RAMP_TIME:{type:"float",access:"r",unit:"s"}}]},WRAPPER:{_level:46,datapoints:[{"[DATAPT]":{type:"float",access:"r"},MEDIAN:{type:"float",access:"r"},MEAN:{type:"float",access:"r"},SET_STATE:{type:"float",access:"w"}}]},SYSTEM:{_level:47,datapoints:[{STATE:{type:"action",access:"we"},HOLD:{type:"action",access:"w"}}]},POWER:{_level:48,datapoints:[{BAT_VOLTAGE:{type:"float",
  access:"r"}}]},ENOCEAN_WEATHER2:{_level:49,datapoints:[{BRIGHTNESS_WEST:{type:"integer",access:"r",unit:"lx"},BRIGHTNESS_SOUTH:{type:"integer",access:"r",unit:"lx"},BRIGHTNESS_EAST:{type:"integer",access:"r",unit:"lx"}}]},ENOCEAN_SENSOR_ERROR:{_level:50,datapoints:[{ERROR:{type:"string",access:"r"}}]},ENOCEAN_Bidi_Switch2:{_level:51,datapoints:[{STATE:{type:"boolean",access:"r"}}]}};
  xnm.aio.hm.CUxDMAP={KEY:{PRESS_SHORT:{command:[{type:"enum",name:"short press",ref:{value:"pressShort"}}]},PRESS_LONG:{command:[{type:"enum",name:"long press",ref:{value:"pressLong"}}]},CMD_RUNS:{command:[{type:"enum",name:"short press command",ref:{value:"cmdShort"}}]},CMD_RUNL:{command:[{type:"enum",name:"long press command",ref:{value:"cmdLong"}}]}},SWITCH:{STATE:{command:[{type:"enum",name:"on",ref:{value:"on"}},{type:"enum",name:"off",ref:{value:"off"}},{type:"enum",name:"toggle",ref:{value:"toggle"}}],
  status:[{type:"enum",name:"switch status",ref:{value:"switchState",options:["off","on"]}}]},POWER:{status:[{type:"float",name:"switch power",ref:{value:"switchPower"}}]},ENERGY_COUNTER:{status:[{type:"float",name:"switch energy counter",ref:{value:"switchEnergyCount"}}]},NIGHT_MODE:{command:[{type:"enum",name:"night mode on",ref:{value:"switchNightOn"}},{type:"enum",name:"night mode off",ref:{value:"switchNightOff"}},{type:"enum",name:"night mode toggle",ref:{value:"switchNightToggle"}}]},INFO_LED:{command:[{type:"enum",
  name:"led off",ref:{value:"switchLedOff"}},{type:"enum",name:"led green",ref:{value:"switchLedGreen"}},{type:"enum",name:"led oragne",ref:{value:"switchLedOrange"}},{type:"enum",name:"led red",ref:{value:"switchLedRed"}}]}},DIMMER:{LEVEL:{command:[{type:"enum",name:"off",ref:{value:"dimOff"}},{type:"enum",name:"dim up",ref:{value:"dimUp"}},{type:"enum",name:"dim down",ref:{value:"dimDown"}},{type:"int",name:"dim to",ref:{value:"dimRaw",ext:"%d",extMeta:"0-100"}}],status:[{type:"int",name:"dimmer status",
  ref:{value:"dimmerLevel"}}]},OLD_LEVEL:{command:[{type:"enum",name:"on",ref:{value:"dimOn"}}]},TOGGLE:{command:[{type:"enum",name:"on",ref:{value:"dimToggle"}}]},POWER:{status:[{type:"float",name:"dimmer power",ref:{value:"dimPower"}}]},ENERGY_COUNTER:{status:[{type:"float",name:"dimmer energy counter",ref:{value:"dimEnergyCount"}}]}},BLIND:{LEVEL:{command:[{type:"enum",name:"move up",ref:{value:"blindUp"}},{type:"enum",name:"move down",ref:{value:"blindDown"}},{type:"enum",name:"step up",ref:{value:"blindStepUp"}},
  {type:"enum",name:"step down",ref:{value:"blindStepDown"}},{type:"int",name:"move to",ref:{value:"blindRaw",ext:"%d",extMeta:"0-100"}}],status:[{type:"int",name:"blind status",ref:{value:"blindLevel"}}]},STOP:{command:[{type:"enum",name:"stop",ref:{value:"blindStop"}}]}},CLIMATECONTROL_REGULATOR:{SETPOINT:{command:[{type:"enum",name:"temperature up",ref:{value:"themoRTempUp"}},{type:"enum",name:"temperature down",ref:{value:"themoRTempDown"}},{type:"enum",name:"close",ref:{value:"themoRTempClose"}},
  {type:"enum",name:"open",ref:{value:"themoRTempOpen"}},{type:"float",name:"temperature to",ref:{value:"themoRTempRaw",ext:"%f",extMeta:"5-30",scale:"0.5"}}],status:[{type:"float",name:"set temperature",ref:{value:"themoRSetTemp",extMeta:"5-30",scale:"0.5"}}]},STATE:{command:[{type:"enum",name:"valve open",ref:{value:"themoRValveOpen"}},{type:"enum",name:"valve close",ref:{value:"themoRValveClose"}}]},MODE_TEMPERATUR_REGULATOR:{command:[{type:"enum",name:"auto",ref:{value:"themoRModeAuto"}},{type:"enum",
  name:"manu",ref:{value:"themoRModeManu"}}],status:[{type:"enum",name:"mode",ref:{value:"themoRMode",options:["auto","manu","party"]}}]},TEMPERATUR_COMFORT_VALUE:{command:[{type:"float",name:"comfort temperature to",ref:{value:"themoRComfortTempRaw",ext:"%f",extMeta:"5-30",scale:"0.5"}}],status:[{type:"float",name:"comfort temperature",ref:{value:"themoRComfortTemp",extMeta:"5-30",scale:"0.5"}}]},TEMPERATUR_LOWERING_VALUE:{command:[{type:"float",name:"lowering temperature to",ref:{value:"themoRLowerTempRaw",
  ext:"%f",extMeta:"5-30",scale:"0.5"}}],status:[{type:"float",name:"lowering temperature",ref:{value:"themoRLowerTemp",extMeta:"5-30",scale:"0.5"}}]},TEMPERATUR_WINDOW_OPEN_VALUE:{command:[{type:"float",name:"win open temperature to",ref:{value:"themoRWinTempRaw",ext:"%f",extMeta:"5-30",scale:"0.5"}}],status:[{type:"float",name:"win open temperature",ref:{value:"themoRWinTemp",extMeta:"5-30",scale:"0.5"}}]},PARTY_END_TIME:{command:[{type:"string",name:"party end time",ref:{value:"themoRSetPartyEnd",
  ext:"%s"}}],status:[{type:"string",name:"party end time",ref:{value:"themoRPartyEnd"}}]},VALVE_STATE:{command:[{type:"int",name:"valve state",ref:{value:"themoRValveState",ext:"%d"}}]},SUMMER_MODE:{command:[{type:"enum",name:"summer mode on",ref:{value:"themoRSummerOn"}},{type:"enum",name:"summer mode off",ref:{value:"themoRSummerOff"}},{type:"enum",name:"summer mode toggle",ref:{value:"themoRSummerToggle"}}],status:[{type:"enum",name:"summer mode",ref:{value:"themoRSummer",options:["off","on"]}}]}},
  CLIMATECONTROL_VENT_DRIVE:{VALVE_STATE:{status:[{type:"int",name:"valve state",ref:{value:"valveState"}}]},VALVE_OFFSET_VALUE:{status:[{type:"float",name:"valve offset",ref:{value:"valveOffset"}}]},TEMPERATURE:{status:[{type:"float",name:"temperature",ref:{value:"valveTemperature"}}]},ALARM:{status:[{type:"enmu",name:"alarm",ref:{value:"valveAlamr",options:["ok","alarm"]}}]}},WEATHER:{TEMPERATURE:{status:[{type:"float",name:"temperature",ref:{value:"weatherTemp"}}]},HUMIDITY:{status:[{type:"int",
  name:"humidity",ref:{value:"weatherHum"}}]},TEMP_MIN_24H:{status:[{type:"float",name:"min temperature 24h",ref:{value:"weatherMinTemp"}}]},TEMP_MAX_24H:{status:[{type:"float",name:"max temperature 24h",ref:{value:"weatherMaxTemp"}}]},HUM_MIN_24H:{status:[{type:"float",name:"min humidity 24h",ref:{value:"weatherMinHum"}}]},HUM_MAX_24H:{status:[{type:"float",name:"max humidity 24h",ref:{value:"weatherMaxHum"}}]},HUMIDITYF:{status:[{type:"float",name:"humidity (float)",ref:{value:"weatherHumF"}}]},DEW_POINT:{status:[{type:"float",
  name:"dew point",ref:{value:"weatherDew"}}]},ABS_HUMIDITY:{status:[{type:"float",name:"absolute humidity",ref:{value:"weatherHumAbs"}}]},RAINING:{status:[{type:"enum",name:"raining",ref:{value:"weatherRaining",options:["true","false"]}}]},RAIN_CTR:{status:[{type:"float",name:"rain counter",ref:{value:"weatherRainCounter"}}]},WIND_SPEED:{status:[{type:"float",name:"wind speed",ref:{value:"weatherWindS"}}]},BRIGHTNESS:{status:[{type:"int",name:"brightness",ref:{value:"weatherBright"}}]},BAT_VOLTAGE:{status:[{type:"float",
  name:"battery voltage",ref:{value:"weatherBatVolt"}}]}},ROTARY_HANDLE_SENSOR:{STATE:{status:[{type:"enum",name:"handle state",ref:{value:"handleState",options:["closed","tilted","open"]}}]}},SHUTTER_CONTACT:{STATE:{status:[{type:"enum",name:"shutter state",ref:{value:"shutterState",options:["closed","open"]}}]}},MOTION_DETECTOR:{MOTION:{status:[{type:"enum",name:"state",ref:{value:"motionState",options:["on","off"]}}]},BRIGHTNESS:{status:[{type:"float",name:"brightness",ref:{value:"motionBright"}}]}},
  CAPACITIVE_FILLING_LEVEL_SENSOR:{FILLING_LEVEL:{status:[{type:"float",name:"level",ref:{value:"fillingLevel"}}]}},SENSOR:{STATE:{status:[{type:"enum",name:"state",ref:{value:"sensorState",options:["false","true"]}}]},SUM:{status:[{type:"float",name:"meter sum",ref:{value:"sensorSum"}}]},MEAN5MINUTES:{status:[{type:"float",name:"meter mean value (5 min)",ref:{value:"sensorMean5min"}}]},MAX5MINUTES:{status:[{type:"float",name:"meter max value (5 min)",ref:{value:"sensorMax5min"}}]},SUM_1H:{status:[{type:"float",
  name:"meter sum (1h)",ref:{value:"sensorSum1h"}}]},MAX_1H:{status:[{type:"float",name:"meter max value (1h)",ref:{value:"sensorMax1h"}}]},SUM_24H:{status:[{type:"float",name:"meter sum (24h)",ref:{value:"sensorSum24h"}}]},MAX_24H:{status:[{type:"float",name:"meter max value (24hn)",ref:{value:"sensorMax24h"}}]},METER:{status:[{type:"float",name:"meter value",ref:{value:"sensorMeter"}}]},LAST_VALUE:{status:[{type:"float",name:"meter last value",ref:{value:"sensorLastValue"}}]},DISTANCE:{status:[{type:"float",
  name:"water distance",ref:{value:"sensorDistance"}}]},F_PERCENT:{status:[{type:"integer",name:"water fill percent",ref:{value:"sensorFPercent"}}]},F_LEVEL:{status:[{type:"float",name:"water fill level",ref:{value:"sensorFLevel"}}]},F_VOLUME:{status:[{type:"float",name:"water fill volume",ref:{value:"sensorFVolume"}}]},RELAIS1:{status:[{type:"enum",name:"relais1 state",ref:{value:"sensorRelais1",options:["false","true"]}}]},RELAIS2:{status:[{type:"enum",name:"relais2 state",ref:{value:"sensorRelais2",
  options:["false","true"]}}]},INFO:{status:[{type:"string",name:"sensor info",ref:{value:"sensorInfo"}}]},SUM_DATE:{status:[{type:"string",name:"meter sum date",ref:{value:"sensorSumDate"}}]},SUM_RESET:{command:[{type:"enum",name:"meter sum reset",ref:{value:"sensorSumReset"}}]},MODE:{command:[{type:"enum",name:"aircon. auto mode",ref:{value:"sensModeAuto"}},{type:"enum",name:"aircon. heat mode",ref:{value:"sensModeHeat"}},{type:"enum",name:"aircon. cool mode",ref:{value:"sensModeCool"}},{type:"enum",
  name:"aircon. fan only mode",ref:{value:"sensModeFanOnly"}},{type:"enum",name:"aircon. dry mode",ref:{value:"sensModeDry"}}],status:[{type:"enum",name:"aircon mode",ref:{value:"sensMode",options:["auto","heat","cool","fan_only","dry"]}}]},VANE:{command:[{type:"enum",name:"vertical swing",ref:{value:"sensSwingV"}},{type:"enum",name:"horizontal swing",ref:{value:"sensSwingH"}},{type:"enum",name:"vertical and horizontal swing",ref:{value:"sensSwingVH"}},{type:"enum",name:"stop swing",ref:{value:"sensSwingS"}}],
  status:[{type:"enum",name:"swing mode",ref:{value:"sensSwing",options:["vertical","horizontal","both","stop"]}}]},SPEED:{command:[{type:"enum",name:"speed auto",ref:{value:"sensSpeedAuto"}},{type:"enum",name:"speed low",ref:{value:"sensSpeedLow"}},{type:"enum",name:"speed mid1",ref:{value:"sensSpeedMid1"}},{type:"enum",name:"speed mid2",ref:{value:"sensSpeedMid2"}},{type:"enum",name:"speed mid3",ref:{value:"sensSpeedMid3"}},{type:"enum",name:"speed high",ref:{value:"sensSpeedHigh"}}],status:[{type:"enum",
  name:"speed",ref:{value:"sensSpeed",options:"auto low mid1 mid2 mid3 high".split(" ")}}]},ROOM:{command:[{type:"enum",name:"occupied",ref:{value:"sensRoomOccu"}},{type:"enum",name:"standby",ref:{value:"sensRoomStandby"}},{type:"enum",name:"unoccupied",ref:{value:"sensRoomUnoccu"}},{type:"enum",name:"off",ref:{value:"sensRoomOff"}}],status:[{type:"enum",name:"room",ref:{value:"sensRoom",options:["occupied","standby","unoccupied","off"]}}]}},POWERMETER:{POWER:{status:[{type:"float",name:"power",ref:{value:"powerMeterPower"}}]},
  ENERGY_COUNTER:{status:[{type:"float",name:"energy counter",ref:{value:"powerMeterECount"}}]},SUM_1H:{status:[{type:"float",name:"meter sum (1h)",ref:{value:"powerMeterSum1h"}}]},SUM_24H:{status:[{type:"float",name:"meter sum (24h)",ref:{value:"powerMeterSum24h"}}]},VOLTAGE:{status:[{type:"float",name:"meter voltage",ref:{value:"powerMeterVoltage"}}]}},DANGER:{STATE:{status:[{type:"enum",name:"alarm state",ref:{value:"dangerState",options:["ok","danger"]}}]}},EVENT_INTERFACE:{STATE:{command:[{type:"enum",
  name:"press",ref:{value:"evntIntfPress"}}]}},RELAIS:{STATE:{command:[{type:"enum",name:"on",ref:{value:"relaisOn"}},{type:"enum",name:"off",ref:{value:"relaisOff"}},{type:"enum",name:"toggle",ref:{value:"relaisToggle"}}],status:[{type:"enum",name:"relais status",ref:{value:"relaisState",options:["off","on"]}}]}},WRAPPER:{"[DATAPT]":{status:[{type:"float",name:"value",ref:{value:"wrapperValue"}}]}},SYSTEM:{STATE:{command:[{type:"enum",name:"press",ref:{value:"systemPress"}}]}},FHT_Multiventil_Dimmer:{LEVEL:{command:[{type:"enum",
  name:"off",ref:{value:"valveOff"}},{type:"enum",name:"valve up",ref:{value:"valveUp"}},{type:"enum",name:"valve down",ref:{value:"valveDown"}},{type:"int",name:"valve to",ref:{value:"valveRaw",ext:"%d",extMeta:"0-100"}}],status:[{type:"float",name:"valve status",ref:{value:"valveLevel"}}]},OLD_LEVEL:{command:[{type:"enum",name:"on",ref:{value:"valveOn"}}]}},POWER:{BAT_VOLTAGE:{status:[{type:"float",name:"battery voltage",ref:{value:"powBatVolt"}}]}},HMS_100_Contact:{STATE:{status:[{type:"enum",name:"state",
  ref:{value:"hmsContactState",options:["close","open"]}}]}},Security_Sensor:{STATE:{status:[{type:"enum",name:"state",ref:{value:"securityState",options:["ok","danger"]}}]}},FHT_Contact:{STATE:{status:[{type:"enum",name:"state",ref:{value:"fhtContactState",options:["close","open"]}}]}},ENOCEAN_WEATHER2:{BRIGHTNESS_WEST:{status:[{type:"int",name:"brightness west",ref:{value:"eoWeather2BrightW"}}]},BRIGHTNESS_SOUTH:{status:[{type:"int",name:"brightness south",ref:{value:"eoWeather2BrightS"}}]},BRIGHTNESS_EAST:{status:[{type:"int",
  name:"brightness east",ref:{value:"eoWeather2BrightE"}}]}},ENOCEAN_SENSOR_ERROR:{ERROR:{status:[{type:"string",name:"error",ref:{value:"eoSensorErr"}}]}},ENOCEAN_Bidi_Switch2:{STATE:{status:[{type:"enum",name:"cosumer state",ref:{value:"bidiSwitch2State",options:["off","on"]}}]}}};
  xnm.aio.hm.HMIP_TYPE={"HMIP-PS":0,"HmIP-PCBS":0,"HmIP-PCBS-BAT":0,"HmIP-SWDM":1,"HMIP-SWDO":1,"HmIP-SWDM-B2":1,"Contact AA":1,"HMIP-WTH":2,"HmIP-WTH-2":2,"HmIP-STH":2,"HmIP-STHD":2,"HMIP-eTRV":3,"HmIP-eTRV-2":3,"HmIP-eTRV-2-UK":3,"HmIP-eTRV-B":3,"HmIP-eTRV-B-UK":3,"HmIP-eTRV-B1":3,"HmIP-eTRV-C":3,"HMIP-WRC2":4,"HMIP-KRC4":4,"HmIP-WRC6":4,"HmIP-SMI":5,"HmIP-SMO":5,"HmIP-SMO-A":5,"HmIP-SRH":6,"HMIP-PSM":7,"HmIP-PSM-UK":7,"HmIP-PSM-IT":7,"HmIP-PSM-CH":7,"Smart Plug AA":7,"HmIP-SWSD":8,"Smoke Detektor":8,
  "HmIP-BSM":9,"HmIP-FSM":9,"HmIP-BDT":10,"HmIP-ASIR":11,"HmIP-PDT":10,"HmIP-BROLL":12,"HmIP-FROLL":12,"HmIP-BBL":13,"HmIP-FBL":13,"HmIP-SPI":14,"HmIP-FAL230-C6":15,"HmIP-FAL24-C6":15,"HmIP-FAL230-C10":15,"HmIP-FAL24-C10":15,"HmIP-SWO-B":16,"HmIP-SWO-PL":17,"HmIP-STHO":18,"HmIP-STHO-A":18,"HmIP-SPDR":19,"HmIP-SWO-PR":20,"HmIP-HEATING":21};
  xnm.aio.hm.HMIP_CATAGORY=[{catagory:"IP Schaltaktor",channels:{MAINTENANCE:1,KEY_TRANSCEIVER:0,SWITCH_TRANSMITTER:0,SWITCH_VIRTUAL_RECEIVER:0}},{catagory:"IP T\u00fcr-/Fensterkontakt",channels:{MAINTENANCE:2,SHUTTER_CONTACT:0}},{catagory:"IP Wandthermostat",channels:{MAINTENANCE:0,HEATING_CLIMATECONTROL_TRANSCEIVER:0}},{catagory:"IP Ventilsteuerung",channels:{MAINTENANCE:0,HEATING_CLIMATECONTROL_TRANSCEIVER:1}},{catagory:"IP Wandtaster",channels:{MAINTENANCE:0,KEY_TRANSCEIVER:0}},{catagory:"IP Bewegungsmelder",
  channels:{MAINTENANCE:2,MOTIONDETECTOR_TRANSCEIVER:0}},{catagory:"IP Window Handle Sensor",channels:{MAINTENANCE:2,ROTARY_HANDLE_TRANSCEIVER:0}},{catagory:"IP Energiemesssteckdose",channels:{MAINTENANCE:1,ENERGIE_METER_TRANSMITTER:0,SWITCH_VIRTUAL_RECEIVER:0}},{catagory:"IP Rauchmelder",channels:{MAINTENANCE_SD:0,SMOKE_DETECTOR:0}},{catagory:"IP Energiemess-Schaltaktor",channels:{MAINTENANCE:1,SWITCH_TRANSMITTER:0,SWITCH_VIRTUAL_RECEIVER:0,ENERGIE_METER_TRANSMITTER:0}},{catagory:"IP Dimmaktor",channels:{MAINTENANCE:1,
  DIMMER_TRANSMITTER:0,DIMMER_VIRTUAL_RECEIVER:0}},{catagory:"IP Alarmsiren",channels:{MAINTENANCE:2,ALARM_SWITCH_VIRTUAL_RECEIVER:0}},{catagory:"IP Rolladenaktor",channels:{MAINTENANCE:1,SHUTTER_TRANSMITTER:0,SHUTTER_VIRTUAL_RECEIVER:0}},{catagory:"IP Jalousieaktor",channels:{MAINTENANCE:1,BLIND_TRANSMITTER:0,BLIND_VIRTUAL_RECEIVER:0}},{catagory:"IP Presencemelder",channels:{MAINTENANCE:2,PRESENCEDETECTOR_TRANSCEIVER:0}},{catagory:"IP Fussbodenheizung",channels:{MAINTENANCE:1,CLIMATECONTROL_FLOOR_PUMP_TRANSCEIVER:0,
  CLIMATECONTROL_FLOOR_TRANSCEIVER:0}},{catagory:"IP Weather Sensor Basic",channels:{MAINTENANCE:0,WEATHER_TRANSMIT:0}},{catagory:"IP Weather Sensor Plus",channels:{MAINTENANCE:0,WEATHER_TRANSMIT:1}},{catagory:"IP Temperature and Humidity Sensor - Outdoor",channels:{MAINTENANCE:0,CLIMATE_TRANSCEIVER:0}},{catagory:"IP Passage Sensor with Direction Recognition",channels:{MAINTENANCE:0,PASSAGE_DETECTOR_DIRECTION_TRANSMITTER:0}},{catagory:"IP Weather Sensor Pro",channels:{MAINTENANCE:0,WEATHER_TRANSMIT:2}},
  {catagory:"IP Heizgrupp",channels:{MAINTENANCE:0,HEATING_CLIMATECONTROL_TRANSCEIVER:0,ROTARY_HANDLE_TRANSCEIVER:0,SWITCH_TRANSMITTER:0}}];
  xnm.aio.hm.HMIP_CHANNEL={MAINTENANCE:{_level:0,datapoints:[{UNREACH:{type:"boolean",access:"re"},OPERATING_VOLTAGE:{type:"float",access:"re"},DUTY_CYCLE:{type:"boolean",access:"re"},LOW_BAT:{type:"boolean",access:"re"}},{UNREACH:{type:"boolean",access:"re"},OPERATING_VOLTAGE:{type:"float",access:"re"},DUTY_CYCLE:{type:"boolean",access:"re"}},{UNREACH:{type:"boolean",access:"re"},OPERATING_VOLTAGE:{type:"float",access:"re"},SABOTAGE:{type:"boolean",access:"re"},DUTY_CYCLE:{type:"boolean",access:"re"},
  LOW_BAT:{type:"boolean",access:"re"}}]},KEY_TRANSCEIVER:{_level:1,datapoints:[{PRESS_SHORT:{type:"action",access:"e"},PRESS_LONG:{type:"action",access:"e"}}]},SWITCH_TRANSMITTER:{_level:2,datapoints:[{PROCESS:{type:"option",access:"re",values:{}},SECTION:{type:"integer",access:"re"},STATE:{type:"boolean",access:"re"}}]},SWITCH_VIRTUAL_RECEIVER:{_level:3,datapoints:[{PROCESS:{type:"option",access:"re",values:{}},SECTION:{type:"integer",access:"re"},STATE:{type:"boolean",access:"rwe"}}]},SHUTTER_CONTACT:{_level:4,
  datapoints:[{STATE:{type:"option",access:"re",values:{0:"closed",1:"open"}}}]},HEATING_CLIMATECONTROL_TRANSCEIVER:{_level:5,datapoints:[{ACTIVE_PROFILE:{type:"integer",access:"rwe",min:1,max:6},ACTUAL_TEMPERATURE:{type:"float",access:"re",min:-10,max:56,unit:"\u00b0C"},BOOST_MODE:{type:"boolean",access:"rwe"},CONTROL_DIFFERENTIAL_TE:{type:"float",access:"we"},CONTROL_MODE:{type:"option",access:"we",values:{0:"AUTO-MODE",1:"MANU-MODE"}},DURATION_UNIT:{type:"string",access:"w"},DURATION_VALUE:{type:"integer",
  access:"w"},FROST_PROTECTION:{type:"boolean",access:"re"},HUMIDITY:{type:"integer",access:"re",min:0,max:99,unit:"%"},PARTY_MODE:{type:"boolean",access:"re"},PARTY_SET_POINT_TEMPERA:{type:"float",access:"re"},PARTY_TIME_END:{type:"string",access:"rwe"},PARTY_TIME_START:{type:"string",access:"rwe"},SET_POINT_MODE:{type:"option",access:"rwe",values:{0:"AUTO-MODE",1:"MANU-MODE"}},SET_POINT_TEMPERATURE:{type:"float",access:"rwe",min:4.5,max:30.5,unit:"\u00b0C"},SWITCH_POINT_OCCURED:{type:"boolean",access:"re"},
  WINDOW_STATE:{type:"option",access:"rwe",values:{0:"unknow",1:"unknow"}}},{ACTIVE_PROFILE:{type:"integer",access:"rwe",min:1,max:3},ACTUAL_TEMPERATURE:{type:"float",access:"re",min:-10,max:56,unit:"\u00b0C"},BOOST_MODE:{type:"boolean",access:"rwe"},CONTROL_DIFFERENTIAL_TE:{type:"float",access:"we"},CONTROL_MODE:{type:"option",access:"we",values:{0:"AUTO-MODE",1:"MANU-MODE"}},DURATION_UNIT:{type:"string",access:"w"},DURATION_VALUE:{type:"integer",access:"w"},FROST_PROTECTION:{type:"boolean",access:"re"},
  LEVEL:{type:"float",access:"rwe",min:0,max:1},PARTY_MODE:{type:"boolean",access:"re"},PARTY_SET_POINT_TEMPERA:{type:"float",access:"re"},PARTY_TIME_END:{type:"string",access:"rwe"},PARTY_TIME_START:{type:"string",access:"rwe"},SET_POINT_MODE:{type:"option",access:"rwe",values:{0:"AUTO-MODE",1:"MANU-MODE"}},SET_POINT_TEMPERATURE:{type:"float",access:"rwe",min:4.5,max:30.5,unit:"\u00b0C"},SWITCH_POINT_OCCURED:{type:"boolean",access:"re"},VALVE_ADAPTION:{type:"boolean",access:"we"},VALVE_STATE:{type:"option",
  access:"re",values:{}},WINDOW_STATE:{type:"option",access:"rwe",values:{0:"closed",1:"open"}}}]},MOTIONDETECTOR_TRANSCEIVER:{_level:6,datapoints:[{ILLUMINATION:{type:"float",access:"re"},MOTION:{type:"boolean",access:"re"},RESET_MOTION:{type:"action",access:"w"},MOTION_DETECTION_ACTIVE:{type:"boolean",access:"rwe"}}]},SHUTTER_CONTACT_TRANSCEIVER:{_level:7,datapoints:[{STATE:{type:"option",access:"re",values:{0:"closed",1:"open"}}}]},ENERGIE_METER_TRANSMITTER:{_level:8,datapoints:[{FREQUENCY:{type:"float",
  access:"re",min:48.72,max:51.27,unit:"Hz"},POWER:{type:"float",access:"re",min:0,max:167772.15,unit:"W"},VOLTAGE:{type:"float",access:"re",min:0,max:6553.5,unit:"V"},ENERGY_COUNTER:{type:"float",access:"re",min:0,max:838860.7,unit:"Wh"},CURRENT:{type:"float",access:"re",min:0,max:65535,unit:"mA"}}]},MAINTENANCE_SD:{_level:9,datapoints:[{UNREACH:{type:"boolean",access:"re"},TIME_OF_OPERATION:{type:"integer",access:"re"},DUTY_CYCLE:{type:"boolean",access:"re"},LOW_BAT:{type:"boolean",access:"re"}}]},
  SMOKE_DETECTOR:{_level:10,datapoints:[{SMOKE_DETECTOR_COMMAND:{type:"option",access:"w"},ERROR_CODE:{type:"integer",access:"re"},SMOKE_DETECTOR_EVENT:{type:"option",access:"w"},SMOKE_DETECTOR_ALARM_STATUS:{type:"option",access:"re"},SMOKE_DETECTOR_TEST_RESULT:{type:"option",access:"re"}}]},DIMMER_TRANSMITTER:{_level:11,datapoints:[{PROCESS:{type:"option",access:"re",values:{0:"STABLE",1:"NOT_STABLE"}},SECTION:{type:"integer",access:"re",min:0,max:15},LEVEL:{type:"float",access:"re",min:0,max:1.005}}]},
  DIMMER_VIRTUAL_RECEIVER:{_level:12,datapoints:[{ON_TIME:{type:"float",access:"w",min:0,max:858E4},PROCESS:{type:"option",access:"re",values:{0:"STABLE",1:"NOT_STABLE"}},RAMP_TIME:{type:"float",access:"w",min:0,max:858E4},SECTION:{type:"integer",access:"re",min:0,max:15},LEVEL:{type:"float",access:"rwe",min:0,max:1.005}}]},ALARM_SWITCH_VIRTUAL_RECEIVER:{_level:13,datapoints:[{ACOUSTIC_ALARM_SELECTION:{type:"option",access:"w",values:{0:"DISABLE_ACOUSTIC_SIGNAL",1:"FREQUENCY_RISING",2:"FREQUENCY_FALLING",
  3:"FREQUENCY_RISING_AND_FALLING",4:"FREQUENCY_ALTERNATING_LOW_HIGH",5:"FREQUENCY_ALTERNATING_LOW_MID_HIGH",6:"FREQUENCY_HIGHON_OFF",7:"FREQUENCY_HIGHON_LONGOFF",8:"FREQUENCY_LOWON_OFF_HIGHON_OFF",9:"FREQUENCY_LOWON_LONGOFF_HIGHON_LONGOFF",10:"LOW_BATTERY",11:"DISARMED",12:"INTERNALLY_ARMED",13:"EXTERNALLY_ARMED",14:"DELAYED_INTERNALLY_ARMED",15:"DELAYED_EXTERNALLY_ARMED",16:"EVENT",17:"ERROR"}},OPTICAL_ALARM_SELECTION:{type:"option",access:"w",values:{0:"DISABLE_OPTICAL_SIGNAL",1:"BLINKING_ALTERNATELY_REPEATING",
  2:"BLINKING_BOTH_REPEATING",3:"DOUBLE_FLASHING_REPEATING",4:"FLASHING_BOTH_REPEATING",5:"CONFIRMATION_SIGNAL_0",6:"CONFIRMATION_SIGNAL_1",7:"CONFIRMATION_SIGNAL_2"}},PROCESS:{type:"option",access:"re",values:{0:"STABLE",1:"NOT_STABLE"}},STATE:{type:"boolean",access:"re"},SECTION:{type:"integer",access:"re",min:0,max:15},DURATION_UNIT:{type:"option",access:"w",values:{0:"S",1:"M",2:"H",3:"D"}},DURATION_VALUE:{type:"integer",access:"w",min:0,max:16343}}]},ROTARY_HANDLE_TRANSCEIVER:{_level:14,datapoints:[{STATE:{type:"option",
  access:"re",values:{0:"CLOSED",1:"TILTED",2:"OPEN"}}}]},SHUTTER_TRANSMITTER:{_level:15,datapoints:[{SELF_CALIBRATION:{type:"option",access:"w",values:{0:"STOP",1:"START"}},PROCESS:{type:"option",access:"re",values:{0:"STABLE",1:"NOT_STABLE"}},SECTION:{type:"integer",access:"re",min:0,max:15},LEVEL:{type:"float",access:"re",min:0,max:1.005},SELF_CALIBRATION_RESULT:{type:"boolean",access:"re"}}]},SHUTTER_VIRTUAL_RECEIVER:{_level:16,datapoints:[{STOP:{type:"action",access:"w"},PROCESS:{type:"option",
  access:"re",values:{0:"STABLE",1:"NOT_STABLE"}},SECTION:{type:"integer",access:"re",min:0,max:15},LEVEL:{type:"float",access:"rwe",min:0,max:1.005}}]},BLIND_TRANSMITTER:{_level:17,datapoints:[{PROCESS:{type:"option",access:"re",values:{0:"STABLE",1:"NOT_STABLE"}},SECTION:{type:"integer",access:"re",min:0,max:15},LEVEL:{type:"float",access:"re",min:0,max:1.005},LEVEL_2:{type:"float",access:"re",min:0,max:1.005}}]},BLIND_VIRTUAL_RECEIVER:{_level:18,datapoints:[{STOP:{type:"action",access:"w"},PROCESS:{type:"option",
  access:"re",values:{0:"STABLE",1:"NOT_STABLE"}},SECTION:{type:"integer",access:"re",min:0,max:15},LEVEL:{type:"float",access:"rwe",min:0,max:1.005},LEVEL_2:{type:"float",access:"rwe",min:0,max:1.005}}]},PRESENCEDETECTOR_TRANSCEIVER:{_level:19,datapoints:[{CURRENT_ILLUMINATION:{type:"float",access:"re"},ILLUMINATION:{type:"float",access:"re"},PRESENCE_DETECTION_STATE:{type:"boolean",access:"re"},RESET_PRESENCE:{type:"action",access:"w"},PRESENCE_DETECTION_ACTIVE:{type:"boolean",access:"rwe"}}]},CLIMATECONTROL_FLOOR_PUMP_TRANSCEIVER:{_level:20,
  datapoints:[{HUMIDITY_LIMITER:{type:"boolean",access:"re"},EMERGENCY_OPERATION:{type:"boolean",access:"re"},FROST_PROTECTION:{type:"boolean",access:"re"},STATE:{type:"boolean",access:"re"},DEW_POINT_ALARM:{type:"boolean",access:"re"},EXTERNAL_CLOCK:{type:"boolean",access:"re"}}]},CLIMATECONTROL_FLOOR_TRANSCEIVER:{_level:21,datapoints:[{HUMIDITY_LIMITER:{type:"boolean",access:"re"},EMERGENCY_OPERATION:{type:"boolean",access:"re"},FROST_PROTECTION:{type:"boolean",access:"re"},STATE:{type:"boolean",
  access:"re"},DEW_POINT_ALARM:{type:"boolean",access:"re"},EXTERNAL_CLOCK:{type:"boolean",access:"re"}}]},WEATHER_TRANSMIT:{_level:22,datapoints:[{ACTUAL_TEMPERATURE:{type:"float",access:"re",min:-3276.8,max:3276.7,unit:"\u00b0C"},HUMIDITY:{type:"integer",access:"re",min:0,max:100,unit:"%"},ILLUMINATION:{type:"float",access:"re",min:0,max:163830},SUNSHINEDURATION:{type:"integer",access:"re",min:0,max:16383},SUNSHINEDURATION_OVERFLOW:{type:"boolean",access:"re"},SUNSHINE_THRESHOLD_OVERRUN:{type:"boolean",
  access:"re"},WIND_SPEED:{type:"float",access:"re",min:0,max:200},WIND_THRESHOLD_OVERRUN:{type:"boolean",access:"re"}},{ACTUAL_TEMPERATURE:{type:"float",access:"re",min:-3276.8,max:3276.7,unit:"\u00b0C"},HUMIDITY:{type:"integer",access:"re",min:0,max:100,unit:"%"},ILLUMINATION:{type:"float",access:"re",min:0,max:163830},RAINING:{type:"boolean",access:"re"},RAIN_COUNTER:{type:"float",access:"re",min:0,max:1638},RAIN_COUNTER_OVERFLOW:{type:"boolean",access:"re"},SUNSHINEDURATION:{type:"integer",access:"re",
  min:0,max:16383},SUNSHINEDURATION_OVERFLOW:{type:"boolean",access:"re"},SUNSHINE_THRESHOLD_OVERRUN:{type:"boolean",access:"re"},WIND_SPEED:{type:"float",access:"re",min:0,max:200},WIND_THRESHOLD_OVERRUN:{type:"boolean",access:"re"}},{ACTUAL_TEMPERATURE:{type:"float",access:"re",min:-3276.8,max:3276.7,unit:"\u00b0C"},HUMIDITY:{type:"integer",access:"re",min:0,max:100,unit:"%"},ILLUMINATION:{type:"float",access:"re",min:0,max:163830},RAINING:{type:"boolean",access:"re"},RAIN_COUNTER:{type:"float",access:"re",
  min:0,max:1638},RAIN_COUNTER_OVERFLOW:{type:"boolean",access:"re"},SUNSHINEDURATION:{type:"integer",access:"re",min:0,max:16383},SUNSHINEDURATION_OVERFLOW:{type:"boolean",access:"re"},SUNSHINE_THRESHOLD_OVERRUN:{type:"boolean",access:"re"},WIND_DIR:{type:"float",access:"re",min:0,max:357.5},WIND_DIR_RANGE:{type:"float",access:"re",min:0,max:146.25},WIND_SPEED:{type:"float",access:"re",min:0,max:200},WIND_THRESHOLD_OVERRUN:{type:"boolean",access:"re"}}]},CLIMATE_TRANSCEIVER:{_level:23,datapoints:[{ACTUAL_TEMPERATURE:{type:"float",
  access:"re",min:-3276.8,max:3276.7,unit:"\u00b0C"},HUMIDITY:{type:"integer",access:"re",min:0,max:100,unit:"%"}}]},PASSAGE_DETECTOR_DIRECTION_TRANSMITTER:{_level:24,datapoints:[{CURRENT_PASSAGE_DIRECTION:{type:"boolean",access:"re"},LAST_PASSAGE_DIRECTION:{type:"boolean",access:"re"},PASSAGE_COUNTER_OVERFLOW:{type:"boolean",access:"re"},PASSAGE_COUNTER_VALUE:{type:"integer",access:"re",min:0,max:127}}]},GENERIC_INPUT_TRANSMITER:{_level:25,datapoints:[{CHANGE_OVER:{type:"boolean",access:"re"},EXTERNAL_CLOCK:{type:"boolean",
  access:"re"},HUMIDITY_LIMITER:{type:"boolean",access:"re"},STATE:{type:"boolean",access:"re"},TACTILE_SWITCH:{type:"boolean",access:"re"},TEMPERATURE_LIMITER:{type:"boolean",access:"re"}}]},ANALOG_OUTPUT_TRANSCEIVER:{_level:26,datapoints:[{LEVEL:{type:"float",access:"rwe",min:0,max:1.005}}]},MULTI_MODE_INPUT_TRANSMITTER:{_level:27,datapoints:[{STATE:{type:"boolean",access:"re"},PRESS_SHORT:{type:"action",access:"e"},PRESS_LONG:{type:"action",access:"e"}}]}};
  xnm.aio.hm.HMIP_MAP={MAINTENANCE:{UNREACH:{status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}}]},LOW_BAT:{status:[{type:"enum",name:"battery low",ref:{value:"errorBat",options:["false","true"]}}]},SABOTAGE:{status:[{type:"enum",name:"sabotage",ref:{value:"errorSabo",options:["false","true"]}}]}},KEY_TRANSCEIVER:{PRESS_SHORT:{ipevt:[{type:"enum",name:"short press",ref:{value:"pressShort"}}]},PRESS_LONG:{ipevt:[{type:"enum",name:"long press",ref:{value:"pressLong"}}]}},
  SWITCH_TRANSMITTER:{STATE:{status:[{type:"enum",name:"switch status",ref:{value:"switchTState",options:["off","on"]}}]}},SWITCH_VIRTUAL_RECEIVER:{STATE:{command:[{type:"enum",name:"on",ref:{value:"on"}},{type:"enum",name:"off",ref:{value:"off"}},{type:"enum",name:"toggle",ref:{value:"toggle"}},{type:"float",name:"on for",ref:{value:"onFor",ext:"%f",unit:"s"}}],status:[{type:"enum",name:"switch status",ref:{value:"switchState",options:["off","on"]}}]}},HEATING_CLIMATECONTROL_TRANSCEIVER:{ACTIVE_PROFILE:{command:[{type:"int",
  name:"set profile",ref:{value:"themoProf",ext:"%d",extMeta:"1-6",scale:"1"}}],status:[{type:"int",name:"profile",ref:{value:"themoProf"}}]},ACTUAL_TEMPERATURE:{status:[{type:"float",name:"actual temperature",ref:{value:"themoActualTemp",extMeta:"-10.0-56.0",scale:"0.1"}}]},BOOST_MODE:{command:[{type:"enum",name:"boost on",ref:{value:"themoBoostOn"}},{type:"enum",name:"boost off",ref:{value:"themoBoostOff"}}],status:[{type:"enum",name:"boost mode",ref:{value:"themoBoostMode",options:["off","on"]}}]},
  CONTROL_MODE:{command:[{type:"enum",name:"set auto mode",ref:{value:"themoAutoMode"}},{type:"enum",name:"set manu mode",ref:{value:"themoManuMode"}}]},FROST_PROTECTION:{status:[{type:"enum",name:"frost protection",ref:{value:"themoFrost",options:["off","on"]}}]},HUMIDITY:{status:[{type:"int",name:"humidity",ref:{value:"themoHum"}}]},SET_POINT_MODE:{status:[{type:"enum",name:"mode",ref:{value:"themoMode",options:["auto","manu"]}}]},SET_POINT_TEMPERATURE:{command:[{type:"float",name:"set temperature",
  ref:{value:"themoTemp",ext:"%f",extMeta:"4.5-30.5",scale:"0.5"}},{type:"enum",name:"on",ref:{value:"themoTempOn"}},{type:"enum",name:"off",ref:{value:"themoTempOff"}},{type:"enum",name:"temperature up",ref:{value:"themoTempUp"}},{type:"enum",name:"temperature down",ref:{value:"themoTempDown"}}],status:[{type:"float",name:"set temperature",ref:{value:"themoTemp",extMeta:"4.5-30.5",scale:"0.5"}}]},LEVEL:{command:[{type:"int",name:"set valve level",ref:{value:"themoValveLevel",ext:"%d",extMeta:"0-100"}}],
  status:[{type:"int",name:"valve level",ref:{value:"themoValveLevel"}}]},WINDOW_STATE:{command:[{type:"enum",name:"set window open",ref:{value:"themoWinOpen"}},{type:"enum",name:"set window close",ref:{value:"themoWinClose"}}],status:[{type:"enum",name:"window state",ref:{value:"themoWinState",options:["open","closed"]}}]}},SHUTTER_CONTACT:{STATE:{status:[{type:"enum",name:"shutter state",ref:{value:"shutterState",options:["closed","open"]}}]}},SHUTTER_CONTACT_TRANSCEIVER:{STATE:{status:[{type:"enum",
  name:"shutter state",ref:{value:"shutterTState",options:["closed","open"]}}]}},MOTIONDETECTOR_TRANSCEIVER:{ILLUMINATION:{status:[{type:"float",name:"illumination",ref:{value:"motionIllu"}}]},MOTION:{status:[{type:"enum",name:"state",ref:{value:"motionState",options:["on","off"]}}]},RESET_MOTION:{command:[{type:"enum",name:"reset",ref:{value:"motionReset"}}]},MOTION_DETECTION_ACTIVE:{command:[{type:"enum",name:"activate detection",ref:{value:"motionOn"}},{type:"enum",name:"deactivate detection",ref:{value:"motionOff"}},
  {type:"enum",name:"toggle detection",ref:{value:"motionToggle"}}],status:[{type:"enum",name:"detection activated",ref:{value:"motionActivate",options:["off","on"]}}]}},ENERGIE_METER_TRANSMITTER:{ENERGY_COUNTER:{status:[{type:"float",name:"energy counter",ref:{value:"meterEnergyCounter",extMeta:"0.0-838860.7",scale:"0.1"}}]},POWER:{status:[{type:"float",name:"power",ref:{value:"meterPower",extMeta:"0.0-167772.15",scale:"0.01"}}]},CURRENT:{status:[{type:"float",name:"current",ref:{value:"meterCurrent",
  extMeta:"0.0-65535.0",scale:"0.1"}}]},VOLTAGE:{status:[{type:"float",name:"voltage",ref:{value:"meterVoltage",extMeta:"0.0-6553.5",scale:"0.1"}}]},FREQUENCY:{status:[{type:"float",name:"frequency",ref:{value:"meterFrequency",extMeta:"48.72-51.27",scale:"0.01"}}]}},MAINTENANCE_SD:{UNREACH:{status:[{type:"enum",name:"communication error",ref:{value:"errorSdComm",options:["false","true"]}}]},LOW_BAT:{status:[{type:"enum",name:"battery low",ref:{value:"errorSdBat",options:["false","true"]}}]}},SMOKE_DETECTOR:{SMOKE_DETECTOR_ALARM_STATUS:{status:[{type:"enum",
  name:"alarm state",ref:{value:"smokeState",options:["on","off"]}},{type:"enum",name:"alarm detail",ref:{value:"smokeAlarmDetail",options:["off","primary_alarm","intrusion_alarm","secondary_alarm"]}}]},SMOKE_DETECTOR_COMMAND:{command:[{type:"enum",name:"intrusion alarm off",ref:{value:"intrusionAlarmOff"}},{type:"enum",name:"intrusion alarm on",ref:{value:"intrusionAlarmOn"}}]}},DIMMER_TRANSMITTER:{LEVEL:{status:[{type:"int",name:"dimmer status",ref:{value:"dimmerTLevel",extMeta:"0.0-1.005",unit:"%"}}]}},
  DIMMER_VIRTUAL_RECEIVER:{LEVEL:{command:[{type:"enum",name:"on",ref:{value:"dimOn"}},{type:"enum",name:"off",ref:{value:"dimOff"}},{type:"int",name:"dim up",ref:{value:"dimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"dim down",ref:{value:"dimDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"dim to",ref:{value:"dimTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"int",name:"toggle to",ref:{value:"toggleTo",ext:"%d",extMeta:"0-100",unit:"%"}}],status:[{type:"int",name:"dimmer status",
  ref:{value:"dimmerLevel",extMeta:"0-100",unit:"%"}}]}},ALARM_SWITCH_VIRTUAL_RECEIVER:{STATE:{status:[{type:"enum",name:"alarm state",ref:{value:"alarmState",options:["on","off"]}}]},ACOUSTIC_ALARM_SELECTION:{command:[{type:"enum",name:"set audio",ref:{value:"alarmAudio",ext:"%e",extMeta:"DISABLE_ACOUSTIC_SIGNAL FREQUENCY_RISING FREQUENCY_FALLING FREQUENCY_RISING_AND_FALLING FREQUENCY_ALTERNATING_LOW_HIGH FREQUENCY_ALTERNATING_LOW_MID_HIGH FREQUENCY_HIGHON_OFF FREQUENCY_HIGHON_LONGOFF FREQUENCY_LOWON_OFF_HIGHON_OFF FREQUENCY_LOWON_LONGOFF_HIGHON_LONGOFF LOW_BATTERY DISARMED INTERNALLY_ARMED EXTERNALLY_ARMED DELAYED_INTERNALLY_ARMED DELAYED_EXTERNALLY_ARMED EVENT ERROR".split(" ")}}]},
  OPTICAL_ALARM_SELECTION:{command:[{type:"enum",name:"set visual",ref:{value:"alarmVisual",ext:"%e",extMeta:"DISABLE_OPTICAL_SIGNAL BLINKING_ALTERNATELY_REPEATING BLINKING_BOTH_REPEATING DOUBLE_FLASHING_REPEATING FLASHING_BOTH_REPEATING CONFIRMATION_SIGNAL_0 CONFIRMATION_SIGNAL_1 CONFIRMATION_SIGNAL_2".split(" ")}}]},DURATION_UNIT:{command:[{type:"enum",name:"set duration unit",ref:{value:"alarmDurUnit",ext:"%e",extMeta:["S","M","H","D"]}}]},DURATION_VALUE:{command:[{type:"int",name:"set duration",
  ref:{value:"alarmDur",ext:"%d",extMeta:"0-16343"}}]}},ROTARY_HANDLE_TRANSCEIVER:{STATE:{status:[{type:"enum",name:"handle state",ref:{value:"handleState",options:["closed","tilted","open"]}}]}},SHUTTER_TRANSMITTER:{LEVEL:{status:[{type:"int",name:"blind status",ref:{value:"blindTLevel",extMeta:"0-100",unit:"%"}}]}},SHUTTER_VIRTUAL_RECEIVER:{STOP:{command:[{type:"enum",name:"stop",ref:{value:"stop"}}]},LEVEL:{command:[{type:"enum",name:"move up",ref:{value:"moveUp"}},{type:"enum",name:"move down",
  ref:{value:"moveDown"}},{type:"int",name:"step up",ref:{value:"stepUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"step down",ref:{value:"stepDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"move to",ref:{value:"moveTo",ext:"%d",extMeta:"0-100",unit:"%"}}],status:[{type:"int",name:"blind status",ref:{value:"blindLevel",extMeta:"0-100",unit:"%"}}]}},BLIND_TRANSMITTER:{LEVEL:{status:[{type:"int",name:"blind status",ref:{value:"blindTPos",extMeta:"0-100",unit:"%"}}]},LEVEL_2:{status:[{type:"int",
  name:"lamella status",ref:{value:"lamellaTPos",extMeta:"0-100",unit:"%"}}]}},BLIND_VIRTUAL_RECEIVER:{STOP:{command:[{type:"enum",name:"stop",ref:{value:"stop"}}]},LEVEL:{command:[{type:"enum",name:"move up",ref:{value:"moveUp"}},{type:"enum",name:"move down",ref:{value:"moveDown"}},{type:"int",name:"step up",ref:{value:"stepUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"step down",ref:{value:"stepDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"move to",ref:{value:"moveTo",ext:"%d",
  extMeta:"0-100",unit:"%"}}],status:[{type:"int",name:"blind status",ref:{value:"blindPos",extMeta:"0-100",unit:"%"}}]},LEVEL_2:{command:[{type:"enum",name:"lamella up",ref:{value:"lamellaUp"}},{type:"enum",name:"lamella down",ref:{value:"lamellaDown"}},{type:"int",name:"lamella step up",ref:{value:"lamellaStepUp",ext:"%d",extMeta:"1-10",unit:"%"}},{type:"int",name:"lamella step down",ref:{value:"lamellaStepDown",ext:"%d",extMeta:"1-10",unit:"%"}},{type:"int",name:"lamella to",ref:{value:"lamellaTo",
  ext:"%d",extMeta:"0-100",unit:"%"}}],status:[{type:"int",name:"lamella status",ref:{value:"lamellaPos",extMeta:"0-100",unit:"%"}}]}},PRESENCEDETECTOR_TRANSCEIVER:{ILLUMINATION:{status:[{type:"float",name:"illumination",ref:{value:"presenceIllu"}}]},PRESENCE_DETECTION_STATE:{status:[{type:"enum",name:"state",ref:{value:"presenceState",options:["on","off"]}}]},RESET_PRESENCE:{command:[{type:"enum",name:"reset",ref:{value:"presenceReset"}}]},PRESENCE_DETECTION_ACTIVE:{command:[{type:"enum",name:"activate detection",
  ref:{value:"presenceOn"}},{type:"enum",name:"deactivate detection",ref:{value:"presenceOff"}},{type:"enum",name:"toggle detection",ref:{value:"presenceToggle"}}],status:[{type:"enum",name:"detection activated",ref:{value:"presenceActivate",options:["off","on"]}}]}},CLIMATECONTROL_FLOOR_PUMP_TRANSCEIVER:{HUMIDITY_LIMITER:{status:[{type:"enum",name:"humidity limiter",ref:{value:"cl_fp_humidityLimiter",options:["true","false"]}}]},EMERGENCY_OPERATION:{status:[{type:"enum",name:"state",ref:{value:"cl_fp_emergencyOP",
  options:["true","false"]}}]},FROST_PROTECTION:{status:[{type:"enum",name:"frost protection",ref:{value:"cl_fp_frostProtection",options:["true","false"]}}]},STATE:{status:[{type:"enum",name:"controlling state",ref:{value:"cl_fp_state",options:["on","off"]}}]}},CLIMATECONTROL_FLOOR_TRANSCEIVER:{HUMIDITY_LIMITER:{status:[{type:"enum",name:"humidity limiter",ref:{value:"cl_f_humidityLimiter",options:["true","false"]}}]},EMERGENCY_OPERATION:{status:[{type:"enum",name:"state",ref:{value:"cl_f_emergencyOP",
  options:["true","false"]}}]},FROST_PROTECTION:{status:[{type:"enum",name:"frost protection",ref:{value:"cl_f_frostProtection",options:["true","false"]}}]},STATE:{status:[{type:"enum",name:"controlling state",ref:{value:"cl_f_state",options:["on","off"]}}]}},WEATHER_TRANSMIT:{ACTUAL_TEMPERATURE:{status:[{type:"float",name:"actual temperature",ref:{value:"weatherActualTemp",extMeta:"-3276.8-3276.7",scale:"0.1"}}]},HUMIDITY:{status:[{type:"int",name:"humidity",ref:{value:"weatherHum"}}]},ILLUMINATION:{status:[{type:"float",
  name:"brightness",ref:{value:"weatherIllu",extMeta:"0.0-163830.0",scale:"0.1"}}]},SUNSHINEDURATION:{status:[{type:"int",name:"sunshine duration",ref:{value:"weatherSunD",extMeta:"0-163830"}}]},SUNSHINEDURATION_OVERFLOW:{status:[{type:"enum",name:"sunshine duration overflow",ref:{value:"weatherSunDOF",options:["true","false"]}}]},SUNSHINE_THRESHOLD_OVERRUN:{status:[{type:"enum",name:"sunshine threshold overrun",ref:{value:"weatherSunTOR",options:["true","false"]}}]},WIND_SPEED:{status:[{type:"float",
  name:"wind speed",ref:{value:"weatherWindS",extMeta:"0.0-200.0"}}]},WIND_THRESHOLD_OVERRUN:{status:[{type:"enum",name:"wind threshold overrun",ref:{value:"weatherWindTOR",options:["true","false"]}}]},WIND_DIR:{status:[{type:"float",name:"wind direction",ref:{value:"weatherWindD",extMeta:"0.0-357.5"}}]},WIND_DIR_RANGE:{status:[{type:"float",name:"wind direction range",ref:{value:"weatherWindDR",extMeta:"0.0-146.25"}}]},RAINING:{status:[{type:"enum",name:"raining",ref:{value:"weatherRain",options:["true",
  "false"]}}]},RAIN_COUNTER:{status:[{type:"float",name:"rain counter",ref:{value:"weatherRainC",extMeta:"0.0-1638.0"}}]},RAIN_COUNTER_OVERFLOW:{status:[{type:"enum",name:"rain counter overflow",ref:{value:"weatherRainCOF",options:["true","false"]}}]}},CLIMATE_TRANSCEIVER:{ACTUAL_TEMPERATURE:{status:[{type:"float",name:"actual temperature",ref:{value:"climateActualTemp",extMeta:"-3276.8-3276.7",scale:"0.1"}}]},HUMIDITY:{status:[{type:"int",name:"humidity",ref:{value:"climateHum"}}]}},GENERIC_INPUT_TRANSMITER:{CHANGE_OVER:{status:[{type:"enum",
  name:"change over",ref:{value:"genInputChangeOver",options:["true","false"]}}]},EXTERNAL_CLOCK:{status:[{type:"enum",name:"external clock",ref:{value:"genInputExtClock",options:["true","false"]}}]},HUMIDITY_LIMITER:{status:[{type:"enum",name:"humidity limiter",ref:{value:"genInputHumidityLimiter",options:["true","false"]}}]},STATE:{status:[{type:"enum",name:"state",ref:{value:"genInputState",options:["true","false"]}}]},TACTILE_SWITCH:{status:[{type:"enum",name:"tactile swtich",ref:{value:"genInputTactileSwitch",
  options:["true","false"]}}]},TEMPERATURE_LIMITER:{status:[{type:"enum",name:"temperature limiter",ref:{value:"genInputTempLimiter",options:["true","false"]}}]}},ANALOG_OUTPUT_TRANSCEIVER:{LEVEL:{command:[{type:"enum",name:"off",ref:{value:"analogOutputOff"}},{type:"int",name:"up",ref:{value:"analogOutputUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"down",ref:{value:"analogOutputDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"output to",ref:{value:"analogOutputTo",ext:"%d",
  extMeta:"0-100",unit:"%"}}],status:[{type:"int",name:"output status",ref:{value:"analogOutputLevel",extMeta:"0-100",unit:"%"}}]}}};xnm.aio.hm.DimmerKey={buildCommandScript:function(a,c,d){if(!c.channels||!d.value)return null;a=c.channels[d.ext];return a?a='var o;o=dom.GetObject("'+(a+'");if(o!=null){o.State(1);}\no="";\n'):null}};
  xnm.aio.hm.Channel={buildCommandScript:function(a,c,d,b){a=xnm.aio.hm.MHMCCU._getDataPointAddress(a,c,d);return a?b='var o;o=dom.GetObject("'+(a+'");')+b+'o="";\n':null},buildStateScript:function(a,c,d){return'o=dom.GetObject("'+xnm.aio.hm.MHMCCU._getDataPointAddress(a,c,d)+'");if(o!=null){states=states#o.Value();}else{states=states#"?";}'},KEY:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "pressShort":a="PRESS_SHORT";b="if(o!=null){o.State(1);}\n";
  break;case "pressLong":a="PRESS_LONG";b="if(o!=null){o.State(1);}\n";break;case "setValue":if(!b.ext)return null;a="SUBMIT";b='if(o!=null){o.State("'+b.ext+'");}\n';break;case "ledOff":a="LED_STATUS";b="if(o!=null){o.State(0);}\n";break;case "ledRed":a="LED_STATUS";b="if(o!=null){o.State(1);}\n";break;case "ledGreen":a="LED_STATUS";b="if(o!=null){o.State(2);}\n";break;case "ledOrange":a="LED_STATUS";b="if(o!=null){o.State(3);}\n";break;case "setAllLed":if(!b.ext)return null;a="ALL_LEDS";b='if(o!=null){o.State("'+
  b.ext+'");}\n';break;case "sleepModeOff":a="LED_SLEEP_MODE";b="if(o!=null){o.State(0);}\n";break;case "sleepModeOn":a="LED_SLEEP_MODE";b="if(o!=null){o.State(1);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "ledStatus":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"LED_STATUS")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "ledStatus":switch(a){case "0":return"off";
  case "1":return"red";case "2":return"green";case "3":return"orange";default:return"?"}default:return"?"}},resolveState:function(a,c,d){a=d;switch(c.datapoint){case "PRESS_SHORT":var b="pressShort";break;case "PRESS_LONG":b="pressLong";break;case "PRESS_LONG_RELEASE":b="pressLongRelease";break;case "PRESS_CONT":b="pressCont";break;case "LED_STATUS":switch(b="ledStatus",d){case "0":a="off";break;case "1":a="red";break;case "2":a="green";break;case "3":a="orange";break;default:a="?"}}return b?{key:b,
  value:a}:null}},CENTRAL_KEY:{buildCommandScript:function(a,c,d,b){return xnm.aio.hm.Channel.KEY.buildCommandScript(a,c,d,b)},resolveState:function(a,c,d){return xnm.aio.hm.Channel.KEY.resolveState(a,c,d)}},VIRTUAL_KEY:{buildCommandScript:function(a,c,d,b){return xnm.aio.hm.Channel.KEY.buildCommandScript(a,c,d,b)},resolveState:function(a,c,d){return xnm.aio.hm.Channel.KEY.resolveState(a,c,d)}},INPUT_OUTPUT:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "on":case "off":case "toggle":case "onFor":return xnm.aio.hm.Channel.SWITCH.buildCommandScript(a,
  c,d,b);case "pressShort":case "pressLong":return xnm.aio.hm.Channel.KEY.buildCommandScript(a,c,d,b);default:return null}},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "inoutState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "inoutState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b=
  "inoutState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SWITCH:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=c.address;a=e.indexOf(":");-1!=a&&(e=e.substr(0,a));switch(b.value){case "on":b="STATE";a="if(o!=null){o.State(1);}\n";break;case "off":b="STATE";a="if(o!=null){o.State(0);}\n";break;case "toggle":b="STATE";a="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;case "onFor":return a='var o;o=dom.GetObject("'+
  (c["interface"]+"."+e+":"+d.address+'.ON_TIME");\n'),a+="if(o!=null){o.State("+parseFloat(b.ext)+");}\n",a+='o=dom.GetObject("'+c["interface"]+"."+e+":"+d.address+'.STATE");\n',a+'if(o!=null){o.State(1.0);}\no="";\n';default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,b,a)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "switchState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,
  c){if("?"==a)return a;switch(c.value){case "switchState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="switchState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SWITCH_INTERFACE:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "press":break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,"PRESS","if(o!=null){o.State(1);}\n")}},
  DIMMER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=null;switch(b.value){case "dimOn":a="OLD_LEVEL";b="if(o!=null){o.State(1);}\n";break;case "dimOff":a="LEVEL";b="if(o!=null){o.State(0.0);}\n";break;case "dimUp":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"dimmerLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()+0.1;if(v>1){v=1.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"+0.1;if(v>1){v=1.0;}o.State(v);}\n";a="LEVEL";
  break;case "dimDown":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"dimmerLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()-0.1;if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-0.1;if(v<0){v=0.0;}o.State(v);}\n";a="LEVEL";break;case "dimTo":case "dimRaw":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))b=b.ext;else return null;a="LEVEL";b/=100;b=0>b?0:b;b="if(o!=null){o.State("+
  (1<b?1:b)+");}\n";break;case "toggleTo":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if("string"==typeof b.ext)b=b.ext.replace("%",""),b=parseInt(b);else return null;a="LEVEL";b/=100;b=0>b?0:b;b="if(o!=null){real des = 0.0+o.Value(); if(des == 0.0){o.State("+(1<b?1:b).toFixed(2)+");}else{o.State(0.0);}}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;
  if(c.channels&&c.channels.DIMMER)var h=c.channels.DIMMER.address;if(f&&h)if("dimTo"==d.value||"dimRaw"==d.value||"dimOff"==d.value){c="LEVEL";b=0;switch(d.value){case "dimTo":case "dimRaw":b=parseFloat(d.ext);break;case "dimOff":b=0}a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()};e&&e()}else if("dimUp"==d.value||"dimDown"==d.value){c="LEVEL";if(b){d=b.indexOf("<v>");var g=b.indexOf("</v>");-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))&&(b=Math.round(1E4*parseFloat(b))/100,a._statebuffer[f+
  ":"+h+"."+c]={value:b,timestamp:(new Date).getTime()})}e&&e()}else"dimOn"==d.value||"toggleTo"==d.value?(delete a._statebuffer[f+":"+h+".LEVEL"],setTimeout(function(){e&&e()},3E3)):e&&e();else e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "dimmerLevel":var e="LEVEL"}return c&&d&&e&&a?(b=a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=typeof b.value?3E3<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "dimmerLevel":a="LEVEL";break;case "dimmerDirection":a="DIRECTION";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "dimmerLevel":return a=parseFloat(a),Math.round(100*a);case "dimmerDirection":switch(a){case "0":return"none";case "1":return"up";case "2":return"down";case "3":return"undefined";default:return"?"}default:return"?"}},
  resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b="dimmerLevel";break;case "DIRECTION":b="dimmerDirection"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},VIRTUAL_DIMMER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=null;switch(b.value){case "dimOn":a="OLD_LEVEL";b="if(o!=null){o.State(1);}\n";break;case "dimOff":a="LEVEL";b="if(o!=null){o.State(0.0);}\n";break;case "dimUp":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,
  c,d,{value:"dimmerLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()+0.1;if(v>1){v=1.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"+0.1;if(v>1){v=1.0;}o.State(v);}\n";a="LEVEL";break;case "dimDown":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"dimmerLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()-0.1;if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-0.1;if(v<0){v=0.0;}o.State(v);}\n";a="LEVEL";break;case "dimTo":case "dimRaw":if(null==
  b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))b=b.ext;else return null;a="LEVEL";b/=100;b=0>b?0:b;b="if(o!=null){o.State("+(1<b?1:b)+");}\n";break;case "toggleTo":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if("string"==typeof b.ext)b=b.ext.replace("%",""),b=parseInt(b);else return null;a="LEVEL";b/=100;b=0>b?0:b;b="if(o!=null){real des = 0.0+o.Value(); if(des == 0.0){o.State("+
  (1<b?1:b).toFixed(2)+");}else{o.State(0.0);}}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;if(c.channels&&c.channels.DIMMER)var h=c.channels.DIMMER.address;if(f&&h)if("dimTo"==d.value||"dimRaw"==d.value||"dimOff"==d.value){c="LEVEL";b=0;switch(d.value){case "dimTo":case "dimRaw":b=parseFloat(d.ext);break;case "dimOff":b=0}a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()};e&&e()}else if("dimUp"==
  d.value||"dimDown"==d.value){c="LEVEL";if(b){d=b.indexOf("<v>");var g=b.indexOf("</v>");-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))&&(b=Math.round(1E4*parseFloat(b))/100,a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()})}e&&e()}else"dimOn"==d.value||"toggleTo"==d.value?(delete a._statebuffer[f+":"+h+".LEVEL"],setTimeout(function(){e&&e()},3E3)):e&&e();else e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "dimmerLevel":var e="LEVEL"}return c&&
  d&&e&&a?(b=a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=typeof b.value?3E3<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "dimmerLevel":a="LEVEL";break;case "dimmerDirection":a="DIRECTION";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "dimmerLevel":return a=parseFloat(a),
  Math.round(100*a);case "dimmerDirection":switch(a){case "0":return"none";case "1":return"up";case "2":return"down";case "3":return"undefined";default:return"?"}default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b="dimmerLevel";break;case "DIRECTION":b="dimmerDirection"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},BLIND:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=null;switch(b.value){case "blindStepUp":a._statebuffer&&
  (e=this.getBufferedState(a._statebuffer,c,d,{value:"blindLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()+0.1;if(v>1){v=1.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"+0.1;if(v>1){v=1.0;}o.State(v);}\n";a="LEVEL";break;case "blindStepDown":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"blindLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()-0.1;if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-0.1;if(v<0){v=0.0;}o.State(v);}\n";
  a="LEVEL";break;case "blindUp":a="LEVEL";b="if(o!=null){o.State(1.0);}\n";break;case "blindDown":a="LEVEL";b="if(o!=null){o.State(0.0);}\n";break;case "blindTo":case "blindRaw":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))b=b.ext;else return null;a="LEVEL";b/=100;b=0>b?0:b;b="if(o!=null){o.State("+(1<b?1:b)+");}\n";break;case "blindStop":a="STOP";b="if(o!=null){o.State(1);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,
  d,a,b)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;if(c.channels&&c.channels.BLIND)var h=c.channels.BLIND.address;if(f&&h)if("blindTo"==d.value||"blindRaw"==d.value){c="LEVEL";b=0;switch(d.value){case "blindTo":case "blindRaw":b=parseInt(d.ext)}a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()};e&&e()}else if("blindUp"==d.value||"blindDown"==d.value)delete a._statebuffer[f+":"+h+".LEVEL"],setTimeout(function(){e&&e()},3E3);else if("blindStop"==d.value)delete a._statebuffer[f+
  ":"+h+".LEVEL"],e&&e();else{if("blindStepUp"==d.value||"blindStepDown"==d.value){c="LEVEL";if(b){d=b.indexOf("<v>");var g=b.indexOf("</v>");-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))&&(b=Math.round(1E4*parseFloat(b))/100,a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()})}e&&e()}}else e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "blindLevel":var e="LEVEL"}return c&&d&&e&&a?(b=a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=typeof b.value?
  1E4<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "blindLevel":case "blindPosDes":a="LEVEL";break;case "blindDirection":a="DIRECTION";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "blindLevel":case "blindPosDes":a=parseFloat(a);a=Math.round(100*a);if("blindLevel"==
  c.value)return a;if("blindPosDes"==c.value)return 35>=a?"bottom":65>=a?"middle":100>=a?"top":"?";break;case "blindDirection":switch(a){case "0":return"none";case "1":return"up";case "2":return"down";case "3":return"undefined";default:return"?"}default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b=[];a="blindLevel";c=this.handleStatusResponse(d+"",{value:a});b.push({key:a,value:c});a="blindPosDes";c=this.handleStatusResponse(d+"",{value:a});b.push({key:a,value:c});
  return b;case "DIRECTION":return a="blindDirection",c=this.handleStatusResponse(d+"",{value:a}),{key:a,value:c}}return null}},KEYMATIC:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "keyOpen":a="STATE";b="if(o!=null){o.State(1);}\n";break;case "keyLock":a="STATE";b="if(o!=null){o.State(0);}\n";break;case "keyOpenDo":a="OPEN";b="if(o!=null){o.State(true);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "keyState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a){return"?"==a?a:"true"==a?"open":"lock"},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":return a=this.handleStatusResponse(d+"",{value:"keyState"}),{key:"keyState",value:a}}return null}},WINMATIC:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "windowUp":a=
  "LEVEL";b="if(o!=null){var v=o.Value()+0.1;if(v>1){v=1.0;}o.State(v);}\n";break;case "windowDown":a="LEVEL";b="if(o!=null){var v=o.Value()-0.1;if(v<0){v=0.0;}o.State(v);}\n";break;case "windowTo":case "windowRaw":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))b=parseInt(b.ext);else return null;a="LEVEL";b/=100;b=0>b?0:b;b="if(o!=null){o.State("+(1<b?1:b)+");}\n";break;case "winLock":a="LEVEL";b="if(o!=null){o.State(-0.005);}\n";
  break;case "winStop":a="STOP";b="if(o!=null){o.State(1);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},handleCommandResponse:function(a,c,d,b,e){"windowTo"==d.value||"windowRaw"==d.value?setTimeout(function(){e&&e()},3E3):e&&e()},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "winLevel":a="LEVEL";break;case "winDirection":a="DIRECTION";break;case "winError":a="ERROR";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,
  d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "winLevel":return a=parseFloat(a),-.005>=a?100*a:Math.round(100*a);case "winDirection":switch(a){case "0":return"none";case "1":return"up";case "2":return"down";case "3":return"undefined";default:return"?"}case "winError":switch(a){case "0":return"no_error";case "1":return"motor_turn_error";case "2":return"motor_tilt_error";default:return"?"}default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b=
  "winLevel";break;case "DIRECTION":b="winDirection";break;case "ERROR":b="winError"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},CLIMATECONTROL_RT_TRANSCEIVER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=null;switch(b.value){case "themoTempUp":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"themoSetTemp"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.State()+1;if(v>30.5){v=30.5;}o.State(v);}\n":
  "if(o!=null){var v="+e+"+1;if(v>30.5){v=30.5;}o.State(v);}\n";a="SET_TEMPERATURE";break;case "themoTempDown":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"themoSetTemp"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.State()-1;if(v<4.5){v=4.5;}o.State(v);}\n":"if(o!=null){var v="+e+"-1;if(v<4.5){v=4.5;}o.State(v);}\n";a="SET_TEMPERATURE";break;case "themoTempTo":case "themoTempRaw":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=b.ext;
  else if(b.ext.match(/^[-+]?[0-9]*\.?[0-9]+$/))b=parseFloat(b.ext);else return null;a="SET_TEMPERATURE";b=4.5>b?4.5:b;b="if(o!=null){o.State("+(30.5<b?30.5:b)+");}\n";break;case "themoTempOff":a="SET_TEMPERATURE";b="if(o!=null){o.State(4.5);}\n";break;case "themoAutoMode":a="AUTO_MODE";b="if(o!=null){o.State(1);}\n";break;case "themoManuMode":if("number"==typeof b.ext)b=b.ext;else if(b.ext.match(/^[-+]?[0-9]*\.?[0-9]+$/))b=parseFloat(b.ext);else return null;b=4.5>b?4.5:b;a="MANU_MODE";b="if(o!=null){var v="+
  (30.5<b?30.5:b)+";o.State(v);}\n";break;case "themoBoostMode":a="BOOST_MODE";b="if(o!=null){o.State(1);}\n";break;case "themoComfortMode":a="COMFORT_MODE";b="if(o!=null){o.State(1);}\n";break;case "themoLoweringMode":a="LOWERING_MODE";b="if(o!=null){o.State(1);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;if(c.channels&&c.channels.CLIMATECONTROL_RT_TRANSCEIVER)var h=c.channels.CLIMATECONTROL_RT_TRANSCEIVER.address;
  if(f&&h)if("themoAutoMode"==d.value||"themoBoostMode"==d.value||"themoComfortMode"==d.value||"themoLoweringMode"==d.value)switch(c="CONTROL_MODE",d.value){case "themoAutoMode":a._statebuffer[f+":"+h+"."+c]={value:"auto",timestamp:(new Date).getTime()};break;case "themoBoostMode":a._statebuffer[f+":"+h+"."+c]={value:"boost",timestamp:(new Date).getTime()};break;case "themoComfortMode":delete a._statebuffer[f+":"+h+"."+c];break;case "themoLoweringMode":delete a._statebuffer[f+":"+h+"."+c]}else if("themoTempUp"==
  d.value||"themoTempDown"==d.value){if(c="SET_TEMPERATURE",b){d=b.indexOf("<v>");var g=b.indexOf("</v>");-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))&&(b=Math.round(100*parseFloat(b))/100,a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()})}}else"themoTempTo"==d.value||"themoTempRaw"==d.value?(c="SET_TEMPERATURE",b=parseFloat(d.ext),a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()}):"themoTempOff"==d.value?a._statebuffer[f+":"+h+".SET_TEMPERATURE"]={value:4.5,
  timestamp:(new Date).getTime()}:"themoManuMode"==d.value&&(c="SET_TEMPERATURE",b&&(d=b.indexOf("<v>"),g=b.indexOf("</v>"),-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3)))&&(b=Math.round(100*parseFloat(b))/100,a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()}),a._statebuffer[f+":"+h+".CONTROL_MODE"]={value:"manu",timestamp:(new Date).getTime()});e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "themoSetTemp":var e="SET_TEMPERATURE";break;case "themoMode":e=
  "CONTROL_MODE"}return c&&d&&e&&a?(b=a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=typeof b.value?3E4<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "themoMode":a="CONTROL_MODE";break;case "themoFault":case "themoLowbat":a="FAULT_REPORTING";break;case "themoBattery":a="BATTERY_STATE";break;case "themoValve":a="VALVE_STATE";break;case "themoBoost":a="BOOST_STATE";break;
  case "themoActualTemp":a="ACTUAL_TEMPERATURE";break;case "themoSetTemp":a="SET_TEMPERATURE";break;case "themoWinState":a="WINDOW_STATE";break;case "themoActualHum":a="ACTUAL_HUMIDITY";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "themoMode":switch(a){case "0":return"auto";case "1":return"manu";case "2":return"party";case "3":return"boost";default:return"?"}case "themoFault":switch(a){case "0":return"no_fault";
  case "1":return"valve_tight";case "2":return"adjusting_range_too_large";case "3":return"adjusting_range_too_small";case "4":return"communication_error";case "6":return"low_bat";case "7":return"valve_error_position";default:return"?"}case "themoLowbat":switch(a){case "0":case "1":case "2":case "3":case "4":case "7":return!1;case "6":return!0;default:return"?"}case "themoBattery":return xnm.aio.hm.Util.formatFloatString(a);case "themoValve":return parseInt(a);case "themoBoost":return parseInt(a);case "themoActualTemp":return xnm.aio.hm.Util.formatFloatString(a);
  case "themoSetTemp":return xnm.aio.hm.Util.formatFloatString(a);case "themoWinState":switch(a){case "true":return"open";case "false":return"close";default:return"?"}case "themoActualHum":return xnm.aio.hm.Util.formatFloatString(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "FAULT_REPORTING":c=[];var b="themoFault";a=this.handleStatusResponse(d+"",{value:b});c.push({key:b,value:a});b="themoLowbat";a=this.handleStatusResponse(d+"",{value:b});c.push({key:b,value:a});return c;
  case "CONTROL_MODE":b="themoMode";break;case "BATTERY_STATE":b="themoBattery";break;case "VALVE_STATE":b="themoValve";break;case "BOOST_STATE":b="themoBoost";break;case "ACTUAL_TEMPERATURE":b="themoActualTemp";break;case "SET_TEMPERATURE":b="themoSetTemp";break;case "WINDOW_STATE":b="themoWinState";break;case "ACTUAL_HUMIDITY":b="themoActualHum"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},THERMALCONTROL_TRANSMIT:{buildCommandScript:function(a,c,d,b){if(!c.channels||
  !b.value)return null;var e=null;switch(b.value){case "themoTTempUp":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"themoTSetTemp"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.State()+1;if(v>30.5){v=30.5;}o.State(v);}\n":"if(o!=null){var v="+e+"+1;if(v>30.5){v=30.5;}o.State(v);}\n";a="SET_TEMPERATURE";break;case "themoTTempDown":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"themoTSetTemp"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.State()-1;if(v<4.5){v=4.5;}o.State(v);}\n":
  "if(o!=null){var v="+e+"-1;if(v<4.5){v=4.5;}o.State(v);}\n";a="SET_TEMPERATURE";break;case "themoTTempTo":case "themoTTempRaw":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=b.ext;else if(b.ext.match(/^[-+]?[0-9]*\.?[0-9]+$/))b=parseFloat(b.ext);else return null;a="SET_TEMPERATURE";b=4.5>b?4.5:b;b="if(o!=null){o.State("+(30.5<b?30.5:b)+");}\n";break;case "themoTTempOff":a="SET_TEMPERATURE";b="if(o!=null){o.State(4.5);}\n";break;case "themoTAutoMode":a="AUTO_MODE";
  b="if(o!=null){o.State(1);}\n";break;case "themoTManuMode":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=b.ext;else if(b.ext.match(/^[-+]?[0-9]*\.?[0-9]+$/))b=parseFloat(b.ext);else return null;b=4.5>b?4.5:b;a="MANU_MODE";b="if(o!=null){var v="+(30.5<b?30.5:b)+";o.State(v);}\n";break;case "themoTBoostMode":a="BOOST_MODE";b="if(o!=null){o.State(1);}\n";break;case "themoTComfortMode":a="COMFORT_MODE";b="if(o!=null){o.State(1);}\n";break;case "themoTLoweringMode":a=
  "LOWERING_MODE";b="if(o!=null){o.State(1);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;if(c.channels&&c.channels.THERMALCONTROL_TRANSMIT)var h=c.channels.THERMALCONTROL_TRANSMIT.address;if(f&&h)if("themoTTempUp"==d.value||"themoTTempDown"==d.value){if(c="SET_TEMPERATURE",b){d=b.indexOf("<v>");var g=b.indexOf("</v>");-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))&&(b=Math.round(100*parseFloat(b))/100,a._statebuffer[f+
  ":"+h+"."+c]={value:b,timestamp:(new Date).getTime()})}}else"themoTTempRaw"==d.value||"themoTTempTo"==d.value?(c="SET_TEMPERATURE",b=parseFloat(d.ext),a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()}):"themoTTempOff"==d.value?a._statebuffer[f+":"+h+".SET_TEMPERATURE"]={value:4.5,timestamp:(new Date).getTime()}:"themoTManuMode"==d.value&&(c="SET_TEMPERATURE",b&&(d=b.indexOf("<v>"),g=b.indexOf("</v>"),-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))))&&(b=Math.round(100*parseFloat(b))/
  100,a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()});e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "themoTSetTemp":var e="SET_TEMPERATURE"}return c&&d&&e&&a?(b=a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=typeof b.value?3E3<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "themoTMode":a="CONTROL_MODE";break;
  case "themoTLowbat":a="LOWBAT_REPORTING";break;case "themoTComm":a="COMMUNICATION_REPORTING";break;case "themoTWin":a="WINDOW_OPEN_REPORTING";break;case "themoTBattery":a="BATTERY_STATE";break;case "themoTBoost":a="BOOST_STATE";break;case "themoTActualTemp":a="ACTUAL_TEMPERATURE";break;case "themoTActualHum":a="ACTUAL_HUMIDITY";break;case "themoTSetTemp":a="SET_TEMPERATURE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;
  switch(c.value){case "themoTMode":switch(a){case "0":return"auto";case "1":return"manu";case "2":return"party";case "3":return"boost";default:return"?"}case "themoTLowbat":return a;case "themoTComm":return a;case "themoTWin":return"true"==a?"open":"close";case "themoTBattery":return xnm.aio.hm.Util.formatFloatString(a);case "themoTBoost":return parseInt(a);case "themoTActualTemp":return xnm.aio.hm.Util.formatFloatString(a);case "themoTActualHum":return xnm.aio.hm.Util.formatFloatString(a);case "themoTSetTemp":return parseFloat(a);
  default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "CONTROL_MODE":var b="themoTMode";break;case "LOWBAT_REPORTING":b="themoTLowbat";break;case "COMMUNICATION_REPORTING":b="themoTComm";break;case "WINDOW_OPEN_REPORTING":b="themoTWin";break;case "BATTERY_STATE":b="themoTBattery";break;case "BOOST_STATE":b="themoTBoost";break;case "ACTUAL_TEMPERATURE":b="themoTActualHum";break;case "SET_TEMPERATURE":b="themoTSetTemp"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});
  return{key:b,value:a}}},CLIMATECONTROL_REGULATOR:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=null;switch(b.value){case "themoRTempUp":a._statebuffer&&(e=this.getBufferedState(a._stateBuffer,c,d,{value:"themoRSetTemp"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.State()+1;if(v>30.0){v=30.0;}o.State(v);}\n":"if(o!=null){var v="+e+"+1;if(v>30.0){v=30.0;}o.State(v);}\n";a="SETPOINT";break;case "themoRTempDown":a._statebuffer&&(e=this.getBufferedState(a._stateBuffer,
  c,d,{value:"themoRSetTemp"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.State()-1;if(v<6.0){v=6.0;}o.State(v);}\n":"if(o!=null){var v="+e+"-1;if(v<6.0){v=6.0;}o.State(v);}\n";a="SETPOINT";break;case "themoRTempTo":case "themoRTempRaw":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=b.ext;else if(b.ext.match(/^[-+]?[0-9]*\.?[0-9]+$/))b=parseFloat(b.ext);else return null;a="SETPOINT";b=6>b?6:b;b="if(o!=null){o.State("+(30<b?30:b)+");}\n";break;case "themoRTempClose":a=
  "SETPOINT";b="if(o!=null){o.State(6.0);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;if(c.channels&&c.channels.CLIMATECONTROL_REGULATOR)var h=c.channels.CLIMATECONTROL_REGULATOR.address;if(f&&h)if("themoRTempUp"==d.value||"themoRTempDown"==d.value){if(c="SETPOINT",b){d=b.indexOf("<v>");var g=b.indexOf("</v>");-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))&&(b=Math.round(100*parseFloat(b))/100,a._statebuffer[f+
  ":"+h+"."+c]={value:b,timestamp:(new Date).getTime()})}}else"themoRTempRaw"==d.value||"themoRTempTo"==d.value?(c="SETPOINT",b=parseFloat(d.ext),a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()}):"themoRTempClose"==d.value&&(a._statebuffer[f+":"+h+".SETPOINT"]={value:6,timestamp:(new Date).getTime()});e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "themoRSetTemp":var e="SETPOINT"}return c&&d&&e&&a?(b=a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=
  typeof b.value?3E4<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "themoRSetTemp":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"SETPOINT")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "themoRSetTemp":return xnm.aio.hm.Util.formatFloatString(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "SETPOINT":var b=
  "themoRSetTemp"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},CLIMATECONTROL_VENT_DRIVE:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "valveState":a="VALVE_STATE";break;case "valveError":a="ERROR";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "valveState":return xnm.aio.hm.Util.formatFloatString(a);case "valveError":switch(a){case "0":return"no_error";
  case "1":return"valve_drive_blocked";case "2":return"valve_drive_loose";case "3":return"adjusting_range_to_small";case "4":return"low_bat";default:return"?"}default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "VALVE_STATE":var b="valveState";break;case "ERROR":b="valveError"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SIGNAL_LED:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "signalLedOn":a=
  "STATE";b="if(o!=null){o.State(1);}\n";break;case "signalLedOff":a="STATE";b="if(o!=null){o.State(0);}\n";break;case "signalLedToggle":a="STATE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;case "setSignalLed":if(!b.ext||"string"!=typeof b.ext)return null;a="SUBMIT";b='if(o!=null){o.State("'+b.ext+'");}\n';break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "signalLedState":break;
  default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "signalLedState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="signalLedState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SIGNAL_CHIME:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "signalChimeOn":a=
  "STATE";b="if(o!=null){o.State(1);}\n";break;case "signalChimeOff":a="STATE";b="if(o!=null){o.State(0);}\n";break;case "signalChimeToggle":a="STATE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;case "setSignalChime":if(!b.ext||"string"!=typeof b.ext)return null;a="SUBMIT";b='if(o!=null){o.State("'+b.ext+'");}\n';break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "signalChimeState":break;
  default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "signalChimeState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="signalChimeState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},WEATHER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "weatherTemp":case "weatherTemp1":case "weatherTemp2":case "weatherTemp3":case "weatherTemp4":a=
  "TEMPERATURE";switch(b.value){case "weatherTemp1":if(1!=d.address)return null;break;case "weatherTemp2":if(2!=d.address)return null;break;case "weatherTemp3":if(3!=d.address)return null;break;case "weatherTemp4":if(4!=d.address)return null}break;case "weatherHum":a="HUMIDITY";break;case "weatherAirP":a="AIR_PRESSURE";break;case "weatherLowbat":a="LOWBAT";break;case "weatherRaining":a="RAINING";break;case "weatherRainCounter":a="RAIN_COUNTER";break;case "weatherWindS":a="WIND_SPEED";break;case "weatherWindD":case "weatherWindDRaw":a=
  "WIND_DIRECTION";break;case "weatherWindDRRaw":a="WIND_DIRECTION_RANGE";break;case "weatherSunD":a="SUNSHINEDURATION";break;case "weatherBright":a="BRIGHTNESS";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "weatherTemp":case "weatherTemp1":case "weatherTemp2":case "weatherTemp3":case "weatherTemp4":return xnm.aio.hm.Util.formatFloatString(a);case "weatherHum":return parseInt(a);case "weatherAirP":return parseInt(a);
  case "weatherLowbat":return a;case "weatherRaining":return a;case "weatherRainCounter":return xnm.aio.hm.Util.formatFloatString(a);case "weatherWindS":return xnm.aio.hm.Util.formatFloatString(a);case "weatherWindD":return a=parseInt(a),23>a?"N":68>a?"NO":113>a?"O":158>a?"SO":203>a?"S":248>a?"SW":293>a?"W":338>a?"NW":"N";case "weatherWindDRaw":case "weatherWindDRRaw":return parseInt(a);case "weatherSunD":return parseInt(a);case "weatherBright":return parseInt(a);default:return"?"}},resolveState:function(a,
  c,d){if("HM-WDS30-OT2-SM-2"==a.type){a=c.channel;if(!a)return null;var b=a.indexOf(":");if(-1==b)return null;a=a.substr(b+1);switch(c.datapoint){case "TEMPERATURE":"1"==a?e="weatherTemp1":"2"==a?e="weatherTemp2":"3"==a?e="weatherTemp3":"4"==a&&(e="weatherTemp4")}if(!e)return null;c=this.handleStatusResponse(d+"",{value:e});return{key:e,value:c}}var e;switch(c.datapoint){case "TEMPERATURE":e="weatherTemp";break;case "HUMIDITY":e="weatherHum";break;case "AIR_PRESSURE":e="weatherAirP";break;case "LOWBAT":e=
  "weatherLowbat";break;case "RAINING":e="weatherRaining";break;case "RAIN_COUNTER":e="weatherRainCounter";break;case "WIND_SPEED":e="weatherWindS";break;case "WIND_DIRECTION":return a=[],e="weatherWindD",c=this.handleStatusResponse(d+"",{value:e}),a.push({key:e,value:c}),e="weatherWindDRaw",c=this.handleStatusResponse(d+"",{value:e}),a.push({key:e,value:c}),a;case "WIND_DIRECTION_RANGE":e="weatherWindDRRaw";break;case "SUNSHINEDURATION":e="weatherSunD";break;case "BRIGHTNESS":e="weatherBright"}if(!e)return null;
  c=this.handleStatusResponse(d+"",{value:e});return{key:e,value:c}}},WEATHER_TRANSMIT:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "weatherTTemp":a="TEMPERATURE";break;case "weatherTHum":a="HUMIDITY";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "weatherTTemp":return xnm.aio.hm.Util.formatFloatString(a);case "weatherTHum":return parseInt(a);default:return"?"}},
  resolveState:function(a,c,d){switch(c.datapoint){case "TEMPERATURE":var b="weatherTTemp";break;case "HUMIDITY":b="weatherTHum"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},RAINDETECTOR:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "rainState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "rainState":return"0"==
  a?"dry":"rain";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="rainState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},RAINDETECTOR_HEAT:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "rainHeatOn":a="STATE";b="if(o!=null){o.State(1);}\n";break;case "rainHeatOff":a="STATE";b="if(o!=null){o.State(0);}\n";break;case "rainHeatToggle":a="STATE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";
  break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "rainHeatState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "rainHeatState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="rainHeatState"}if(!b)return null;
  a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},ROTARY_HANDLE_SENSOR:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "handleState":a="STATE";break;case "handleError":a="ERROR";break;case "handleLowbat":a="LOWBAT";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "handleState":switch(a){case "0":return"closed";case "1":return"tilted";
  case "2":return"open";default:return"?"}case "handleError":switch(a){case "0":return"no_error";case "1":return"sabotage";default:return"?"}case "handleLowbat":return a;default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="handleState";break;case "ERROR":b="handleError";break;case "LOWBAT":b="handleLowbat"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SHUTTER_CONTACT:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;
  switch(b.value){case "shutterState":a="STATE";break;case "shutterError":a="ERROR";break;case "shutterLowbat":a="LOWBAT";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "shutterState":return 1==a&&(a="true"),0==a&&(a="false"),"true"==a?"open":"closed";case "shutterError":switch(a){case "0":return"no_error";case "1":case "7":return"sabotage";default:return"?"}case "shutterLowbat":return a;default:return"?"}},
  resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="shutterState";break;case "ERROR":b="shutterError";break;case "LOWBAT":b="shutterLowbat"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SENSOR_FOR_CARBON_DIOXIDE:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "co2State":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;
  switch(c.value){case "co2State":switch(a){case "0":return"normal";case "1":return"added";case "2":return"added_strong";default:return"?"}default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="co2State"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},MOTION_DETECTOR:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "motionBright":a="BRIGHTNESS";break;case "motionState":a="MOTION";break;
  case "motionError":a="ERROR";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "motionBright":return parseInt(a);case "motionState":return"true"==a?"on":"off";case "motionError":switch(a){case "0":return"no_error";default:return"sabotage"}default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "BRIGHTNESS":var b="motionBright";break;case "MOTION":b="motionState";break;case "ERROR":b=
  "motionError"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SMOKE_DETECTOR:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "smokeState":a="STATE";break;case "smokeLowbat":a="LOWBAT";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "smokeState":return"true"==a?"on":"off";case "smokeLowbat":return a;default:return"?"}},
  resolveState:function(a,c,d){switch(c.datapoint){case "LOWBAT":var b="smokeLowbat";break;case "STATE":b="smokeState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SMOKE_DETECTOR_TEAM:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "smokeGroup1State":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "smokeGroup1State":return"true"==
  a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="smokeGroup1State"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SMOKE_DETECTOR_TEAM_V2:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "smokeGroupState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "smokeGroupState":return"true"==
  a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="smokeGroupState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},ALARMACTUATOR:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "alarmOn":a="STATE";b="if(o!=null){o.State(1);}\n";break;case "alarmOff":a="STATE";b="if(o!=null){o.State(0);}\n";break;case "alarmToggle":a="STATE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";
  break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "alarmState":a="STATE";break;case "alarmErrPower":a="ERROR_POWER";break;case "alarmErrSabo":a="ERROR_SABOTAGE";break;case "alarmErrBat":a="ERROR_BATTERY";break;case "alarmLowbat":a="LOWBAT";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "alarmState":return"true"==
  a?"on":"off";case "alarmErrPower":switch(a){case "0":return"no_error";case "1":return"power_failure";default:return"?"}case "alarmErrSabo":switch(a){case "0":return"no_error";case "1":return"sabotage";default:return"?"}case "alarmErrBat":switch(a){case "0":return"no_error";case "1":return"barttery_defect";default:return"?"}case "alarmLowbat":return a;default:return null}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="alarmState";break;case "ERROR_POWER":b="alarmErrPower";break;
  case "ERROR_SABOTAGE":b="alarmErrSabo";break;case "ERROR_BATTERY":b="alarmErrBat";break;case "LOWBAT":b="alarmLowbat"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},PULSE_SENSOR:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "seqOk":break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,"SEQUENCE_OK","if(o!=null){o.State(1);}\n")}},CAPACITIVE_FILLING_LEVEL_SENSOR:{buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "fillingLevel":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"FILLING_LEVEL")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "fillingLevel":return parseInt(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "FILLING_LEVEL":var b="fillingLevel"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},TILT_SENSOR:{buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "tiltState":a="STATE";break;case "tiltLowbat":a="LOWBAT";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "tiltState":return"true"==a?"on":"off";case "tiltLowbat":return a;default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="tiltState";break;case "LOWBAT":b="tiltLowbat"}if(!b)return null;a=this.handleStatusResponse(d+
  "",{value:b});return{key:b,value:a}}},WATERDETECTIONSENSOR:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "waterState":a="STATE";break;case "waterLowbat":a="LOWBAT";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "waterState":switch(a){case "0":return"dry";case "1":return"wet";case "2":return"water";default:return"?"}case "waterLowbat":return a;default:return"?"}},
  resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="waterState";break;case "LOWBAT":b="waterLowbat"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},AKKU:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "akkuLevel":a="LEVEL";break;case "akkuStatus":a="STATUS";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "akkuLevel":return xnm.aio.hm.Util.formatFloatString(a);
  case "akkuStatus":switch(a){case "0":return"trickle_charge";case "1":return"charge";case "2":return"discharge";case "3":return"state_unknow";default:return"?"}default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b="akkuLevel";break;case "STATUS":b="akkuStatus"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},DIGITAL_OUTPUT:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "digOutOn":a=
  "STATE";b="if(o!=null){o.State(1);}\n";break;case "digOutOff":a="STATE";b="if(o!=null){o.State(0);}\n";break;case "digOutToggle":a="STATE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "digOutState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,
  c){if("?"==a)return a;switch(c.value){case "digOutState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="digOutState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},DIGITAL_ANALOG_OUTPUT:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "setOutFreq":case "setOutFreqRaw":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=
  b.ext;else if(b.ext.match(/^[-+]?[0-9]*\.?[0-9]+$/))b=parseFloat(b.ext);else return null;a="FREQUENCY";b=0>b?0:b;b="if(o!=null){o.State("+(5E4<b?5E4:b)+");}\n";break;case "daOutOn":a="STATE";b="if(o!=null){o.State(1);}\n";break;case "daOutOff":a="STATE";b="if(o!=null){o.State(0);}\n";break;case "daOutToggle":a="STATE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||
  !b.value)return null;switch(b.value){case "daOutFreq":a="FREQUENCY";break;case "daOutState":a="STATE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "daOutFreq":return xnm.aio.hm.Util.formatFloatString(a);case "daOutState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "FREQUENCY":var b="daOutFreq";break;case "STATE":b="daOutState"}if(!b)return null;
  a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},DIGITAL_INPUT:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "digInFreq":a="FREQUENCY";break;case "digInState":a="STATE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "digInFreq":return xnm.aio.hm.Util.formatFloatString(a);case "digInState":return"true"==a?"on":"off";default:return"?"}},
  resolveState:function(a,c,d){switch(c.datapoint){case "FREQUENCY":var b="digInFreq";break;case "STATE":b="digInState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},DIGITAL_ANALOG_INPUT:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "daInValue":a="VALUE";break;case "daInState":a="STATE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;
  switch(c.value){case "daInValue":return xnm.aio.hm.Util.formatFloatString(a);case "daInState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "VALUE":var b="daInValue";break;case "STATE":b="daInState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SENSOR:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "sensorState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,
  d,"SENSOR")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "sensorState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "SENSOR":var b="sensorState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},POWERMETER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "meterBoot":a="BOOT";break;case "meterEnergyCounter":a="ENERGY_COUNTER";break;
  case "meterPower":a="POWER";break;case "meterCurrent":a="CURRENT";break;case "meterVoltage":a="VOLTAGE";break;case "meterFrequency":a="FREQUENCY";break;default:return null}return'o=dom.GetObject("'+xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,a)+'");if(o!=null){states=states#o.Value();}else{states=states#"?";}'},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "meterBoot":return a;case "meterEnergyCounter":return xnm.aio.hm.Util.formatFloatString(a);case "meterPower":return xnm.aio.hm.Util.formatFloatString(a);
  case "meterCurrent":return xnm.aio.hm.Util.formatFloatString(a);case "meterVoltage":return xnm.aio.hm.Util.formatFloatString(a);case "meterFrequency":return xnm.aio.hm.Util.formatFloatString(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "BOOT":var b="meterBoot";break;case "ENERGY_COUNTER":b="meterEnergyCounter";break;case "POWER":b="meterPower";break;case "CURRENT":b="meterCurrent";break;case "VOLTAGE":b="meterVoltage";break;case "FREQUENCY":b="meterFrequency"}if(!b)return null;
  a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},STATUS_INDICATOR:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "statusIndiOn":a="STATE";b="if(o!=null){o.State(1);}\n";break;case "statusIndiOff":a="STATE";b="if(o!=null){o.State(0);}\n";break;case "statusIndiToggle":a="STATE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "statusIndiState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "statusIndiState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="statusIndiState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},POWERMETER_IGL:{buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "iglBoot":a="BOOT";break;case "iglGasEnergy":a="GAS_ENERGY_COUNTER";break;case "iglGasPower":a="GAS_POWER";break;case "iglEnergy":a="ENERGY_COUNTER";break;case "iglPower":a="POWER";break;default:return null}return'o=dom.GetObject("'+xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,a)+'");if(o!=null){states=states#o.Value();}else{states=states#"?";}'},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "iglBoot":return a;
  case "iglGasEnergy":return parseFloat(a).toFixed(3);case "iglGasPower":return parseFloat(a).toFixed(2);case "iglEnergy":return parseFloat(a).toFixed(1);case "iglPower":return parseFloat(a).toFixed(2);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "BOOT":var b="iglBoot";break;case "GAS_ENERGY_COUNTER":b="iglGasEnergy";break;case "GAS_POWER":b="iglGasPower";break;case "ENERGY_COUNTER":b="iglEnergy";break;case "POWER":b="iglPower"}if(!b)return null;a=this.handleStatusResponse(d+
  "",{value:b});return{key:b,value:a}}},RGBW_COLOR:{_RGBToHSV:function(a,c,d){a/=255;c/=255;d/=255;var b=Math.min(a,Math.min(c,d)),e=Math.max(a,Math.max(c,d));return b==e?[0,0,b]:[60*((a==b?3:d==b?1:5)-(a==b?c-d:d==b?a-c:d-a)/(e-b)),(e-b)/e,e]},buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "color":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)a=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))a=b.ext;else return null;
  b="COLOR";a=0>a?0:a;a="if(o!=null){o.State("+(255<a?255:a)+");}\n";break;case "white":b="COLOR";a="if(o!=null){o.State(200);}\n";break;case "rgb":if(!b.ext||6>b.ext.length)return null;a=parseInt(b.ext.substr(0,2),16);var e=parseInt(b.ext.substr(2,2),16);b=parseInt(b.ext.substr(4,2),16);b=this._RGBToHSV(a,e,b);a=.1>b[1]?200:Math.round(b[0]/1.8);b="COLOR";a="if(o!=null){o.State("+a+");}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,b,a)},buildStateScript:function(a,c,
  d,b){if(!c.channels||!b.value)return null;switch(b.value){case "colorState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"COLOR")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "colorState":return parseInt(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "COLOR":var b="colorState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},RGBW_AUTOMATIC:{buildCommandScript:function(a,c,
  d,b){if(!c.channels||!b.value)return null;switch(b.value){case "program":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)a=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))a=b.ext;else return null;a=0>a?0:a;break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,"PROGRAM","if(o!=null){o.State("+(255<a?255:a)+");}\n")},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "programState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,
  d,"PROGRAM")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "programState":return parseInt(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "PROGRAM":var b="programState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},MAINTENANCE:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "maintLowbat":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,
  d,"LOWBAT")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "maintLowbat":return a;default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LOWBAT":var b="maintLowbat"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},LUXMETER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "luxState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"LUX")},handleStatusResponse:function(a,
  c){if("?"==a)return a;switch(c.value){case "luxState":return parseFloat(a).toFixed(2);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LUX":var b="luxState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SWITCH_SENSOR:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "switchSensorInOn":a="STATE";b="if(o!=null){o.State(1);}\n";break;case "switchSensorInOff":a="STATE";b="if(o!=null){o.State(0);}\n";
  break;case "switchSensorInToggle":a="STATE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;case "switchSensorExOn":a="STATE";b="if(o!=null){o.State(1);}\n";break;case "switchSensorExOff":a="STATE";b="if(o!=null){o.State(0);}\n";break;case "switchSensorExToggle":a="STATE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;
  switch(b.value){case "switchSensorInState":a="STATE";break;case "switchSensorExState":a="STATE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "switchSensorInState":case "switchSensorExState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){a=c.channel;if(!a)return null;var b=a.indexOf(":");if(-1==b)return null;a=a.substr(b+1);var e;switch(c.datapoint){case "STATE":"1"==
  a?e="switchSensorInState":"2"==a&&(e="switchSensorExState")}if(!e)return null;c=this.handleStatusResponse(d+"",{value:e});return{key:e,value:c}}},SWITCH_PANIC:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "switchPanicOn":a="STATE";b="if(o!=null){o.State(1);}\n";break;case "switchPanicOff":a="STATE";b="if(o!=null){o.State(0);}\n";break;case "switchPanicToggle":a="STATE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,
  d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "switchPanicState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "switchPanicState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="switchPanicState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,
  value:a}}},ARMING:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "armingDisarm":a="ARMSTATE";b='if(o!=null){o.State("0");}\n';break;case "armingIntern":a="ARMSTATE";b='if(o!=null){o.State("1");}\n';break;case "armingAll":a="ARMSTATE";b='if(o!=null){o.State("2");}\n';break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "armingState":a=
  "ARMSTATE";break;case "armingErrSabo":a="ERROR_SABOTAGE";break;case "armingLowbat":a="LOWBAT";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "armingState":return 0==a?a="disarmed":1==a?a="internal_armed":2==a?a="all_armed":3==a&&(a="alarm_blocked"),a;case "armingErrSabo":switch(a){case "0":return"no_error";case "1":return"sabotage";default:return"?"}case "armingLowbat":return a;default:return"?"}},
  resolveState:function(a,c,d){switch(c.datapoint){case "ARMSTATE":var b="armingState";break;case "ERROR_SABOTAGE":b="armingErrSabo";break;case "LOWBAT":b="armingLowbat"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},JALOUSIE:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=null;switch(b.value){case "jalStepUp":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"jalLevel"}));e=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()+0.05;if(v>1){v=1.0;}o.State(v);}\n":
  "if(o!=null){var v="+e/100+"+0.05;if(v>1){v=1.0;}o.State(v);}\n";a="LEVEL";break;case "jalStepDown":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"jalLevel"}));e=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()-0.05;if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-0.05;if(v<0){v=0.0;}o.State(v);}\n";a="LEVEL";break;case "jalUp":a="LEVEL";e="if(o!=null){o.State(1.0);}\n";break;case "jalDown":a="LEVEL";e="if(o!=null){o.State(0.0);}\n";break;case "jalRaw":if(null==
  b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)e=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))e=b.ext;else return null;a="LEVEL";e/=100;e=0>e?0:e;e="if(o!=null){o.State("+(1<e?1:e)+");}\n";break;case "jalStop":a="STOP";e="if(o!=null){o.State(1);}\n";break;case "jalLmlStepUp":b=b.ext;"undefined"!=typeof b&&null!=b&&b||(b=5);isNaN(parseInt(b))&&(b=5);b/=100;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"jalLmlLevel"}));e=null==e||"undefined"==typeof e?
  "if(o!=null){var v=o.Value()+"+b+";if(v>1){v=1.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"+"+b+";if(v>1){v=1.0;}o.State(v);}\n";a="LEVEL_SLATS";break;case "jalLmlStepDown":b=b.ext;"undefined"!=typeof b&&null!=b&&b||(b=5);isNaN(parseInt(b))&&(b=5);b/=100;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"jalLmlLevel"}));e=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()-"+b+";if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-"+b+";if(v<0){v=0.0;}o.State(v);}\n";
  a="LEVEL_SLATS";break;case "jalLmlUp":a="LEVEL_SLATS";e="if(o!=null){o.State(1.0);}\n";break;case "jalLmlDown":a="LEVEL_SLATS";e="if(o!=null){o.State(0.0);}\n";break;case "jalLmlRaw":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)e=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))e=b.ext;else return null;a="LEVEL_SLATS";e/=100;e=0>e?0:e;e="if(o!=null){o.State("+(1<e?1:e)+");}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,e)},handleCommandResponse:function(a,
  c,d,b,e){var f=c.address;if(c.channels&&c.channels.JALOUSIE)var h=c.channels.JALOUSIE.address;if(f&&h)if("jalRaw"==d.value)c="LEVEL",b=parseInt(d.ext),a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()},e&&e();else if("jalUp"==d.value||"jalDown"==d.value)delete a._statebuffer[f+":"+h+".LEVEL"],setTimeout(function(){e&&e()},3E3);else if("jalStop"==d.value)delete a._statebuffer[f+":"+h+".LEVEL"],delete a._statebuffer[f+":"+h+".LEVEL_SLATS"],e&&e();else if("jalStepUp"==d.value||"jalStepDown"==
  d.value){c="LEVEL";if(b){d=b.indexOf("<v>");var g=b.indexOf("</v>");-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))&&(b=Math.round(1E4*parseFloat(b))/100,a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()})}e&&e()}else if("jalLmlRaw"==d.value)c="LEVEL_SLATS",b=parseInt(d.ext),a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()},e&&e();else if("jalLmlUp"==d.value||"jalLmlDown"==d.value)delete a._statebuffer[f+":"+h+".LEVEL_SLATS"],setTimeout(function(){e&&e()},3E3);
  else{if("jalLmlStepUp"==d.value||"jalLmlStepDown"==d.value)c="LEVEL_SLATS",b&&(d=b.indexOf("<v>"),g=b.indexOf("</v>"),-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3)))&&(b=Math.round(1E4*parseFloat(b))/100,a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()}),e&&e()}else e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "jalLevel":var e="LEVEL";break;case "jalLmlLevel":e="LEVEL_SLATS"}return c&&d&&e&&a?(b=a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=
  typeof b.value?1E4<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "jalLevel":case "jalPosDes":a="LEVEL";break;case "jalDirection":a="DIRECTION";break;case "jalLmlLevel":a="LEVEL_SLATS";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "jalLevel":case "jalPosDes":a=parseFloat(a);
  a=Math.round(100*a);if("jalLevel"==c.value)return a;if("jalPosDes"==c.value)return 35>=a?"bottom":65>=a?"middle":100>=a?"top":"?";break;case "jalDirection":switch(a){case "0":return"none";case "1":return"up";case "2":return"down";case "3":return"undefined";default:return"?"}case "jalLmlLevel":return a=parseFloat(a),Math.round(100*a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b=[];a="jalLevel";c=this.handleStatusResponse(d+"",{value:a});b.push({key:a,value:c});
  a="jalPosDes";c=this.handleStatusResponse(d+"",{value:a});b.push({key:a,value:c});return b;case "DIRECTION":return a="jalDirection",c=this.handleStatusResponse(d+"",{value:a}),{key:a,value:c};case "LEVEL_SLATS":return a="jalLmlLevel",c=this.handleStatusResponse(d+"",{value:a}),{key:a,value:c}}return null}},POWERMETER_IEC1:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "iec1Boot":a="BOOT";break;case "iec1GasEnergy":a="GAS_ENERGY_COUNTER";break;case "iec1GasPower":a=
  "GAS_POWER";break;case "iec1Energy":a="ENERGY_COUNTER";break;case "iec1Power":a="POWER";break;case "iec1IecEnergy":a="IEC_ENERGY_COUNTER";break;case "iec1IecPower":a="IEC_POWER";break;default:return null}return'o=dom.GetObject("'+xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,a)+'");if(o!=null){states=states#o.Value();}else{states=states#"?";}'},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "iec1Boot":return a;case "iec1GasEnergy":return parseFloat(a).toFixed(3);case "iec1GasPower":return parseFloat(a).toFixed(2);
  case "iec1Energy":return parseFloat(a).toFixed(1);case "iec1Power":return parseFloat(a).toFixed(2);case "iec1IecEnergy":return parseFloat(a).toFixed(1);case "iec1IecPower":return parseFloat(a).toFixed(2);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "BOOT":var b="iec1Boot";break;case "GAS_ENERGY_COUNTER":b="iec1GasEnergy";break;case "GAS_POWER":b="iec1GasPower";break;case "ENERGY_COUNTER":b="iec1Energy";break;case "POWER":b="iec1Power";break;case "IEC_ENERGY_COUNTER":b=
  "iec1IecEnergy";break;case "IEC_POWER":b="iec1IecPower"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},POWERMETER_IEC2:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "iec2Boot":a="BOOT";break;case "iec2GasEnergy":a="GAS_ENERGY_COUNTER";break;case "iec2GasPower":a="GAS_POWER";break;case "iec2Energy":a="ENERGY_COUNTER";break;case "iec2Power":a="POWER";break;case "iec2IecEnergy":a="IEC_ENERGY_COUNTER";break;case "iec2IecPower":a=
  "IEC_POWER";break;default:return null}return'o=dom.GetObject("'+xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,a)+'");if(o!=null){states=states#o.Value();}else{states=states#"?";}'},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "iec2Boot":return a;case "iec2GasEnergy":return parseFloat(a).toFixed(3);case "iec2GasPower":return parseFloat(a).toFixed(2);case "iec2Energy":return parseFloat(a).toFixed(1);case "iec2Power":return parseFloat(a).toFixed(2);case "iec2IecEnergy":return parseFloat(a).toFixed(1);
  case "iec2IecPower":return parseFloat(a).toFixed(2);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "BOOT":var b="iec2Boot";break;case "GAS_ENERGY_COUNTER":b="iec2GasEnergy";break;case "GAS_POWER":b="iec2GasPower";break;case "ENERGY_COUNTER":b="iec2Energy";break;case "POWER":b="iec2Power";break;case "IEC_ENERGY_COUNTER":b="iec2IecEnergy";break;case "IEC_POWER":b="iec2IecPower"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},MOD_EM8BIT_TRANSMITTER:{buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "state8bit":a="STATE";break;case "lowbat":a="LOWBAT";break;default:return null}return'o=dom.GetObject("'+xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,a)+'");if(o!=null){states=states#o.Value();}else{states=states#"?";}'},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "lowbat":return a;case "state8bit":return parseInt(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b=
  "state8bit";break;case "LOWBAT":b="lowbat"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},DUAL_WHITE_BRIGHTNESS:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=null;switch(b.value){case "dualWBOn":a="OLD_LEVEL";b="if(o!=null){o.State(1);}\n";break;case "dualWBOff":a="LEVEL";b="if(o!=null){o.State(0.0);}\n";break;case "dualWBUp":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"dualWBLevel"}));b=null==e||"undefined"==
  typeof e?"if(o!=null){var v=o.Value()+0.1;if(v>1){v=1.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"+0.1;if(v>1){v=1.0;}o.State(v);}\n";a="LEVEL";break;case "dualWBDown":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"dualWBLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()-0.1;if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-0.1;if(v<0){v=0.0;}o.State(v);}\n";a="LEVEL";break;case "dualWBTo":if(null==b.ext||"undefined"==typeof b.ext)return null;
  if("number"==typeof b.ext)b=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))b=b.ext;else return null;a="LEVEL";b/=100;b=0>b?0:b;b="if(o!=null){o.State("+(1<b?1:b)+");}\n";break;case "dualWBToggleTo":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if("string"==typeof b.ext)b=b.ext.replace("%",""),b=parseInt(b);else return null;a="LEVEL";b/=100;b=0>b?0:b;b="if(o!=null){real des = 0.0+o.Value(); if(des == 0.0){o.State("+(1<b?1:b).toFixed(2)+
  ");}else{o.State(0.0);}}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;if(c.channels&&c.channels.DIMMER)var h=c.channels.DIMMER.address;if(f&&h)if("dualWBToggleTo"==d.value||"dualWBOff"==d.value){c="LEVEL";b=0;switch(d.value){case "dualWBToggleTo":b=parseFloat(d.ext);break;case "dualWBOff":b=0}a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()};e&&e()}else if("dualWBUp"==d.value||"dualWBDown"==
  d.value){c="LEVEL";if(b){d=b.indexOf("<v>");var g=b.indexOf("</v>");-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))&&(b=Math.round(1E4*parseFloat(b))/100,a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()})}e&&e()}else"dualWBOn"==d.value||"dualWBToggleTo"==d.value?(delete a._statebuffer[f+":"+h+".LEVEL"],setTimeout(function(){e&&e()},3E3)):e&&e();else e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "dualWBLevel":var e="LEVEL"}return c&&d&&e&&
  a?(b=a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=typeof b.value?3E3<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "dualWBLevel":a="LEVEL";break;case "dualWBDirection":a="DIRECTION";break;case "dualWBErrHeat":a="ERROR_OVERHEAT";break;case "dualWBErrReduced":a="ERROR_REDUCED";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,
  c){if("?"==a)return a;switch(c.value){case "dualWBLevel":return a=parseFloat(a),Math.round(100*a);case "dualWBDirection":switch(a){case "0":return"none";case "1":return"up";case "2":return"down";case "3":return"undefined";default:return"?"}case "dualWBErrHeat":switch(a){case "0":return"no_error";case "1":return"over_heat";default:return"?"}case "dualWBErrReduced":switch(a){case "0":return"no_error";case "1":return"reduced";default:return"?"}default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b=
  "dualWBLevel";break;case "DIRECTION":b="dualWBDirection";break;case "ERROR_OVERHEAT":b="dualWBErrHeat";break;case "ERROR_REDUCED":b="dualWBErrReduced"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},DUAL_WHITE_COLOR:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=null;switch(b.value){case "dualWCOn":a="OLD_LEVEL";b="if(o!=null){o.State(1);}\n";break;case "dualWCOff":a="LEVEL";b="if(o!=null){o.State(0.0);}\n";break;case "dualWCUp":a._statebuffer&&
  (e=this.getBufferedState(a._statebuffer,c,d,{value:"dualWCLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()+0.1;if(v>1){v=1.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"+0.1;if(v>1){v=1.0;}o.State(v);}\n";a="LEVEL";break;case "dualWCDown":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"dualWCLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()-0.1;if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-0.1;if(v<0){v=0.0;}o.State(v);}\n";
  a="LEVEL";break;case "dualWCTo":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))b=b.ext;else return null;a="LEVEL";b/=100;b=0>b?0:b;b="if(o!=null){o.State("+(1<b?1:b)+");}\n";break;case "dualWCToggleTo":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if("string"==typeof b.ext)b=b.ext.replace("%",""),b=parseInt(b);else return null;a="LEVEL";b/=100;b=0>b?0:b;
  b="if(o!=null){real des = 0.0+o.Value(); if(des == 0.0){o.State("+(1<b?1:b).toFixed(2)+");}else{o.State(0.0);}}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;if(c.channels&&c.channels.DIMMER)var h=c.channels.DIMMER.address;f&&h?"dualWCOff"==d.value?(a._statebuffer[f+":"+h+".LEVEL"]={value:0,timestamp:(new Date).getTime()},e&&e()):"dualWCUp"==d.value||"dualWCDown"==d.value?(b&&(c=b.indexOf("<v>"),d=b.indexOf("</v>"),
  -1!=c&&-1!=d&&c+3<d&&(b=b.substr(c+3,d-c-3)))&&(b=Math.round(1E4*parseFloat(b))/100,a._statebuffer[f+":"+h+".LEVEL"]={value:b,timestamp:(new Date).getTime()}),e&&e()):"dualWCOn"==d.value?(delete a._statebuffer[f+":"+h+".LEVEL"],setTimeout(function(){e&&e()},3E3)):e&&e():e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "dualWCLevel":var e="LEVEL"}return c&&d&&e&&a?(b=a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=typeof b.value?3E3<=(new Date).getTime()-b.timestamp?
  (delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "dualWCLevel":a="LEVEL";break;case "dualWCDirection":a="DIRECTION";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "dualWCLevel":return a=parseFloat(a),Math.round(100*a);case "dualWCDirection":switch(a){case "0":return"none";case "1":return"up";case "2":return"down";
  case "3":return"undefined";default:return"?"}default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b="dualWCLevel";break;case "DIRECTION":b="dualWCDirection"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}}};
  xnm.aio.hm.SysVar={BINARY:{buildCommandScript:function(a,c,d){if(!c.address||!d.value)return null;a='var o;o=dom.GetObject("'+(c.address+'");');switch(d.value){case "binaryOn":a+="if(o!=null){o.State(1);}\n";break;case "binaryOff":a+="if(o!=null){o.State(0);}\n";break;case "binaryToggle":a+="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;default:return null}return a+'o="";\n'},buildStateScript:function(a,c,d){if(!c.address)return null;a='o=dom.GetObject("'+c.address+'");';return a=
  d&&d.value&&"mappedState"==d.value?a+'if(o!=null){if(o.Value()){states=states#o.ValueName1();}else{states=states#o.ValueName0();}}else{states=states#"?";}':a+'if(o!=null){states=states#o.Value().ToString();}else{states=states#"?";}'},handleStatusResponse:function(a,c){return"?"==a?a:c&&c.value&&"mappedState"==c.value?a:"true"==a?"on":"false"==a?"off":"?"}},FLOAT:{buildCommandScript:function(a,c,d){if(!c.address||!d.value)return null;a='var o;o=dom.GetObject("'+(c.address+'");');switch(d.value){case "setFloatValue":case "rawFloatValue":if(null==
  d.ext||void 0==d.ext||"number"!=typeof d.ext&&!d.ext.match(/^[-+]?[0-9]*\.?[0-9]+$/))return null;a+="if(o!=null){o.State("+d.ext+");}\n";break;default:return null}return a+'o="";\n'},buildStateScript:function(a,c){return c.address?'o=dom.GetObject("'+c.address+'");if(o!=null){states=states#o.Value();}else{states=states#"?";}':null},handleStatusResponse:function(a){return"?"==a?a:parseFloat(a)}},INTEGER:{buildCommandScript:function(a,c,d){if(!c.address||!d.value)return null;a='var o;o=dom.GetObject("'+
  (c.address+'");');switch(d.value){case "setIntegerValue":case "rawIntValue":if(null==d.ext||void 0==d.ext)return null;if("number"==typeof d.ext)d=parseInt(d.ext);else if(d.ext.match(/^[-+]?[0-9]+$/))d=d.ext;else return null;break;default:return null}return a+("if(o!=null){o.State("+d+');}\no="";\n')},buildStateScript:function(a,c,d){if(!c.address)return null;a='o=dom.GetObject("'+c.address+'");';return a=d&&d.value&&"mappedState"==d.value?a+'if(o!=null){states=states#o.ValueList().StrValueByIndex(";", o.Value());}else{states=states#"?";}':
  a+'if(o!=null){states=states#o.Value();}else{states=states#"?";}'},handleStatusResponse:function(a,c){return"?"==a?a:c&&c.value&&"mappedState"==c.value?a:parseInt(a)}},STRING:{buildCommandScript:function(a,c,d){if(!c.address||!d.value)return null;a='var o;o=dom.GetObject("'+(c.address+'");');switch(d.value){case "rawStringValue":if(null!=d.ext&&void 0!=d.ext&&"string"==typeof d.ext){c="";for(var b=0;b<d.ext.length;b++){var e=d.ext[b],f=e.charCodeAt(0);c=127<f||"\\"===e||'"'===e?c+("&#"+f+";"):c+e}}else return null;
  break;default:return null}return a+('if(o!=null){o.State("'+c+'");}\no="";\n')},buildStateScript:function(a,c){return c.address?'o=dom.GetObject("'+c.address+'");if(o!=null){states=states#o.Value();}else{states=states#"?";}':null},handleStatusResponse:function(a){"string"===typeof a&&(a=a.replace(/&apos;/g,"'"),a=a.replace(/&#[0-9]+;/g,function(a){a=a.substring(2,a.length-1);return String.fromCharCode(a)}));return a}}};
  xnm.aio.hm.Prog={buildCommandScript:function(a,c,d){if(!c.address||!d.value)return null;switch(d.value){case "progExec":break;default:return null}return'var o;o=dom.GetObject("'+(c.address+'");if(o!=null){o.ProgramExecute();}\no="";\n')}};
  xnm.aio.hm.CUxDChannel={KEY:{buildCommandScript:function(a,c,d,b){if(a=xnm.aio.hm.Channel.KEY.buildCommandScript(a,c,d,b))return a;if(!c.channels||!b.value)return null;switch(b.value){case "cmdShort":b="CMD_RUNS";a="if(o!=null){o.State(1);}\n";break;case "cmdLong":b="CMD_RUNL";a="if(o!=null){o.State(1);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,b,a)}},SWITCH:{buildCommandScript:function(a,c,d,b){if(a=xnm.aio.hm.Channel.SWITCH.buildCommandScript(a,c,d,b))return a;
  if(!c.channels||!b.value)return null;switch(b.value){case "switchNightOn":b="NIGHT_MODE";a="if(o!=null){o.State(1);}\n";break;case "switchNightOff":b="NIGHT_MODE";a="if(o!=null){o.State(0);}\n";break;case "switchNightToggle":b="NIGHT_MODE";a="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;case "switchLedOff":b="INFO_LED";a="if(o!=null){o.State(0);}\n";break;case "switchLedGreen":b="INFO_LED";a="if(o!=null){o.State(1);}\n";break;case "switchLedOrange":b="INFO_LED";a="if(o!=null){o.State(2);}\n";
  break;case "switchLedRed":b="INFO_LED";a="if(o!=null){o.State(3);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,b,a)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "switchState":a="STATE";break;case "switchPower":a="POWER";break;case "switchEnergyCount":a="ENERGY_COUNTER";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "switchState":return"true"==
  a?"on":"off";case "switchPower":case "switchEnergyCount":return parseFloat(a);default:return"?"}}},DIMMER:{buildCommandScript:function(a,c,d,b){if(a=xnm.aio.hm.Channel.DIMMER.buildCommandScript(a,c,d,b))return a;if(!c.channels||!b.value)return null;switch(b.value){case "dimToggle":b="TOGGLE";a="if(o!=null){o.State(1);}\n";break;case "valveOn":b="OLD_LEVEL";a="if(o!=null){o.State(1);}\n";break;case "valveOff":b="LEVEL";a="if(o!=null){o.State(0.0);}\n";break;case "valveUp":b="LEVEL";a="if(o!=null){var v=o.Value()+0.1;if(v>1){v=1.0;}o.State(v);}\n";
  break;case "valveDown":b="LEVEL";a="if(o!=null){var v=o.Value()-0.1;if(v<0){v=0.0;}o.State(v);}\n";break;case "valveTo":case "valveRaw":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)a=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))a=b.ext;else return null;b="LEVEL";a/=100;a=0>a?0:a;a="if(o!=null){o.State("+(1<a?1:a)+");}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,b,a)},handleCommandResponse:function(a,c,d,b,e){"dimTo"==d.value||
  "dimRaw"==d.value||"dimOn"==d.value||"dimOff"==d.value||"dimToggle"==d.value||"valveTo"==d.value||"valveRaw"==d.value||"valveOn"==d.value||"valveOff"==d.value?setTimeout(function(){e&&e()},3E3):e&&e()},buildStateScript:function(a,c,d,b){if(a=xnm.aio.hm.Channel.DIMMER.buildStateScript(a,c,d,b))return a;if(!c.channels||!b.value)return null;switch(b.value){case "valveLevel":b="LEVEL";break;case "dimPower":b="POWER";break;case "dimEnergyCount":b="ENERGY_COUNTER";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,
  d,b)},handleStatusResponse:function(a,c){var d=xnm.aio.hm.Channel.DIMMER.handleStatusResponse(a,c);if(null!=d&&"undefined"!=typeof d&&"?"!=d)return d;if("?"==a)return a;switch(c.value){case "valveLevel":return xnm.aio.hm.Util.formatFloatString(100*a);case "dimPower":case "dimEnergyCount":return xnm.aio.hm.Util.formatFloatString(a);default:return"?"}}},CLIMATECONTROL_REGULATOR:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;a=null;switch(b.value){case "themoRTempUp":b="SETPOINT";
  a="if(o!=null){var v=o.Value()+2;if(v>99.5){v=99.5;}o.State(v);}\n";break;case "themoRTempDown":b="SETPOINT";a="if(o!=null){var v=o.Value()-2;if(v<0.0){v=0.0;}o.State(v);}\n";break;case "themoRTempTo":case "themoRTempRaw":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)var e=b.ext;else if(b.ext.match(/^[-+]?[0-9]*\.?[0-9]+$/))e=parseFloat(b.ext);else return null;b="SETPOINT";e=0>e?0:e;a="if(o!=null){o.State("+(99.5<e?99.5:e)+");}\n";break;case "themoRTempClose":b="SETPOINT";
  a="if(o!=null){o.State(5.5);}\n";break;case "themoRTempOpen":b="SETPOINT";a="if(o!=null){o.State(30.5);}\n";break;case "themoRValveOpen":b="STATE";a="if(o!=null){o.State(1);}\n";break;case "themoRValveClose":b="STATE";a="if(o!=null){o.State(0);}\n";break;case "themoRModeAuto":b="MODE_TEMPERATUR_REGULATOR";a="if(o!=null){o.State(0);}\n";break;case "themoRModeManu":b="MODE_TEMPERATUR_REGULATOR";a="if(o!=null){o.State(1);}\n";break;case "themoRComfortTempTo":case "themoRComfortTempRaw":if(null==b.ext||
  "undefined"==typeof b.ext)return null;if("number"==typeof b.ext)e=b.ext;else if(b.ext.match(/^[-+]?[0-9]*\.?[0-9]+$/))e=parseFloat(b.ext);else return null;b="TEMPERATUR_COMFORT_VALUE";e=0>e?0:e;a="if(o!=null){o.State("+(99.5<e?99.5:e)+");}\n";break;case "themoRLowerTempTo":case "themoRLowerTempRaw":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)e=b.ext;else if(b.ext.match(/^[-+]?[0-9]*\.?[0-9]+$/))e=parseFloat(b.ext);else return null;b="TEMPERATUR_LOWERING_VALUE";
  e=0>e?0:e;a="if(o!=null){o.State("+(99.5<e?99.5:e)+");}\n";break;case "themoRWinTempTo":case "themoRWinTempRaw":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)e=b.ext;else if(b.ext.match(/^[-+]?[0-9]*\.?[0-9]+$/))e=parseFloat(b.ext);else return null;b="TEMPERATUR_WINDOW_OPEN_VALUE";e=0>e?0:e;a="if(o!=null){o.State("+(99.5<e?99.5:e)+");}\n";break;case "themoRSetPartyEnd":if(null==b.ext||"undefined"==typeof b.ext)return null;e=b.ext;b="PARTY_END_TIME";a="if(o!=null){o.State('"+
  e+"');}\n";break;case "themoRValveState":if(null==b.ext||void 0==b.ext)return null;if("number"==typeof b.ext)e=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))e=b.ext;else return null;b="VALVE_STATE";a+="if(o!=null){o.State("+e+");}\n";break;case "themoRSummerOn":b="SUMMER_MODE";a="if(o!=null){o.State(1);}\n";break;case "themoRSummerOff":b="SUMMER_MODE";a="if(o!=null){o.State(0);}\n";break;case "themoRSummerToggle":b="SUMMER_MODE";a="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";
  break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,b,a)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "themoRSetTemp":a="SETPOINT";break;case "themoRComfortTemp":a="TEMPERATUR_COMFORT_VALUE";break;case "themoRLowerTemp":a="TEMPERATUR_LOWERING_VALUE";break;case "themoRWinTemp":a="TEMPERATUR_WINDOW_OPEN_VALUE";break;case "themoRMode":a="MODE_TEMPERATUR_REGULATOR";break;case "themoRPartyEnd":a="PARTY_END_TIME";break;case "themoRSummer":a=
  "SUMMER_MODE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "themoRSetTemp":case "themoRComfortTemp":case "themoRLowerTemp":case "themoRWinTemp":return xnm.aio.hm.Util.formatFloatString(a);case "themoRMode":switch(a){case "0":return"auto";case "1":return"manu";case "2":return"party";default:return"?"}case "themoRPartyEnd":return a;case "themoRSummer":return"true"==a?"on":"off";default:return"?"}}},
  CLIMATECONTROL_VENT_DRIVE:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "valveState":a="VALVE_STATE";break;case "valveOffset":a="VALVE_OFFSET_VALUE";break;case "valveTemperature":a="TEMPERATURE";break;case "valveAlamr":a="ALARM";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "valveState":return parseInt(a);case "valveOffset":return parseInt(a);case "valveTemperature":return xnm.aio.hm.Util.formatFloatString(a);
  case "valveAlamr":return"true"==a?"alarm":"ok";default:return"?"}}},WEATHER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "weatherMinTemp":a="TEMP_MIN_24H";break;case "weatherMaxTemp":a="TEMP_MAX_24H";break;case "weatherMinHum":a="HUM_MIN_24H";break;case "weatherMaxHum":a="HUM_MAX_24H";break;case "weatherTemp":a="TEMPERATURE";break;case "weatherHum":a="HUMIDITY";break;case "weatherHumF":a="HUMIDITYF";break;case "weatherDew":a="DEW_POINT";break;case "weatherRaining":a=
  "RAINING";break;case "weatherRainCounter":a="RAIN_CTR";break;case "weatherWindS":a="WIND_SPEED";break;case "weatherHumAbs":a="ABS_HUMIDITY";break;case "weatherBright":a="BRIGHTNESS";break;case "weatherBatVolt":a="BAT_VOLTAGE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "weatherMinTemp":case "weatherMaxTemp":case "weatherMinHum":case "weatherMaxHum":return parseFloat(a).toFixed(2);case "weatherTemp":case "weatherBatVolt":return xnm.aio.hm.Util.formatFloatString(a);
  case "weatherHum":case "weatherBright":return parseInt(a);case "weatherHumF":return xnm.aio.hm.Util.formatFloatString(a);case "weatherDew":return xnm.aio.hm.Util.formatFloatString(a);case "weatherRaining":return a;case "weatherRainCounter":return xnm.aio.hm.Util.formatFloatString(a);case "weatherWindS":return xnm.aio.hm.Util.formatFloatString(a);case "weatherHumAbs":return xnm.aio.hm.Util.formatFloatString(a);default:return"?"}}},MOTION_DETECTOR:{buildStateScript:function(a,c,d,b){if(!c.channels||
  !b.value)return null;switch(b.value){case "motionState":a="MOTION";break;case "motionBright":a="BRIGHTNESS";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "motionState":return"true"==a?"on":"off";case "motionBright":return parseFloat(a);default:return"?"}}},CAPACITIVE_FILLING_LEVEL_SENSOR:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "fillingLevel":break;
  default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"FILLING_LEVEL")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "fillingLevel":return xnm.aio.hm.Util.formatFloatString(a);default:return"?"}}},SENSOR:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "sensorSumReset":a="SUM_RESET";b="if(o!=null){o.State(1);}\n";break;case "sensModeAuto":a="MODE";b="if(o!=null){o.State(0);}\n";break;case "sensModeHeat":a="MODE";
  b="if(o!=null){o.State(1);}\n";break;case "sensModeCool":a="MODE";b="if(o!=null){o.State(3);}\n";break;case "sensModeFanOnly":a="MODE";b="if(o!=null){o.State(9);}\n";break;case "sensModeDry":a="MODE";b="if(o!=null){o.State(14);}\n";break;case "sensSwingV":a="VANE";b="if(o!=null){o.State(11);}\n";break;case "sensSwingH":a="VANE";b="if(o!=null){o.State(12);}\n";break;case "sensSwingVH":a="VANE";b="if(o!=null){o.State(13);}\n";break;case "sensSwingS":a="VANE";b="if(o!=null){o.State(14);}\n";break;case "sensSpeedAuto":a=
  "SPEED";b="if(o!=null){o.State(0);}\n";break;case "sensSpeedLow":a="SPEED";b="if(o!=null){o.State(1);}\n";break;case "sensSpeedMid1":a="SPEED";b="if(o!=null){o.State(2);}\n";break;case "sensSpeedMid2":a="SPEED";b="if(o!=null){o.State(3);}\n";break;case "sensSpeedMid3":a="SPEED";b="if(o!=null){o.State(4);}\n";break;case "sensSpeedHigh":a="SPEED";b="if(o!=null){o.State(5);}\n";break;case "sensRoomOccu":a="ROOM";b="if(o!=null){o.State(0);}\n";break;case "sensRoomStandby":a="ROOM";b="if(o!=null){o.State(1);}\n";
  break;case "sensRoomUnoccu":a="ROOM";b="if(o!=null){o.State(2);}\n";break;case "sensRoomOff":a="ROOM";b="if(o!=null){o.State(3);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "sensorState":a="STATE";break;case "sensorSum":a="SUM";break;case "sensorMean5min":a="MEAN5MINUTES";break;case "sensorMax5min":a="MAX5MINUTES";break;case "sensorSum1h":a="SUM_1H";break;case "sensorMax1h":a=
  "MAX_1H";break;case "sensorSum24h":a="SUM_24H";break;case "sensorMax24h":a="MAX_24H";break;case "sensorMeter":a="METER";break;case "sensorDistance":a="DISTANCE";break;case "sensorFPercent":a="F_PERCENT";break;case "sensorFLevel":a="F_LEVEL";break;case "sensorFVolume":a="F_VOLUME";break;case "sensorRelais1":a="RELAIS1";break;case "sensorRelais2":a="RELAIS2";break;case "hmsContactState":a="STATE";break;case "fhtContactState":a="STATE";break;case "securityState":a="STATE";break;case "sensorInfo":a="INFO";
  break;case "sensorSumDate":a="SUM_DATE";break;case "sensMode":a="MODE";break;case "sensSwing":a="VANE";break;case "sensSpeed":a="SPEED";break;case "sensRoom":a="ROOM";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "sensorSum":case "sensorMean5min":case "sensorMax5min":case "sensorSum1h":case "sensorMax1h":case "sensorSum24h":case "sensorMax24h":case "sensorMeter":case "sensorDistance":case "sensorFLevel":case "sensorFVolume":return xnm.aio.hm.Util.formatFloatString(a);
  case "sensorFPercent":return parseInt(a);case "sensorState":case "sensorRelais1":case "sensorRelais2":case "sensorInfo":case "sensorSumDate":return a;case "hmsContactState":case "fhtContactState":return"true"==a?"open":"close";case "securityState":return"true"==a?"danger":"ok";case "sensMode":switch(a){case "0":return"auto";case "1":return"heat";case "3":return"cool";case "9":return"fan_only";case "14":return"dry";default:return"?"}case "sensSwing":switch(a){case "11":return"vertical";case "12":return"horizontal";
  case "13":return"both";case "14":return"stop";default:return"?"}case "sensSpeed":switch(a=parseInt(a),a){case 0:return"auto";case 1:return"low";case 2:return"mid1";case 3:return"mid2";case 4:return"mid3";default:return 5<=a&&14>=a?"high":"?"}case "sensRoom":switch(a){case "0":return"occupied";case "1":return"standby";case "2":return"unoccupied";case "3":return"off";default:return"?"}default:return"?"}}},POWERMETER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "powerMeterPower":a=
  "POWER";break;case "powerMeterECount":a="ENERGY_COUNTER";break;case "powerMeterSum1h":a="SUM_1H";break;case "powerMeterSum24h":a="SUM_24H";break;case "powerMeterVoltage":a="VOLTAGE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "powerMeterPower":case "powerMeterECount":case "powerMeterSum1h":case "powerMeterSum24h":case "powerMeterVoltage":return xnm.aio.hm.Util.formatFloatString(a);default:return"?"}}},
  DANGER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "dangerState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "dangerState":return"true"==a?"danger":"ok";default:return"?"}}},EVENT_INTERFACE:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "evntIntfPress":break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,
  d,"STATE","if(o!=null){o.State(1);}\n")}},RELAIS:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "relaisOn":a="STATE";b="if(o!=null){o.State(1);}\n";break;case "relaisOff":a="STATE";b="if(o!=null){o.State(0);}\n";break;case "relaisToggle":a="STATE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;
  switch(b.value){case "relaisState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "relaisState":return"true"==a?"on":"off";default:return"?"}}},WRAPPER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "wrapperValue":a:{a=c.channels.WRAPPER.datapoints;for(b=0;b<a.length;b++){var e=a[b];if("MEDIAN"!=e&&"MEAN"!=e&&"SET_STATE"!=e&&"RESET"!=e&&"INSTALL_TEST"!=
  e){a=e;break a}}a=null}if(!a)return null;break;case "wrapperMedian":a="MEDIAN";break;case "wrapperMean":a="MEAN";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "wrapperValue":case "wrapperMedian":case "wrapperMean":return xnm.aio.hm.Util.formatFloatString(a);default:return"?"}}},SYSTEM:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "systemPress":break;
  default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,"STATE","if(o!=null){o.State(1);}\n")}},POWER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "powBatVolt":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"BAT_VOLTAGE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "powBatVolt":return xnm.aio.hm.Util.formatFloatString(a);default:return"?"}}},ENOCEAN_WEATHER2:{buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "eoWeather2BrightW":a="BRIGHTNESS_WEST";break;case "eoWeather2BrightS":a="BRIGHTNESS_SOUTH";break;case "eoWeather2BrightE":a="BRIGHTNESS_EAST";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "eoWeather2BrightW":case "eoWeather2BrightS":case "eoWeather2BrightE":return parseInt(a);default:return"?"}}},ENOCEAN_SENSOR_ERROR:{buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "eoSensorErr":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"ERROR")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "eoSensorErr":return a;default:return"?"}}},ENOCEAN_Bidi_Switch2:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "bidiSwitch2State":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,
  c){if("?"==a)return a;switch(c.value){case "bidiSwitch2State":return"true"==a?"on":"off";default:return"?"}}}};
  xnm.aio.hm.HmIPChannel={MAINTENANCE:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "errorBat":a="LOW_BAT";break;case "errorComm":a="UNREACH";break;case "errorSabo":a="SABOTAGE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "errorBat":case "errorComm":case "errorSabo":return a;default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LOW_BAT":var b=
  "errorBat";break;case "UNREACH":b="errorComm";break;case "SABOTAGE":b="errorSabo"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},MAINTENANCE_SD:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "errorSdBat":a="LOW_BAT";break;case "errorSdComm":a="UNREACH";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "errorSdBat":case "errorSdComm":return a;
  default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LOW_BAT":var b="errorSdBat";break;case "UNREACH":b="errorSdComm"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},MAINTENANCE_BAT_EL:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "errorBatElDutyCycle":a="DUTY_CYCLE";break;case "errorBatElCode":a="ERROR_CODE";break;case "errorBatElBat":a="LOW_BAT";break;case "errorBatElVoltage":a="OPERATING_VOLTAGE";
  break;case "errorBatElSensor":a="SENSOR_ERROR";break;case "errorBatElComm":a="UNREACH";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "errorBatElDutyCycle":case "errorBatElBat":case "errorBatElSensor":case "errorBatElComm":return a;case "errorBatElCode":return parseInt(a);case "errorBatElVoltage":return parseFloat(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "DUTY_CYCLE":var b=
  "errorBatElDutyCycle";break;case "ERROR_CODE":b="errorBatElCode";break;case "LOW_BAT":b="errorBatElBat";break;case "OPERATING_VOLTAGE":b="errorBatElVoltage";break;case "SENSOR_ERROR":b="errorBatElSensor";break;case "UNREACH":b="errorBatElComm"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},KEY_TRANSCEIVER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "pressShort":a="PRESS_SHORT";b="if(o!=null){o.State(1);}\n";
  break;case "pressLong":a="PRESS_LONG";b="if(o!=null){o.State(1);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "pressShort":case "pressLong":return!0;default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "PRESS_SHORT":var b="pressShort";break;case "PRESS_LONG":b="pressLong"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SWITCH_TRANSMITTER:{buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "switchTState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "switchTState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="switchTState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SWITCH_VIRTUAL_RECEIVER:{buildCommandScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "on":b="STATE";a="if(o!=null){o.State(1);}\n";break;case "off":b="STATE";a="if(o!=null){o.State(0);}\n";break;case "toggle":b="STATE";a="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;case "onFor":if("undefined"==typeof b.ext||null==b.ext)return null;a='var o;o=dom.GetObject("'+(c["interface"]+"."+c.address+":"+d.address+'.ON_TIME");\n');a+="if(o!=null){o.State("+parseFloat(b.ext)+");}\n";a+='o=dom.GetObject("'+c["interface"]+
  "."+c.address+":"+d.address+'.STATE");\n';return a+'if(o!=null){o.State(1.0);}\no="";\n';default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,b,a)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "switchState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "switchState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,
  c,d){switch(c.datapoint){case "STATE":var b="switchState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SHUTTER_CONTACT:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "shutterState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "shutterState":return 1==a?"open":"closed";default:return"?"}},resolveState:function(a,
  c,d){switch(c.datapoint){case "STATE":var b="shutterState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SHUTTER_CONTACT_TRANSCEIVER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "shutterTState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "shutterTState":return 1==a?"open":"closed";default:return"?"}},
  resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="shutterTState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},HEATING_CLIMATECONTROL_TRANSCEIVER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=null;switch(b.value){case "themoProf":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=b.ext;else if(b.ext.match(/^\d+$/))b=parseInt(b.ext);else return null;a="ACTIVE_PROFILE";b="if(o!=null){o.State("+
  b+");}\n";break;case "themoBoostOn":a="BOOST_MODE";b="if(o!=null){o.State(1);}\n";break;case "themoBoostOff":a="BOOST_MODE";b="if(o!=null){o.State(0);}\n";break;case "themoAutoMode":a="CONTROL_MODE";b="if(o!=null){o.State(0);}\n";break;case "themoManuMode":a="CONTROL_MODE";b="if(o!=null){o.State(1);}\n";break;case "themoTempUp":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"themoTemp"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.State()+0.5;if(v>30.5){v=30.5;}o.State(v);}\n":
  "if(o!=null){var v="+e+"+0.5;if(v>30.5){v=30.5;}o.State(v);}\n";a="SET_POINT_TEMPERATURE";break;case "themoTempDown":a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"themoTemp"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.State()-0.5;if(v<4.5){v=4.5;}o.State(v);}\n":"if(o!=null){var v="+e+"-0.5;if(v<4.5){v=4.5;}o.State(v);}\n";a="SET_POINT_TEMPERATURE";break;case "themoTemp":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=b.ext;else if(b.ext.match(/^[-+]?[0-9]*\.?[0-9]+$/))b=
  parseFloat(b.ext);else return null;a="SET_POINT_TEMPERATURE";b=4.5>b?4.5:b;b="if(o!=null){o.State("+(30.5<b?30.5:b)+");}\n";break;case "themoTempOn":a="SET_POINT_TEMPERATURE";b="if(o!=null){o.State(30.5);}\n";break;case "themoTempOff":a="SET_POINT_TEMPERATURE";b="if(o!=null){o.State(4.5);}\n";break;case "themoValveLevel":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=b.ext;else if(b.ext.match(/^\d+$/))b=parseInt(b.ext);else return null;0>b&&(b=0);100<b&&(b=100);
  a="LEVEL";b="if(o!=null){o.State("+b/100+");}\n";break;case "themoWinOpen":a="WINDOW_STATE";b="if(o!=null){o.State(1);}\n";break;case "themoWinClose":a="WINDOW_STATE";b="if(o!=null){o.State(0);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;if(c.channels&&c.channels.HEATING_CLIMATECONTROL_TRANSCEIVER)var h=c.channels.HEATING_CLIMATECONTROL_TRANSCEIVER.address;if(f&&h)if("themoTempUp"==d.value||"themoTempDown"==
  d.value){if(c="SET_POINT_TEMPERATURE",b){d=b.indexOf("<v>");var g=b.indexOf("</v>");-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))&&(b=parseFloat(b).toFixed(1),a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()})}}else"themoTemp"==d.value?(c="SET_POINT_TEMPERATURE",b=parseFloat(d.ext),a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()}):"themoTempOff"==d.value?a._statebuffer[f+":"+h+".SET_POINT_TEMPERATURE"]={value:4.5,timestamp:(new Date).getTime()}:"themoTempOn"==
  d.value&&(a._statebuffer[f+":"+h+".SET_POINT_TEMPERATURE"]={value:30.5,timestamp:(new Date).getTime()});e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "themoTemp":var e="SET_POINT_TEMPERATURE"}return c&&d&&e&&a?(b=a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=typeof b.value?5E3<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "themoProf":a=
  "ACTIVE_PROFILE";break;case "themoActualTemp":a="ACTUAL_TEMPERATURE";break;case "themoBoostMode":a="BOOST_MODE";break;case "themoFrost":a="FROST_PROTECTION";break;case "themoHum":a="HUMIDITY";break;case "themoMode":a="SET_POINT_MODE";break;case "themoTemp":a="SET_POINT_TEMPERATURE";break;case "themoValveLevel":a="LEVEL";break;case "themoWinState":a="WINDOW_STATE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "themoProf":case "themoHum":return parseInt(a);
  case "themoActualTemp":case "themoTemp":return parseFloat(a).toFixed(1);case "themoBoostMode":case "themoFrost":return"true"==a?"on":"off";case "themoMode":switch(a){case "0":return"auto";case "1":return"manu";default:return"?"}case "themoValveLevel":return Math.round(100*parseFloat(a));case "themoWinState":switch(a){case "1":case "2":return"open";case "0":return"closed";default:return"?"}default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "ACTIVE_PROFILE":var b="themoProf";
  break;case "ACTUAL_TEMPERATURE":b="themoActualTemp";break;case "BOOST_MODE":b="themoBoostMode";break;case "FROST_PROTECTION":b="themoFrost";break;case "HUMIDITY":b="themoHum";break;case "SET_POINT_MODE":b="themoMode";break;case "SET_POINT_TEMPERATURE":b="themoTemp";break;case "LEVEL":b="themoValveLevel";break;case "WINDOW_STATE":b="themoWinState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},MOTIONDETECTOR_TRANSCEIVER:{buildCommandScript:function(a,c,d,b){if(!c.channels||
  !b.value)return null;switch(b.value){case "motionOn":a="MOTION_DETECTION_ACTIVE";b="if(o!=null){o.State(1);}\n";break;case "motionOff":a="MOTION_DETECTION_ACTIVE";b="if(o!=null){o.State(0);}\n";break;case "motionToggle":a="MOTION_DETECTION_ACTIVE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;case "motionReset":a="RESET_MOTION";b="if(o!=null){o.State(1);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||
  !b.value)return null;switch(b.value){case "motionIllu":a="ILLUMINATION";break;case "motionState":a="MOTION";break;case "motionActivate":a="MOTION_DETECTION_ACTIVE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "motionIllu":return parseFloat(a).toFixed(2);case "motionState":return"true"==a?"on":"off";case "motionActivate":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,
  d){switch(c.datapoint){case "ILLUMINATION":var b="motionIllu";break;case "MOTION":b="motionState";break;case "MOTION_DETECTION_ACTIVE":b="motionActivate"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},ENERGIE_METER_TRANSMITTER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "meterEnergyCounter":a="ENERGY_COUNTER";break;case "meterPower":a="POWER";break;case "meterCurrent":a="CURRENT";break;case "meterVoltage":a="VOLTAGE";
  break;case "meterFrequency":a="FREQUENCY";break;default:return null}return'o=dom.GetObject("'+xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,a)+'");if(o!=null){states=states#o.Value();}else{states=states#"?";}'},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "meterEnergyCounter":return xnm.aio.hm.Util.formatFloatString(a);case "meterPower":return xnm.aio.hm.Util.formatFloatString(a);case "meterCurrent":return xnm.aio.hm.Util.formatFloatString(a);case "meterVoltage":return xnm.aio.hm.Util.formatFloatString(a);
  case "meterFrequency":return xnm.aio.hm.Util.formatFloatString(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "ENERGY_COUNTER":var b="meterEnergyCounter";break;case "POWER":b="meterPower";break;case "CURRENT":b="meterCurrent";break;case "VOLTAGE":b="meterVoltage";break;case "FREQUENCY":b="meterFrequency"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SMOKE_DETECTOR:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;
  switch(b.value){case "intrusionAlarmOff":a="SMOKE_DETECTOR_COMMAND";b="if(o!=null){o.State(1);}\n";break;case "intrusionAlarmOn":a="SMOKE_DETECTOR_COMMAND";b="if(o!=null){o.State(2);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "smokeState":case "smokeAlarmDetail":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"SMOKE_DETECTOR_ALARM_STATUS")},
  handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "smokeState":return 0==a?"off":"on";case "smokeAlarmDetail":if(0==a)return"off";if(1==a)return"primary_alarm";if(2==a)return"intrusion_alarm";if(3==a)return"secondary_alarm";break;default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "SMOKE_DETECTOR_ALARM_STATUS":a=[];var b="smokeState";c=this.handleStatusResponse(d+"",{value:b});a.push({key:b,value:c});b="smokeAlarmDetail";c=this.handleStatusResponse(d+
  "",{value:b});a.push({key:b,value:c});return a}if(!b)return null;c=this.handleStatusResponse(d+"",{value:b});return{key:b,value:c}}},DIMMER_TRANSMITTER:{buildStateScript:function(a,c,d,b){if(!b.value)return null;switch(b.value){case "dimmerTLevel":a="LEVEL";break;case "dimmerTColor":a="COLOR";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "dimmerTLevel":return a=parseFloat(a),Math.round(100*a);
  case "dimmerTColor":return a=parseFloat(a),"off blue green torqoise red purple yellow white".split(" ")[a];default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b="dimmerTLevel";break;case "COLOR":b="dimmerTColor"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},DIMMER_VIRTUAL_RECEIVER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=null,f=null;e=f=null;switch(b.value){case "dimOn":e="LEVEL";f="if(o!=null){o.State(1.005);}\n";
  break;case "dimOff":e="LEVEL";f="if(o!=null){o.State(0.0);}\n";break;case "dimUp":f=null==b.ext||"undefined"==typeof b.ext?.1:"number"==typeof b.ext?(parseInt(b.ext)/100).toFixed(2):b.ext.match(/^[-+]?[0-9]+$/)?(parseInt(b.ext)/100).toFixed(2):.1;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"dimmerLevel"}));f=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()+"+f+";if(v>1){v=1.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"+"+f+";if(v>1){v=1.0;}o.State(v);}\n";e="LEVEL";
  break;case "dimDown":f=null==b.ext||"undefined"==typeof b.ext?.1:"number"==typeof b.ext?(parseInt(b.ext)/100).toFixed(2):b.ext.match(/^[-+]?[0-9]+$/)?(parseInt(b.ext)/100).toFixed(2):.1;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"dimmerLevel"}));f=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()-"+f+";if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-"+f+";if(v<0){v=0.0;}o.State(v);}\n";e="LEVEL";break;case "dimTo":if(null==b.ext||"undefined"==typeof b.ext)return null;
  if("number"==typeof b.ext)f=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))f=b.ext;else return null;e="LEVEL";f/=100;f=0>f?0:f;f="if(o!=null){o.State("+(1<f?1:f)+");}\n";break;case "toggleTo":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)f=parseInt(b.ext);else if("string"==typeof b.ext)f=b.ext.replace("%",""),f=parseInt(f);else return null;e="LEVEL";f/=100;f=0>f?0:f;f="if(o!=null){var v=0.0;real des = 0.0+o.Value(); if(des == 0.0){v="+(1<f?1:f).toFixed(2)+";o.State(v);}else{o.State(v);}}\n";
  break;case "color":if(null==b.ext||"undefined"==typeof b.ext)return null;switch(b.ext){case "off":f=0;break;case "blue":f=1;break;case "green":f=2;break;case "torqoise":f=3;break;case "red":f=4;break;case "purple":f=5;break;case "yellow":f=6;break;case "white":f=7}e="COLOR";f="if(o!=null){o.State("+f+");}\n";break;case "colorPlay":case "colorPlayList":var h=[],g=[];if(!b.ext)return null;for(a=0;a<b.ext.length;a++)if(f=b.ext[a])switch(f.value){case "colorList":var l=f.ext;break;case "colorOnTime":var k=
  f.ext;break;case "colorLevel":var n=parseInt(f.ext);break;case "colorDur":var q=parseInt(f.ext);break;case "colorDurUnit":var p=f.ext;break;case "colorRepeat":var t=parseInt(f.ext)}if("undefined"==typeof l||null==l||"undefined"==typeof n||null==n||"undefined"==typeof q||null==q||"undefined"==typeof p||null==p||"undefined"==typeof t||null==t||"undefined"==typeof k||null==k)return null;"colorPlay"==b.value?(g.push("100MS 200MS 300MS 400MS 500MS 700MS 1S 2S 3S 5S 7S 10S 20S 40S 50S ALWAYS".split(" ").indexOf(k)),
  h.push("off blue green torqoise red purple yellow white".split(" ").indexOf(l))):(b=l.split(","),b.forEach(function(a){h.push("off blue green torqoise red purple yellow white".split(" ").indexOf(a))}),b=k.split(","),b.forEach(function(a){g.push("100MS 200MS 300MS 400MS 500MS 700MS 1S 2S 3S 5S 7S 10S 20S 40S 50S ALWAYS".split(" ").indexOf(a))}));p=["S","M","H","10MS"].indexOf(p);n/=100;if(0==h.length)return null;f="";k=null;k=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"DURATION_UNIT");f+='(datapoints.Get("'+
  k+'")).State('+p+");\n";k=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"LEVEL");f+='(datapoints.Get("'+k+'")).State('+n+");\n";k=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"RAMP_TIME_UNIT");f+='(datapoints.Get("'+k+'")).State(0);\n';k=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"RAMP_TIME_VALUE");f+='(datapoints.Get("'+k+'")).State(0);\n';k=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"OUTPUT_SELECT_SIZE");f+='(datapoints.Get("'+k+'")).State('+h.length+");\n";k=xnm.aio.hm.MHMCCU._getDataPointAddress(c,
  d,"REPETITIONS");f+='(datapoints.Get("'+k+'")).State('+t+");\n";for(a=1;a<=h.length;a++)k=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"COLOR_LIST_"+a),f+='(datapoints.Get("'+k+'")).State('+h[a-1]+");\n",k=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"ON_TIME_LIST_"+a),f+='(datapoints.Get("'+k+'")).State('+g[a-1]+");\n";k=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"DURATION_VALUE");return f+('(datapoints.Get("'+k+'")).State('+q+");\n");default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,
  d,e,f)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;if(c.channels&&c.channels.DIMMER)var h=c.channels.DIMMER.address;if(f&&h)if("dimTo"==d.value||"dimOff"==d.value){c="LEVEL";switch(d.value){case "dimTo":var g=parseFloat(d.ext);break;case "dimOff":g=0}a._statebuffer[f+":"+h+"."+c]={value:g,timestamp:(new Date).getTime()};e&&e()}else"dimUp"==d.value||"dimDown"==d.value?(c="LEVEL",b&&(d=b.indexOf("<v>"),g=b.indexOf("</v>"),-1!=d&&-1!=g&&d+3<g&&(g=b.substr(d+3,g-d-3)))&&(g=Math.round(100*
  parseFloat(g)),a._statebuffer[f+":"+h+"."+c]={value:g,timestamp:(new Date).getTime()}),e&&e()):"toggleTo"==d.value?(delete a._statebuffer[f+":"+h+".LEVEL"],setTimeout(function(){e&&e()},3E3)):e&&e();else e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "dimmerLevel":var e="LEVEL"}return c&&d&&e&&a?(b=a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=typeof b.value?3E3<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "dimmerLevel":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"LEVEL")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "dimmerLevel":return a=parseFloat(a),Math.round(100*a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b="dimmerLevel"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},ALARM_SWITCH_VIRTUAL_RECEIVER:{buildCommandScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "alarmTrigger":if(!b.ext)return null;for(a=0;a<b.ext.length;a++){var e=b.ext[a];if(e)switch(e.value){case "alarmAudio":var f=e.ext;break;case "alarmVisual":var h=e.ext;break;case "alarmDur":var g=e.ext;break;case "alarmDurUnit":var l=e.ext}}if("undefined"==typeof f||null==f||"undefined"==typeof h||null==h||"undefined"==typeof g||null==g||"undefined"==typeof l||null==l)return null;f="DISABLE_ACOUSTIC_SIGNAL FREQUENCY_RISING FREQUENCY_FALLING FREQUENCY_RISING_AND_FALLING FREQUENCY_ALTERNATING_LOW_HIGH FREQUENCY_ALTERNATING_LOW_MID_HIGH FREQUENCY_HIGHON_OFF FREQUENCY_HIGHON_LONGOFF FREQUENCY_LOWON_OFF_HIGHON_OFF FREQUENCY_LOWON_LONGOFF_HIGHON_LONGOFF LOW_BATTERY DISARMED INTERNALLY_ARMED EXTERNALLY_ARMED DELAYED_INTERNALLY_ARMED DELAYED_EXTERNALLY_ARMED EVENT ERROR".split(" ").indexOf(f);
  -1==f&&(f=0);h="DISABLE_OPTICAL_SIGNAL BLINKING_ALTERNATELY_REPEATING BLINKING_BOTH_REPEATING DOUBLE_FLASHING_REPEATING FLASHING_BOTH_REPEATING CONFIRMATION_SIGNAL_0 CONFIRMATION_SIGNAL_1 CONFIRMATION_SIGNAL_2".split(" ").indexOf(h);-1==h&&(h=0);l=["S","M","H","D"].indexOf(l);-1==l&&(l=0);b="var o;";a=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"ACOUSTIC_ALARM_SELECTION");b=b+('o=dom.GetObject("'+a+'");o.State(')+(f+")");a=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"OPTICAL_ALARM_SELECTION");b=b+('o=dom.GetObject("'+
  a+'");o.State(')+(h+")");a=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"DURATION_VALUE");b=b+('o=dom.GetObject("'+a+'");o.State(')+(g+")");a=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"DURATION_UNIT");return b=b+('o=dom.GetObject("'+a+'");o.State(')+(l+')o="";\n');default:return null}},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "alarmState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,
  c){if("?"==a)return a;switch(c.value){case "alarmState":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="alarmState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},ROTARY_HANDLE_TRANSCEIVER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "handleState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,
  c){if("?"==a)return a;switch(c.value){case "handleState":switch(a){case "0":return"closed";case "1":return"tilted";case "2":return"open";default:return"?"}default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="handleState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SHUTTER_TRANSMITTER:{buildStateScript:function(a,c,d,b){if(!b.value)return null;switch(b.value){case "blindTLevel":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,
  d,"LEVEL")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "blindTLevel":return a=parseFloat(a),Math.round(100*a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b="blindTLevel"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SHUTTER_VIRTUAL_RECEIVER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=null;switch(b.value){case "stop":a="STOP";b="if(o!=null){o.State(1);}\n";
  break;case "moveUp":a="LEVEL";b="if(o!=null){o.State(1.0);}\n";break;case "moveDown":a="LEVEL";b="if(o!=null){o.State(0.0);}\n";break;case "stepUp":b=null==b.ext||"undefined"==typeof b.ext?.05:"number"==typeof b.ext?(parseInt(b.ext)/100).toFixed(2):b.ext.match(/^[-+]?[0-9]+$/)?(parseInt(b.ext)/100).toFixed(2):.05;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"blindLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()+"+b+";if(v>1){v=1.0;}o.State(v);}\n":"if(o!=null){var v="+
  e/100+"+"+b+";if(v>1){v=1.0;}o.State(v);}\n";a="LEVEL";break;case "stepDown":b=null==b.ext||"undefined"==typeof b.ext?.05:"number"==typeof b.ext?(parseInt(b.ext)/100).toFixed(2):b.ext.match(/^[-+]?[0-9]+$/)?(parseInt(b.ext)/100).toFixed(2):.05;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"blindLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()-"+b+";if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-"+b+";if(v<0){v=0.0;}o.State(v);}\n";a="LEVEL";
  break;case "moveTo":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))b=b.ext;else return null;a="LEVEL";b/=100;b=0>b?0:b;b="if(o!=null){o.State("+(1<b?1:b)+");}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;if(c.channels&&c.channels.SHUTTER_TRANSMITTER)var h=c.channels.SHUTTER_TRANSMITTER.address;if(f&&h)if("moveTo"==
  d.value)c="LEVEL",b=parseFloat(d.ext),a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()};else if("stepUp"==d.value||"stepDown"==d.value)if(c="LEVEL",b){d=b.indexOf("<v>");var g=b.indexOf("</v>");-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))&&(b=Math.round(100*parseFloat(b)),a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()})}e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "blindLevel":var e="LEVEL"}return c&&d&&e&&a?(b=
  a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=typeof b.value?3E3<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "blindLevel":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"LEVEL")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "blindLevel":return a=parseFloat(a),Math.round(100*a);default:return"?"}},resolveState:function(a,
  c,d){switch(c.datapoint){case "LEVEL":var b="blindLevel"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},BLIND_TRANSMITTER:{buildStateScript:function(a,c,d,b){if(!b.value)return null;switch(b.value){case "blindTPos":a="LEVEL";break;case "lamellaTPos":a="LEVEL_2";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "blindTPos":return a=parseFloat(a),Math.round(100*
  a);case "lamellaTPos":return a=parseFloat(a),Math.round(100*a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b="blindTPos";break;case "LEVEL_2":b="lamellaTPos"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},BLIND_VIRTUAL_RECEIVER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=null;switch(b.value){case "stop":a="STOP";e="if(o!=null){o.State(1);}\n";break;case "moveUp":return e='var o;o=dom.GetObject("'+
  (c["interface"]+"."+c.address+":"+d.address+'.LEVEL_2");\n'),e=e+'if(o!=null){o.State(1.0);}\no=dom.GetObject("'+(c["interface"]+"."+c.address+":"+d.address+'.LEVEL");\n'),e+'if(o!=null){o.State(1.0);}\no="";\n';case "moveDown":return e='var o;o=dom.GetObject("'+(c["interface"]+"."+c.address+":"+d.address+'.LEVEL_2");\n'),e=e+'if(o!=null){o.State(0.0);}\no=dom.GetObject("'+(c["interface"]+"."+c.address+":"+d.address+'.LEVEL");\n'),e+'if(o!=null){o.State(0.0);}\no="";\n';case "lamellaUp":return e=
  'var o;o=dom.GetObject("'+(c["interface"]+"."+c.address+":"+d.address+'.LEVEL_2");\n'),e=e+'if(o!=null){o.State(1.0);}\no=dom.GetObject("'+(c["interface"]+"."+c.address+":"+d.address+'.LEVEL");\n'),e+'if(o!=null){o.State(o.Value());}\no="";\n';case "lamellaDown":return e='var o;o=dom.GetObject("'+(c["interface"]+"."+c.address+":"+d.address+'.LEVEL_2");\n'),e=e+'if(o!=null){o.State(0.0);}\no=dom.GetObject("'+(c["interface"]+"."+c.address+":"+d.address+'.LEVEL");\n'),e+'if(o!=null){o.State(o.Value());}\no="";\n';
  case "stepUp":b=null==b.ext||"undefined"==typeof b.ext?.05:"number"==typeof b.ext?(parseInt(b.ext)/100).toFixed(2):b.ext.match(/^[-+]?[0-9]+$/)?(parseInt(b.ext)/100).toFixed(2):.05;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"blindPos"}));e=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()+"+b+";if(v>1){v=1.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"+"+b+";if(v>1){v=1.0;}o.State(v);}\n";a="LEVEL";break;case "stepDown":b=null==b.ext||"undefined"==typeof b.ext?.05:
  "number"==typeof b.ext?(parseInt(b.ext)/100).toFixed(2):b.ext.match(/^[-+]?[0-9]+$/)?(parseInt(b.ext)/100).toFixed(2):.05;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"blindPos"}));e=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()-"+b+";if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-"+b+";if(v<0){v=0.0;}o.State(v);}\n";a="LEVEL";break;case "moveTo":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))b=
  b.ext;else return null;a="LEVEL";b/=100;b=0>b?0:b;e="if(o!=null){o.State("+(1<b?1:b)+");}\n";break;case "lamellaStepUp":return b=null==b.ext||"undefined"==typeof b.ext?.05:"number"==typeof b.ext?(parseInt(b.ext)/100).toFixed(2):b.ext.match(/^[-+]?[0-9]+$/)?(parseInt(b.ext)/100).toFixed(2):.05,e='var s=dom.GetObject("'+c["interface"]+"."+c.address+":"+(d.stateAddress?d.stateAddress:d.address)+'.LEVEL");\n',e+='var o=dom.GetObject("'+c["interface"]+"."+c.address+":"+d.address+'.LEVEL_2");\n',e=e+("if(o!=null){var v=o.Value()+"+
  b+';if(v>1){v=1.0;}o.State(v);}\no=dom.GetObject("')+(c["interface"]+"."+c.address+":"+d.address+'.LEVEL");\n'),e+'if(o!=null){o.State(s.Value());}\no="";s="";\n';case "lamellaStepDown":return b=null==b.ext||"undefined"==typeof b.ext?.05:"number"==typeof b.ext?(parseInt(b.ext)/100).toFixed(2):b.ext.match(/^[-+]?[0-9]+$/)?(parseInt(b.ext)/100).toFixed(2):.05,e='var s=dom.GetObject("'+c["interface"]+"."+c.address+":"+(d.stateAddress?d.stateAddress:d.address)+'.LEVEL");\n',e+='var o=dom.GetObject("'+
  c["interface"]+"."+c.address+":"+d.address+'.LEVEL_2");\n',e=e+("if(o!=null){var v=o.Value()-"+b+';if(v<0){v=0.0;}o.State(v);}\no=dom.GetObject("')+(c["interface"]+"."+c.address+":"+d.address+'.LEVEL");\n'),e+'if(o!=null){o.State(s.Value());}\no="";s="";\n';case "lamellaTo":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))b=b.ext;else return null;b/=100;b=0>b?0:b;e='var s=dom.GetObject("'+c["interface"]+"."+c.address+
  ":"+(d.stateAddress?d.stateAddress:d.address)+'.LEVEL");\n';e+='var o=dom.GetObject("'+c["interface"]+"."+c.address+":"+d.address+'.LEVEL_2");\n';e=e+("if(o!=null){o.State("+(1<b?1:b)+');}\no=dom.GetObject("')+(c["interface"]+"."+c.address+":"+d.address+'.LEVEL");\n');return e+'if(o!=null){o.State(s.Value());}\no="";s="";\n';default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,e)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;if(c.channels&&c.channels.BLIND_TRANSMITTER)var h=
  c.channels.BLIND_TRANSMITTER.address;if(f&&h)if("moveTo"==d.value)c="LEVEL",b=parseFloat(d.ext),a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()};else if("lamellaTo"==d.value)c="LEVEL_2",b=parseFloat(d.ext),a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()};else if("stepUp"==d.value||"stepDown"==d.value){if(c="LEVEL",b){d=b.indexOf("<v>");var g=b.indexOf("</v>");-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))&&(b=Math.round(100*parseFloat(b)),a._statebuffer[f+
  ":"+h+"."+c]={value:b,timestamp:(new Date).getTime()})}}else if("lamellaStepUp"==d.value||"lamellaStepDown"==d.value)if(c="LEVEL_2",b&&(d=b.indexOf("<v>"),g=b.indexOf("</v>"),-1!=d&&-1!=g&&d+3<g&&(b=b.substr(d+3,g-d-3))))b=Math.round(100*parseFloat(b)),a._statebuffer[f+":"+h+"."+c]={value:b,timestamp:(new Date).getTime()};e&&e()},getBufferedState:function(a,c,d,b){c=c.address;d=d.address;switch(b.value){case "blindPos":var e="LEVEL";break;case "lamellaPos":e="LEVEL_2"}return c&&d&&e&&a?(b=a[c+":"+
  d+"."+e],b&&null!=b.value&&"undefined"!=typeof b.value?3E3<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "blindPos":a="LEVEL";break;case "lamellaPos":a="LEVEL_2";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "blindPos":return a=parseFloat(a),Math.round(100*a);case "lamellaPos":return a=
  parseFloat(a),Math.round(100*a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b="blindPos";break;case "LEVEL_2":b="lamellaPos"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},PRESENCEDETECTOR_TRANSCEIVER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "presenceOn":a="PRESENCE_DETECTION_ACTIVE";b="if(o!=null){o.State(1);}\n";break;case "presenceOff":a="PRESENCE_DETECTION_ACTIVE";
  b="if(o!=null){o.State(0);}\n";break;case "presenceToggle":a="PRESENCE_DETECTION_ACTIVE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;case "presenceReset":a="RESET_PRESENCE";b="if(o!=null){o.State(1);}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "presenceIllu":a="ILLUMINATION";break;case "presenceState":a="PRESENCE_DETECTION_STATE";break;case "presenceActivate":a=
  "PRESENCE_DETECTION_ACTIVE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "presenceIllu":return parseFloat(a).toFixed(2);case "presenceState":return"true"==a?"on":"off";case "presenceActivate":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "ILLUMINATION":var b="presenceIllu";break;case "PRESENCE_DETECTION_STATE":b="presenceState";break;case "PRESENCE_DETECTION_ACTIVE":b=
  "presenceActivate"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},CLIMATECONTROL_FLOOR_PUMP_TRANSCEIVER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "cl_fp_humidityLimiter":a="HUMIDITY_LIMITER";break;case "cl_fp_emergencyOP":a="EMERGENCY_OPERATION";break;case "cl_fp_frostProtection":a="FROST_PROTECTION";break;case "cl_fp_state":a="STATE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,
  a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "cl_fp_humidityLimiter":case "cl_fp_emergencyOP":case "cl_fp_frostProtection":return a;case "cl_fp_state":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "HUMIDITY_LIMITER":var b="cl_fp_humidityLimiter";break;case "EMERGENCY_OPERATION":b="cl_fp_emergencyOP";break;case "FROST_PROTECTION":b="cl_fp_frostProtection";break;case "STATE":b="cl_fp_state"}if(!b)return null;a=
  this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},CLIMATECONTROL_FLOOR_TRANSCEIVER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "cl_f_humidityLimiter":a="HUMIDITY_LIMITER";break;case "cl_f_emergencyOP":a="EMERGENCY_OPERATION";break;case "cl_f_frostProtection":a="FROST_PROTECTION";break;case "cl_f_state":a="STATE";break;case "cl_valve_level":a="LEVEL_STATUS";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},
  handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "cl_f_humidityLimiter":case "cl_f_emergencyOP":case "cl_f_frostProtection":return a;case "cl_f_state":return"true"==a?"on":"off";case "cl_valve_level":return 100*parseFloat(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "HUMIDITY_LIMITER":var b="cl_f_humidityLimiter";break;case "EMERGENCY_OPERATION":b="cl_f_emergencyOP";break;case "FROST_PROTECTION":b="cl_f_frostProtection";break;case "STATE":b=
  "cl_f_state";break;case "LEVEL_STATUS":b="cl_valve_level"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},WEATHER_TRANSMIT:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "weatherActualTemp":a="ACTUAL_TEMPERATURE";break;case "weatherHum":a="HUMIDITY";break;case "weatherIllu":a="ILLUMINATION";break;case "weatherSunD":a="SUNSHINEDURATION";break;case "weatherSunDOF":a="SUNSHINEDURATION_OVERFLOW";break;case "weatherSunTOR":a=
  "SUNSHINE_THRESHOLD_OVERRUN";break;case "weatherWindS":a="WIND_SPEED";break;case "weatherWindTOR":a="WIND_THRESHOLD_OVERRUN";break;case "weatherRain":a="RAINING";break;case "weatherRainC":a="RAIN_COUNTER";break;case "weatherRainCOF":a="RAIN_COUNTER_OVERFLOW";break;case "weatherWindD":a="WIND_DIR";break;case "weatherWindDR":a="WIND_DIR_RANGE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "weatherActualTemp":case "weatherIllu":case "weatherWindS":case "weatherRainC":case "weatherWindD":case "weatherWindDR":return parseFloat(parseFloat(a).toFixed(1));
  case "weatherHum":case "weatherSunD":return parseInt(a);case "weatherSunDOF":case "weatherSunTOR":case "weatherWindTOR":case "weatherRain":case "weatherRainCOF":return a;default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "ACTUAL_TEMPERATURE":var b="weatherActualTemp";break;case "HUMIDITY":b="weatherHum";break;case "ILLUMINATION":b="weatherIllu";break;case "SUNSHINEDURATION":b="weatherSunD";break;case "SUNSHINEDURATION_OVERFLOW":b="weatherSunDOF";break;case "SUNSHINE_THRESHOLD_OVERRUN":b=
  "weatherSunTOR";break;case "WIND_SPEED":b="weatherWindS";break;case "WIND_THRESHOLD_OVERRUN":b="weatherWindTOR";break;case "RAINING":b="weatherRain";break;case "RAIN_COUNTER":b="weatherRainC";break;case "RAIN_COUNTER_OVERFLOW":b="weatherRainCOF";break;case "WIND_DIR":b="weatherWindD";break;case "WIND_DIR_RANGE":b="weatherWindDR"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},CLIMATE_TRANSCEIVER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;
  switch(b.value){case "climateActualTemp":a="ACTUAL_TEMPERATURE";break;case "climateHum":a="HUMIDITY";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "climateActualTemp":return parseFloat(parseFloat(a).toFixed(1));case "climateHum":return parseInt(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "ACTUAL_TEMPERATURE":var b="climateActualTemp";break;case "HUMIDITY":b="climateHum"}if(!b)return null;
  a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},PASSAGE_DETECTOR_DIRECTION_TRANSMITTER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "passageCurrentDirection":case "passageLastDirection":return d="CURRENT_PASSAGE_DIRECTION","passageLastDirection"==b.value&&(d="LAST_PASSAGE_DIRECTION"),b=xnm.aio.hm.MHMCCU._getDataPointAddress(c,{address:2},d),a='o=dom.GetObject("'+b+'");if(o!=null){states=states#o.Value();}else{states=states#"?";}',
  b=xnm.aio.hm.MHMCCU._getDataPointAddress(c,{address:3},d),a+'states=states#"-";o=dom.GetObject("'+(b+'");if(o!=null){states=states#o.Value();}else{states=states#"?";}');case "passageCurrent":b="CURRENT_PASSAGE_DIRECTION";break;case "passageLast":b="LAST_PASSAGE_DIRECTION";break;case "passageCOF":b="PASSAGE_COUNTER_OVERFLOW";break;case "passageC":b="PASSAGE_COUNTER_VALUE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,b)},handleStatusResponse:function(a,c){if("?"==a)return a;
  switch(c.value){case "passageCurrentDirection":case "passageLastDirection":return a=a.split("-"),2>a.length?"?":"true"==a[0]?"right_to_left":"left_to_right";case "passageCurrent":case "passageLast":case "passageCOF":return a;case "passageC":return parseInt(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "CURRENT_PASSAGE_DIRECTION":var b="passageCurrent";break;case "LAST_PASSAGE_DIRECTION":b="passageLast";break;case "PASSAGE_COUNTER_OVERFLOW":b="passageCOF";break;case "PASSAGE_COUNTER_VALUE":b=
  "passageC"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});switch(c.datapoint){case "CURRENT_PASSAGE_DIRECTION":b="passageCurrentDirection";a=c&&-1!=c.channel.indexOf(":2")?"right_to_left":"left_to_right";break;case "LAST_PASSAGE_DIRECTION":b="passageLastDirection";a=c&&-1!=c.channel.indexOf(":2")?"right_to_left":"left_to_right";break;case "PASSAGE_COUNTER_OVERFLOW":b="passageCOF";break;case "PASSAGE_COUNTER_VALUE":b="passageC"}return{key:b,value:a}}},GENERIC_INPUT_TRANSMITER:{buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "genInputChangeOver":a="CHANGE_OVER";break;case "genInputExtClock":a="EXTERNAL_CLOCK";break;case "genInputHumidityLimiter":a="HUMIDITY_LIMITER";break;case "genInputState":a="STATE";break;case "genInputTactileSwitch":a="TACTILE_SWITCH";break;case "genInputTempLimiter":a="TEMPERATURE_LIMITER";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "genInputChangeOver":case "genInputExtClock":case "genInputHumidityLimiter":case "genInputState":case "genInputTactileSwitch":case "genInputTempLimiter":return a;
  default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "CHANGE_OVER":var b="genInputChangeOver";break;case "EXTERNAL_CLOCK":b="genInputExtClock";break;case "HUMIDITY_LIMITER":b="genInputHumidityLimiter";break;case "STATE":b="genInputState";break;case "TACTILE_SWITCH":b="genInputTactileSwitch";break;case "TEMPERATURE_LIMITER":b="genInputTempLimiter"}return{key:b,value:value}}},ANALOG_OUTPUT_TRANSCEIVER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;var e=
  null;switch(b.value){case "analogOutputOff":a="LEVEL";b="if(o!=null){o.State(0.0);}\n";break;case "analogOutputUp":b=null==b.ext||"undefined"==typeof b.ext?.1:"number"==typeof b.ext?(parseInt(b.ext)/100).toFixed(2):b.ext.match(/^[-+]?[0-9]+$/)?(parseInt(b.ext)/100).toFixed(2):.1;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"analogOutputLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()+"+b+";if(v>1){v=1.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"+"+b+
  ";if(v>1){v=1.0;}o.State(v);}\n";a="LEVEL";break;case "analogOutputDown":b=null==b.ext||"undefined"==typeof b.ext?.1:"number"==typeof b.ext?(parseInt(b.ext)/100).toFixed(2):b.ext.match(/^[-+]?[0-9]+$/)?(parseInt(b.ext)/100).toFixed(2):.1;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,c,d,{value:"analogOutputLevel"}));b=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()-"+b+";if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-"+b+";if(v<0){v=0.0;}o.State(v);}\n";a="LEVEL";
  break;case "analogOutputTo":if(null==b.ext||"undefined"==typeof b.ext)return null;if("number"==typeof b.ext)b=parseInt(b.ext);else if(b.ext.match(/^[-+]?[0-9]+$/))b=b.ext;else return null;a="LEVEL";b/=100;b=0>b?0:b;b="if(o!=null){o.State("+(1<b?1:b)+");}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},handleCommandResponse:function(a,c,d,b,e){var f=c.address;if(c.channels&&c.channels.DIMMER)var h=c.channels.DIMMER.address;if(f&&h)if("analogOutputTo"==d.value||"analogOutputOff"==
  d.value){c="LEVEL";switch(d.value){case "analogOutputTo":var g=parseFloat(d.ext);break;case "analogOutputOff":g=0}a._statebuffer[f+":"+h+"."+c]={value:g,timestamp:(new Date).getTime()}}else if("analogOutputUp"==d.value||"analogOutputDown"==d.value)if(c="LEVEL",b&&(d=b.indexOf("<v>"),g=b.indexOf("</v>"),-1!=d&&-1!=g&&d+3<g&&(g=b.substr(d+3,g-d-3))))g=Math.round(100*parseFloat(g)),a._statebuffer[f+":"+h+"."+c]={value:g,timestamp:(new Date).getTime()};e&&e()},getBufferedState:function(a,c,d,b){c=c.address;
  d=d.address;switch(b.value){case "analogOutputLevel":var e="LEVEL"}return c&&d&&e&&a?(b=a[c+":"+d+"."+e],b&&null!=b.value&&"undefined"!=typeof b.value?3E3<=(new Date).getTime()-b.timestamp?(delete a[c+":"+d+"."+e],null):b.value:null):null},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "analogOutputLevel":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"LEVEL")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "analogOutputLevel":return a=
  parseFloat(a),Math.round(100*a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b="analogOutputLevel"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},MULTI_MODE_INPUT_TRANSMITTER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "state":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "state":return"true"==
  a?"on":"off";case "pressShort":case "pressLong":return!0;default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="state";break;case "PRESS_SHORT":b="pressShort";break;case "PRESS_LONG":b="pressLong"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},WATER_DETECTION_TRANSMITTER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "waterAlarmState":a="ALARMSTATE";break;case "waterMoistureDetected":a=
  "MOISTURE_DETECTED";break;case "waterWaterDetected":a="WATERLEVEL_DETECTED";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "waterAlarmState":return"true"==a?"on":"off";case "waterMoistureDetected":case "waterWaterDetected":return a;default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "ALARMSTATE":var b="waterAlarmState";break;case "MOISTURE_DETECTED":b="waterMoistureDetected";
  break;case "WATERLEVEL_DETECTED":b="waterWaterDetected"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},ACCELERATION_TRANSCEIVER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "acceMotion":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"MOTION")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "acceMotion":return a;default:return"?"}},resolveState:function(a,c,
  d){switch(c.datapoint){case "MOTION":var b="acceMotion"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},DOOR_RECEIVER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "open":a="DOOR_COMMAND";b="if(o!=null){o.State(1);}\n";break;case "stop":a="DOOR_COMMAND";b="if(o!=null){o.State(2);}\n";break;case "close":a="DOOR_COMMAND";b="if(o!=null){o.State(3);}\n";break;case "partialOpen":a="DOOR_COMMAND";b="if(o!=null){o.State(4);}\n";
  break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "doorState":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"DOOR_STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "doorState":return a=parseInt(a),0==a?"closed":1==a?"open":2==a?"ventilation":"unknonw";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "DOOR_STATE":var b=
  "doorState"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},SIMPLE_SWITCH_RECEIVER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "on":a="STATE";b="if(o!=null){o.State(1);}\n";break;case "off":a="STATE";b="if(o!=null){o.State(0);}\n";break;case "toggle":a="STATE";b="if(o!=null){if(o.Value()){o.State(0);}else{o.State(1);}}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(c,d,a,b)},buildStateScript:function(a,
  c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "state":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"STATE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "state":return"true"==a?"on":"off";default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "STATE":var b="state"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},BRIGHTNESS_TRANSMITTER:{buildStateScript:function(a,c,
  d,b){if(!c.channels||!b.value)return null;switch(b.value){case "briAvgIllu":a="AVERAGE_ILLUMINATION";break;case "briAvgIlluSta":a="AVERAGE_ILLUMINATION_STATUS";break;case "briIllu":a="CURRENT_ILLUMINATION";break;case "briIlluSta":a="CURRENT_ILLUMINATION_STATUS";break;case "briMaxIllu":a="HIGHEST_ILLUMINATION";break;case "briMaxIlluSta":a="HIGHEST_ILLUMINATION_STATUS";break;case "briMinIllu":a="LOWEST_ILLUMINATION";break;case "briMinIlluSta":a="LOWEST_ILLUMINATION_STATUS";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,
  d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;var d=["normal","unknown","overflow"];switch(c.value){case "briAvgIllu":case "briIllu":case "briMaxIllu":case "briMinIllu":return parseFloat(parseFloat(a).toFixed(2));case "briAvgIlluSta":case "briIlluSta":case "briMaxIlluSta":case "briMinIlluSta":return d[parseInt(a)];default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "AVERAGE_ILLUMINATION":var b="briAvgIllu";break;case "AVERAGE_ILLUMINATION_STATUS":b="briAvgIlluSta";
  break;case "CURRENT_ILLUMINATION":b="briIllu";break;case "CURRENT_ILLUMINATION_STATUS":b="briIlluSta";break;case "HIGHEST_ILLUMINATION":b="briMaxIllu";break;case "HIGHEST_ILLUMINATION_STATUS":b="briMaxIlluSta";break;case "LOWEST_ILLUMINATION":b="briMinIllu";break;case "LOWEST_ILLUMINATION_STATUS":b="briMinIlluSta"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},POWER_MAINS_TRANSMITTER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "powerMainsFailure":break;
  default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,"POWER_MAINS_FAILURE")},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "powerMainsFailure":return a;default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "POWER_MAINS_FAILURE":var b="powerMainsFailure"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},ACOUSTIC_SIGNAL_TRANSMITTER:{buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;
  switch(b.value){case "acousticTLevel":a="LEVEL";break;case "acousticTSoundfile":a="SOUNDFILE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "acousticTLevel":return a=parseFloat(a),Math.round(100*a);case "acousticTSoundfile":return parseInt(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b="acousticTLevel";break;case "SOUNDFILE":b="acousticTSoundfile"}if(!b)return null;
  a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}},ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER:{buildCommandScript:function(a,c,d,b){if(!c.channels||!b.value)return null;a=[];switch(b.value){case "acousticPlay":case "acousticPlayList":if(!b.ext)return null;for(var e=0;e<b.ext.length;e++){var f=b.ext[e];if(f)switch(f.value){case "acousticSound":var h=f.ext;break;case "acousticSoundList":h=f.ext;break;case "acousticLevel":var g=parseInt(f.ext);break;case "acousticDur":var l=parseInt(f.ext);break;
  case "acousticDurUnit":var k=f.ext;break;case "acousticRepeat":var n=parseInt(f.ext)}}if("undefined"==typeof h||null==h||"undefined"==typeof g||null==g||"undefined"==typeof l||null==l||"undefined"==typeof k||null==k||"undefined"==typeof n||null==n)return null;"acousticPlay"==b.value?a.push(h):a=h.split(",");k=["S","M","H","10MS"].indexOf(k);g/=100;break;default:return null}if(0==a.length)return null;b="";h=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"DURATION_UNIT");b+='(datapoints.Get("'+h+'")).State('+
  k+");\n";h=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"RAMP_TIME_UNIT");b+='(datapoints.Get("'+h+'")).State(0);\n';h=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"RAMP_TIME_VALUE");b+='(datapoints.Get("'+h+'")).State(0);\n';h=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"LEVEL");b+='(datapoints.Get("'+h+'")).State('+g+");\n";h=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"OUTPUT_SELECT_SIZE");b+='(datapoints.Get("'+h+'")).State('+a.length+");\n";h=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"REPETITIONS");
  b+='(datapoints.Get("'+h+'")).State('+n+");\n";for(e=1;e<=a.length;e++)h=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"SOUNDFILE_LIST_"+e),b+='(datapoints.Get("'+h+'")).State('+a[e-1]+");\n";h=xnm.aio.hm.MHMCCU._getDataPointAddress(c,d,"DURATION_VALUE");return b+('(datapoints.Get("'+h+'")).State('+l+");\n")},buildStateScript:function(a,c,d,b){if(!c.channels||!b.value)return null;switch(b.value){case "acousticLevel":a="LEVEL";break;case "acousticSoundfile":a="SOUNDFILE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(c,
  d,a)},handleStatusResponse:function(a,c){if("?"==a)return a;switch(c.value){case "acousticLevel":return a=parseFloat(a),Math.round(100*a);case "acousticSoundfile":return parseInt(a);default:return"?"}},resolveState:function(a,c,d){switch(c.datapoint){case "LEVEL":var b="acousticLevel";break;case "SOUNDFILE":b="acousticSoundfile"}if(!b)return null;a=this.handleStatusResponse(d+"",{value:b});return{key:b,value:a}}}};
  xnm.aio.hm.BidCosDevice=function(){var a=function(){};a.prototype.getCommandStatusMap=function(){return{command:[{type:"enum",name:"ch.1 short press",ref:{value:"ch1pressShort"}},{type:"enum",name:"ch.1 long press",ref:{value:"ch1pressLong"}},{type:"enum",name:"ch.2 short press",ref:{value:"ch2pressShort"}},{type:"enum",name:"ch.2 long press",ref:{value:"ch2pressLong"}}],status:[{type:"int",name:"state",ref:{value:"state8bit",extMeta:"0-255"}},{type:"enum",name:"low battery",ref:{value:"lowbat",options:["true",
  "off"]}}]}};a.prototype.getIPEvtMap=function(){return{ipevt:[{type:"int",name:"state",ref:{value:"state8bit",extMeta:"0-255"}},{type:"enum",name:"low battery",ref:{value:"lowbat",options:["true","off"]}},{type:"enum",name:"ch.1 short press",ref:{value:"ch1pressShort",options:["true"]}},{type:"enum",name:"ch.1 long press",ref:{value:"ch1pressLong",options:["true"]}},{type:"enum",name:"ch.2 short press",ref:{value:"ch2pressShort",options:["true"]}},{type:"enum",name:"ch.2 long press",ref:{value:"ch2pressLong",
  options:["true"]}}]}};a.prototype.executeCommand=function(a,d,b,e){if(b){var c=null;switch(b.value){case "ch1pressShort":c=xnm.aio.hm.Channel.KEY.buildCommandScript(a,d,{address:1},{value:"pressShort"});break;case "ch1pressLong":c=xnm.aio.hm.Channel.KEY.buildCommandScript(a,d,{address:1},{value:"pressLong"});break;case "ch2pressShort":c=xnm.aio.hm.Channel.KEY.buildCommandScript(a,d,{address:2},{value:"pressShort"});break;case "ch2pressLong":c=xnm.aio.hm.Channel.KEY.buildCommandScript(a,d,{address:2},
  {value:"pressLong"})}c?a._doRequestMarked(c,!0,{execute:function(a,b){e&&e(a)}}):e&&e(Error("invalid command"))}else e&&e(Error("command is null"))};a.prototype.buildStateScript=function(a,d,b){if(!b)return null;var c=null;switch(b.value){case "state8bit":c=xnm.aio.hm.Channel.MOD_EM8BIT_TRANSMITTER.buildStateScript(a,d,{address:3},{value:"state8bit"});break;case "lowbat":c=xnm.aio.hm.Channel.MOD_EM8BIT_TRANSMITTER.buildStateScript(a,d,{address:3},{value:"lowbat"})}return c};a.prototype.handleStatusResponse=
  function(a,d){if("?"==a)return a;switch(d.value){case "state8bit":return xnm.aio.hm.Channel.MOD_EM8BIT_TRANSMITTER.handleStatusResponse(a,d);case "lowbat":return xnm.aio.hm.Channel.MOD_EM8BIT_TRANSMITTER.handleStatusResponse(a,d);default:return"?"}};a.prototype.resolveState=function(a,d,b){if(!d||!d.channel)return null;var c=d.channel.indexOf(":");if(-1==c)return null;c=d.channel.substr(c+1);var f=null;switch(c){case "1":case "2":f=xnm.aio.hm.Channel.KEY.resolveState(a,d,b);"1"==c?f.key="ch1"+f.key:
  "2"==c&&(f.key="ch2"+f.key);break;case "3":f=xnm.aio.hm.Channel.MOD_EM8BIT_TRANSMITTER.resolveState(a,d,b)}return f};return{"HM-MOD-EM-8Bit":new a,parseDevice:function(a){if(!a["interface"]||!a.channels||!a.hsstype)return null;switch(a.hsstype){case "HM-Sec-Sir-WM":return this._parseHMSecSirWM(a);case "HM-WDS30-OT2-SM-2":return this._parseHM_WDS30_OT2_SM_2(a);case "HM-ES-TX-WM":return this._parseHM_ES_TX_WM(a);case "HM-MOD-EM-8Bit":return this._parseHM_MOD_EM_8BIT(a);case "HM-LC-RGBW-WM":return null;
  default:var c=!1,b=[],e=["DIMMER","VIRTUAL_DIMMER"],f;for(f in a.channels){var h=a.channels[f];h&&h.hsstype&&-1!=e.indexOf(h.hsstype)&&(-1==b.indexOf(h.hsstype)?b.push(h.hsstype):c=!0)}return 0<b.length?this._parseDevice(a,b,c):null}},_parseDevice:function(a,d,b){var c=[],f=null,h=null,g;for(g in a.channels){var l=a.channels[g];if(l&&l.address&&l.hsstype){var k=l.address.indexOf(":");if(-1!==k){var n=l.address.substring(k+1),q={id:l.name,address:n,room:l.room,group:l.func,datapoints:[]};0==n&&(f=
  l.hsstype,h=q);if(-1!=d.indexOf(l.hsstype))if(k=this._parseGeneralInfo(a),k.channels[l.hsstype]=q,b)k.id+=":"+n,k.address+=":"+n,c.push(k);else{c.push(k);break}}}}if(h&&f)for(a=0;a<c.length;a++)(k=c[a])&&(k.channels[f]=h);return c},_parseHMSecSirWM:function(a){this._parseGeneralInfo(a);var c={};c.sys=xnm.aio.hm.DM.SYS;c.id=a.name;c.type=a.hsstype;c.address=a.address;c.rfAddr=a.rfAddr;c["interface"]=a["interface"];c.channels={};var b=a.channels,e;for(e in b)if(b.hasOwnProperty(e)){var f=a.channels[e];
  if(f.address){var h=f.address.indexOf(":");-1!==h&&(h=f.address.substring(h+1),0!=h&&f.hsstype&&(f={id:f.name,address:h,room:f.room,group:f.func,datapoints:[]},1==h?c.channels.SWITCH_SENSOR_1=f:2==h?c.channels.SWITCH_SENSOR_2=f:3==h?c.channels.SWITCH_PANIC=f:4==h&&(c.channels.ARMING=f)))}}return[c]},_parseHM_WDS30_OT2_SM_2:function(a){var c=this._parseGeneralInfo(a),b=a.channels,e;for(e in b)if(b.hasOwnProperty(e)){var f=a.channels[e];if(f.address){var h=f.address.indexOf(":");if(-1!==h&&(h=f.address.substring(h+
  1),f.hsstype)){var g={id:f.name,address:h,room:f.room,group:f.func,datapoints:[]};0==h?c.channels[f.hsstype]=g:1==h?c.channels.WEATHER_1=g:2==h?c.channels.WEATHER_2=g:3==h?c.channels.WEATHER_3=g:4==h&&(c.channels.WEATHER_4=g)}}}return[c]},_parseHM_ES_TX_WM:function(a){var c=this._parseGeneralInfo(a),b=a.channels,e;for(e in b)if(b.hasOwnProperty(e)){var f=a.channels[e];if(f.address){var h=f.address.indexOf(":");-1!==h&&(h=f.address.substring(h+1),0!=h&&f.hsstype&&(c.channels[f.hsstype]={id:f.name,
  address:h,room:f.room,group:f.func,datapoints:[]}))}}return[c]},_parseHM_MOD_EM_8BIT:function(a){var c=this._parseGeneralInfo(a),b=a.channels,e;for(e in b)if(b.hasOwnProperty(e)){var f=a.channels[e];if(f.address){var h=f.address.indexOf(":");-1!==h&&(h=f.address.substring(h+1),0!=h&&f.hsstype&&(f={id:f.name,address:h,room:f.room,group:f.func,datapoints:[]},1==h?c.channels.KEY_1=f:2==h?c.channels.KEY_2=f:3==h&&(c.channels.MOD_EM8BIT_TRANSMITTER=f)))}}return[c]},_parseGeneralInfo:function(a){var c=
  {};c.sys=xnm.aio.hm.DM.SYS;c.id=a.name;c.type=a.hsstype;c.address=a.address;c.rfAddr=a.rfAddr;c["interface"]=a["interface"];c.channels={};return c}}}();
  xnm.aio.hm.HmIPDevice=function(){var a=function(){var a=function(){this._address=this._type=null;this._chMaintenance=0;this._chMaintenanaceHsstype=null;this._chKeyTransceivers=[]};a.prototype.getAddress=function(){var a=this._address.indexOf(":");return-1!=a?this._address.substr(0,a):this._address};a.prototype.getCommandStatusMap=function(){var a={status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBat",
  options:["false","true"]}}]};if("HmIP-BRC2"==this._type||"HmIP-MOD-OC"==this._type.substr(0,11))a.status=[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}}];"HmIP-RCV-50"==this._type&&(a.command=[{type:"enum",name:"short press",ref:{value:"pressShort"}},{type:"enum",name:"long press",ref:{value:"pressLong"}}]);return a};a.prototype.getIPEvtMap=function(){var a={ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},
  {type:"enum",name:"battery low",ref:{value:"errorLowbat",options:["false","true"]}}]};if("HmIP-BRC2"==this._type||"HmIP-MOD-OC"==this._type.substr(0,11))a.ipevt=[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}}];if(1==this._chKeyTransceivers.length)a.ipevt.push({type:"enum",name:"short press",ref:{value:"pressShort",options:["true"]}}),a.ipevt.push({type:"enum",name:"long press",ref:{value:"pressLong",options:["true"]}});else for(var b=0;b<this._chKeyTransceivers.length;b++){var c=
  this._chKeyTransceivers[b];c&&(a.ipevt.push({type:"enum",name:"button "+c+" short press",ref:{value:"btn"+c+"pressShort",options:["true"]}}),a.ipevt.push({type:"enum",name:"button "+c+" long press",ref:{value:"btn"+c+"pressLong",options:["true"]}}))}return a};a.prototype.executeCommand=function(a,b,c,d){if(c){var e=null;b={interface:b.interface,address:this.getAddress(),channels:b.channels};if(1==this._chKeyTransceivers.length)e=xnm.aio.hm.HmIPChannel.KEY_TRANSCEIVER.buildCommandScript(a,b,{address:this._chKeyTransceivers[0]},
  c);else if("btn"==c.value.substr(0,3)){var x=c.value.indexOf("press"),v=c.value.substr(3,x);v=parseInt(v);-1!=this._chKeyTransceivers.indexOf(v)&&(e=xnm.aio.hm.HmIPChannel.KEY_TRANSCEIVER.buildCommandScript(a,b,{address:v},{value:c.value.substr(x)}))}e?a._doRequestMarked(e,!0,{execute:function(a,b){setTimeout(function(){d&&d(a)},200)}}):d&&d(Error("invalid command"))}else d&&d(Error("command is null"))};a.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":case "errorBat":d=
  xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c)}return d};a.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":case "errorBat":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);default:return"?"}};a.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(d){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,
  b,c);break;default:-1!=this._chKeyTransceivers.indexOf(parseInt(d))&&(e=xnm.aio.hm.HmIPChannel.KEY_TRANSCEIVER.resolveState(a,b,c),1<this._chKeyTransceivers.length&&e&&("pressShort"==e.key?e.key="btn"+d+"pressShort":"pressLong"==e.key&&(e.key="btn"+d+"pressLong")))}return e};a.parseJSON=function(b){if(!b||!b.type||!b.channels)return null;var c=new a;c._type=b.type;c._address=b.address;for(var d in b.channels){var e=b.channels[d];0==e.address?c._chMaintenanaceHsstype=d:"KEY_TRANSCEIVER"==d&&c._chKeyTransceivers.push(parseInt(e.address))}return c};
  return a}(),c=function(){this._address=this._type=null;this._chMaintenance=0;this._chSwitchTransmitter=1;this._chSwitchVirtualReceiver1=2;this._chSwitchVirtualReceiver2=3;this._chSwitchVirtualReceiver3=4;this._chSwitchWeekProfile=17};c.prototype.getAddress=function(){var a=this._address.indexOf(":");return-1!=a?this._address.substr(0,a):this._address};c.prototype.getCommandStatusMap=function(){return{command:[{type:"enum",name:"on",ref:{value:"on"}},{type:"enum",name:"off",ref:{value:"off"}},{type:"enum",
  name:"toggle",ref:{value:"toggle"}},{type:"float",name:"on for",ref:{value:"onFor",ext:"%f",unit:"s"}}],status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"switch status",ref:{value:"switchState",options:["off","on"]}}]}};c.prototype.getIPEvtMap=function(){var a=this.getCommandStatusMap().status;return{ipevt:JSON.parse(JSON.stringify(a))}};c.prototype.useStateBuffer=function(){return"HmIPW-DRS"==this._type.substr(0,9)||"HmIP-MOD-OC"==
  this._type.substr(0,11)?!0:!1};c.prototype.executeCommand=function(a,b,c,d){if(c){var e=null;e={interface:b.interface,address:this.getAddress(),channels:b.channels};if(e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,e,{address:this._chSwitchVirtualReceiver1},c)){var x=this;a._doRequestMarked(e,!0,{execute:function(e,v){e||x._handleCommandResponse(a,b,c,v);d&&d(e)}})}else d&&d(Error("invalid command"))}else d&&d(Error("command is null"))};c.prototype._handleCommandResponse=function(a,
  b,c,d){if(this.useStateBuffer())switch(b=this.getAddress()+":"+this._chSwitchTransmitter+".STATE",c.value){case "on":a._statebuffer[b]={value:"on",timestamp:(new Date).getTime(),expire:4E3};break;case "off":a._statebuffer[b]={value:"off",timestamp:(new Date).getTime(),expire:4E3};break;case "toggle":a._statebuffer[b]&&a._statebuffer[b].value&&(a._statebuffer[b]="on"==a._statebuffer[b].value?{value:"off",timestamp:(new Date).getTime(),expire:4E3}:{value:"on",timestamp:(new Date).getTime(),expire:4E3});
  break;case "onFor":c=1E3*parseFloat(c.ext),a._statebuffer[b]={value:"on",timestamp:(new Date).getTime(),expire:c}}};c.prototype.getBufferedState=function(a,b,c){if(!this.useStateBuffer()||!c||!c.value||"switchState"!=c.value)return null;b=this.getAddress()+":"+this._chSwitchTransmitter+".STATE";if(!a._statebuffer[b])return null;c=a._statebuffer[b];if("undefined"==typeof c.value||null==c.value||!c.timestamp)return delete a._statebuffer[b],null;var d=c.timestamp,e=c.expire;e||(e=1E3);return(new Date).getTime()>
  d+e?(delete a._statebuffer[b],null):c.value};c.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;b={interface:b.interface,address:this.getAddress(),channels:b.channels};switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:this._chMaintenance},c);break;case "switchState":d=xnm.aio.hm.HmIPChannel.SWITCH_TRANSMITTER.buildStateScript(a,b,{address:this._chSwitchTransmitter},{value:"switchTState"})}return d};c.prototype.handleStatusResponse=
  function(a,b,c){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "switchState":return a=xnm.aio.hm.HmIPChannel.SWITCH_TRANSMITTER.handleStatusResponse(a,{value:"switchTState"}),this.useStateBuffer()&&(b=this.getAddress()+":"+this._chSwitchTransmitter+".STATE",c._statebuffer[b]={value:a,timestamp:(new Date).getTime(),expire:1E3}),a;default:return"?"}};c.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=
  b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(parseInt(d)){case this._chMaintenance:e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case this._chSwitchTransmitter:if(e=xnm.aio.hm.HmIPChannel.SWITCH_TRANSMITTER.resolveState(a,b,c))e.key="switchState"}return e};c.parseJSON=function(a){if(!a||!a.type||!a.channels)return null;var b=new c;b._type=a.type;b._address=a.address;var d=0,e;for(e in a.channels)"SWITCH_TRANSMITTER"==e.substr(0,18)?b._chSwitchTransmitter=
  parseInt(a.channels[e].address):"SWITCH_VIRTUAL_RECEIVER"==e.substr(0,23)?(d++,1==d?b._chSwitchVirtualReceiver1=parseInt(a.channels[e].address):2==d?b._chSwitchVirtualReceiver2=parseInt(a.channels[e].address):3==d&&(b._chSwitchVirtualReceiver3=parseInt(a.channels[e].address))):"SWITCH_WEEK_PROFILE"==e.substr(0,19)&&(b._chSwitchWeekProfile=parseInt(a.channels[e].address));return b};var d=function(){this._address=this._type=null;this._chMaintenance=0;this._chDimmerTransmitter=1;this._chDimmerVirtualReceiver1=
  2;this._chDimmerVirtualReceiver2=3;this._chDimmerVirtualReceiver3=4;this._chDimmerWeekProfile=13};d.prototype.getAddress=function(){var a=this._address.indexOf(":");return-1!=a?this._address.substr(0,a):this._address};d.prototype.getCommandStatusMap=function(){var a=function(a,b){a.command.push({type:"enum",name:"ch."+b+" on",ref:{value:"ch"+b+"dimOn"}});a.command.push({type:"enum",name:"ch."+b+" off",ref:{value:"ch"+b+"dimOff"}});a.command.push({type:"int",name:"ch."+b+" dim up",ref:{value:"ch"+
  b+"dimUp",ext:"%d",extMeta:"1-100",unit:"%"}});a.command.push({type:"int",name:"ch."+b+" dim down",ref:{value:"ch"+b+"dimDown",ext:"%d",extMeta:"1-100",unit:"%"}});a.command.push({type:"int",name:"ch."+b+" dim to",ref:{value:"ch"+b+"dimTo",ext:"%d",extMeta:"1-100",unit:"%"}});a.command.push({type:"int",name:"ch."+b+" toggle to",ref:{value:"ch"+b+"toggleTo",ext:"%d",extMeta:"1-100",unit:"%"}});a.status.push({type:"int",name:"ch."+b+" status",ref:{value:"ch"+b+"Level",extMeta:"0-100",unit:"%"}})},b=
  {command:[{type:"enum",name:"on",ref:{value:"dimOn"}},{type:"enum",name:"off",ref:{value:"dimOff"}},{type:"int",name:"dim up",ref:{value:"dimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"dim down",ref:{value:"dimDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"dim to",ref:{value:"dimTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"int",name:"toggle to",ref:{value:"toggleTo",ext:"%d",extMeta:"0-100",unit:"%"}}],status:[{type:"enum",name:"communication error",ref:{value:"errorComm",
  options:["false","true"]}},{type:"int",name:"dimmer status",ref:{value:"dimmerTLevel",extMeta:"0-100",unit:"%"}}]};a(b,this._chDimmerVirtualReceiver1);a(b,this._chDimmerVirtualReceiver2);a(b,this._chDimmerVirtualReceiver3);return b};d.prototype.getIPEvtMap=function(){var a=this.getCommandStatusMap().status;return{ipevt:JSON.parse(JSON.stringify(a))}};d.prototype.useStateBuffer=function(){return"HmIPW-DRD"==this._type.substr(0,9)?!0:!1};d.prototype.executeCommand=function(a,b,c,d){if(c){var e={value:c.value,
  ext:c.ext},f=this._chDimmerVirtualReceiver1;if("ch"==c.value.substr(0,2)){var x=c.value.indexOf("dim");-1==x&&(x=c.value.indexOf("toggle"));if(-1==x){d&&d(Error("invalid command"));return}f=parseInt(c.value.substr(2,x));e.value=c.value.substr(x);if(f!=this._chDimmerVirtualReceiver1&&f!=this._chDimmerVirtualReceiver2&&f!=this._chDimmerVirtualReceiver3){d&&d(Error("invalid command"));return}}x=null;x={interface:b.interface,address:this.getAddress(),channels:b.channels};if(x=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,
  x,{address:f},e)){var v=this;a._doRequestMarked(x,!0,{execute:function(e,f){e||v._handleCommandResponse(a,b,c,f);d&&d(e)}})}else d&&d(Error("invalid command"))}else d&&d(Error("command is null"))};d.prototype._handleCommandResponse=function(a,b,c,d){if(this.useStateBuffer()){b=null;var e=d.indexOf("<v>");if(-1!=e){var f=d.indexOf("</v>");-1!=f&&(d=d.substring(e+3,f),b=Math.round(100*parseFloat(d)))}d=this.getAddress()+":"+this._chDimmerTransmitter+".LEVEL";switch(c.value){case "dimOn":delete a._statebuffer[d];
  break;case "dimOff":a._statebuffer[d]={value:0,timestamp:(new Date).getTime(),expire:3E3};break;case "dimUp":null!=b&&(a._statebuffer[d]={value:b,timestamp:(new Date).getTime(),expire:3E3});break;case "dimDown":null!=b&&(a._statebuffer[d]={value:b,timestamp:(new Date).getTime(),expire:3E3});break;case "dimTo":b=parseInt(c.ext);null!=b&&(a._statebuffer[d]={value:b,timestamp:(new Date).getTime(),expire:3E3});break;case "toggleTo":null!=b&&(a._statebuffer[d]={value:b,timestamp:(new Date).getTime(),expire:3E3})}}};
  d.prototype.getBufferedState=function(a,b,c){if(!this.useStateBuffer()||!c||!c.value||"dimmerTLevel"!=c.value)return null;b=this.getAddress()+":"+this._chDimmerTransmitter+".LEVEL";if(!a._statebuffer[b])return null;c=a._statebuffer[b];if("undefined"==typeof c.value||null==c.value||!c.timestamp)return delete a._statebuffer[b],null;var d=c.timestamp,e=c.expire;e||(e=1E3);return(new Date).getTime()>d+e?(delete a._statebuffer[b],null):c.value};d.prototype.buildStateScript=function(a,b,c){if(!c)return null;
  var d=null,e={interface:b.interface,address:this.getAddress(),channels:b.channels};switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,e,{address:this._chMaintenance},c);break;case "dimmerTLevel":d=xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.buildStateScript(a,e,{address:this._chDimmerTransmitter},{value:"dimmerTLevel"});break;case "ch"+this._chDimmerVirtualReceiver1+"Level":d=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:this._chDimmerVirtualReceiver1},
  {value:"dimmerLevel"});break;case "ch"+this._chDimmerVirtualReceiver2+"Level":d=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:this._chDimmerVirtualReceiver2},{value:"dimmerLevel"});break;case "ch"+this._chDimmerVirtualReceiver3+"Level":d=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:this._chDimmerVirtualReceiver3},{value:"dimmerLevel"})}return d};d.prototype.handleStatusResponse=function(a,b,c){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,
  b);case "dimmerTLevel":return a=xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.handleStatusResponse(a,{value:"dimmerTLevel"}),this.useStateBuffer()&&(b=this.getAddress()+":"+this._chDimmerTransmitter+".LEVEL",c._statebuffer[b]={value:a,timestamp:(new Date).getTime(),expire:1E3}),a;case "ch"+this._chDimmerVirtualReceiver1+"Level":case "ch"+this._chDimmerVirtualReceiver2+"Level":case "ch"+this._chDimmerVirtualReceiver3+"Level":return xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.handleStatusResponse(a,
  {value:"dimmerLevel"});default:return"?"}};d.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(parseInt(d)){case this._chMaintenance:e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case this._chDimmerTransmitter:e=xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.resolveState(a,b,c);break;case this._chDimmerVirtualReceiver1:case this._chDimmerVirtualReceiver2:case this._chDimmerVirtualReceiver3:if(e=
  xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.resolveState(a,b,c))e.key="ch"+d+"Level"}return e};d.parseJSON=function(a){if(!a||!a.type||!a.channels)return null;var b=new d;b._type=a.type;b._address=a.address;var c=0,e;for(e in a.channels)"DIMMER_TRANSMITTER"==e.substr(0,18)?b._chDimmerTransmitter=parseInt(a.channels[e].address):"DIMMER_VIRTUAL_RECEIVER"==e.substr(0,23)?(c++,1==c?b._chDimmerVirtualReceiver1=parseInt(a.channels[e].address):2==c?b._chDimmerVirtualReceiver2=parseInt(a.channels[e].address):
  3==c&&(b._chDimmerVirtualReceiver3=parseInt(a.channels[e].address))):"DIMMER_WEEK_PROFILE"==e.substr(0,19)&&(b._chDimmerWeekProfile=parseInt(a.channels[e].address));return b};var b=function(){this._address=this._type=null;this._chMaintenance=0;this._chBlindTransmitter=1;this._chBlindVirtualReceiver1=2;this._chBlindVirtualReceiver2=3;this._chBlindVirtualReceiver3=4;this._chBlindWeekProfile=17};b.prototype.getAddress=function(){var a=this._address.indexOf(":");return-1!=a?this._address.substr(0,a):
  this._address};b.prototype.getCommandStatusMap=function(){return{command:[{type:"enum",name:"stop",ref:{value:"stop"}},{type:"enum",name:"move up",ref:{value:"moveUp"}},{type:"enum",name:"move down",ref:{value:"moveDown"}},{type:"int",name:"step up",ref:{value:"stepUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"step down",ref:{value:"stepDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"move to",ref:{value:"moveTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"lamella up",
  ref:{value:"lamellaUp"}},{type:"enum",name:"lamella down",ref:{value:"lamellaDown"}},{type:"int",name:"lamella step up",ref:{value:"lamellaStepUp",ext:"%d",extMeta:"1-10",unit:"%"}},{type:"int",name:"lamella step down",ref:{value:"lamellaStepDown",ext:"%d",extMeta:"1-10",unit:"%"}},{type:"int",name:"lamella to",ref:{value:"lamellaTo",ext:"%d",extMeta:"0-100",unit:"%"}}],status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"int",name:"blind status",
  ref:{value:"blindTPos",extMeta:"0-100",unit:"%"}},{type:"int",name:"lamella status",ref:{value:"lamellaTPos",extMeta:"0-100",unit:"%"}}]}};b.prototype.getIPEvtMap=function(){var a=this.getCommandStatusMap().status;return{ipevt:JSON.parse(JSON.stringify(a))}};b.prototype.executeCommand=function(a,b,c,d){c?(script=xnm.aio.hm.HmIPChannel.BLIND_VIRTUAL_RECEIVER.buildCommandScript(a,{interface:b.interface,address:this.getAddress(),channels:b.channels},{address:this._chBlindVirtualReceiver1},{value:c.value,
  ext:c.ext}))?a._doRequestMarked(script,!0,{execute:function(a,b){setTimeout(function(){d&&d(a)},200)}}):d&&d(Error("invalid command")):d&&d(Error("command is null"))};b.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;b={interface:b.interface,address:this.getAddress(),channels:b.channels};switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:this._chMaintenance},c);break;case "blindTPos":d=xnm.aio.hm.HmIPChannel.BLIND_TRANSMITTER.buildStateScript(a,
  b,{address:this._chBlindTransmitter},{value:"blindTPos"});break;case "lamellaTPos":d=xnm.aio.hm.HmIPChannel.BLIND_TRANSMITTER.buildStateScript(a,b,{address:this._chBlindTransmitter},{value:"lamellaTPos"})}return d};b.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "blindTPos":return xnm.aio.hm.HmIPChannel.BLIND_TRANSMITTER.handleStatusResponse(a,{value:"blindTPos"});case "lamellaTPos":return xnm.aio.hm.HmIPChannel.BLIND_TRANSMITTER.handleStatusResponse(a,
  {value:"lamellaTPos"});default:return"?"}};b.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(parseInt(d)){case this._chMaintenance:e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case this._chBlindTransmitter:e=xnm.aio.hm.HmIPChannel.BLIND_TRANSMITTER.resolveState(a,b,c)}return e};b.parseJSON=function(a){if(!a||!a.type||!a.channels)return null;var c=new b;c._type=a.type;
  c._address=a.address;var d=0,e;for(e in a.channels)"BLIND_TRANSMITTER"==e.substr(0,17)?c._chBlindTransmitter=parseInt(a.channels[e].address):"BLIND_VIRTUAL_RECEIVER"==e.substr(0,22)?(d++,1==d?c._chBlindVirtualReceiver1=parseInt(a.channels[e].address):2==d?c._chBlindVirtualReceiver2=parseInt(a.channels[e].address):3==d&&(c._chBlindVirtualReceiver3=parseInt(a.channels[e].address))):"BLIND_WEEK_PROFILE"==e.substr(0,18)&&(c._chBlindWeekProfile=parseInt(a.channels[e].address));return c};var e=function(){var a=
  function(){this._address=this._type=null;this._chMaintenance=0;this._chMaintenanceHsstype=null;this._chInputTransmitter=1};a.prototype.getCommandStatusMap=function(){var a="MAINTENANCE_BAT_EL"==this._chMaintenanceHsstype?{status:[{type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBatElBat",options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorBatElVoltage",ext:"%f",extMeta:"0.0-25.2"}}]}:
  {status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}}]};a.status.push({type:"enum",name:"status",ref:{value:"state",options:["off","on"]}});return a};a.prototype.getIPEvtMap=function(){var a="MAINTENANCE_BAT_EL"==this._chMaintenanceHsstype?{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBatElBat",options:["false","true"]}},{type:"float",name:"battery voltage",
  ref:{value:"errorBatElVoltage",ext:"%f",extMeta:"0.0-25.2"}}]}:{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}}]};a.ipevt.push({type:"enum",name:"status",ref:{value:"state",options:["off","on"]}});a.ipevt.push({type:"enum",name:"short press",ref:{value:"pressShort",options:["true"]}});a.ipevt.push({type:"enum",name:"long press",ref:{value:"pressLong",options:["true"]}});return a};a.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=
  null;switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:this._chMaintenance},c);break;case "errorBatElComm":case "errorBatElBat":case "errorBatElVoltage":d=xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.buildStateScript(a,b,{address:this._chMaintenance},c);break;case "state":d=xnm.aio.hm.HmIPChannel.MULTI_MODE_INPUT_TRANSMITTER.buildStateScript(a,b,{address:this._chInputTransmitter},{value:"state"})}return d};a.prototype.handleStatusResponse=function(a,
  b){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "errorBatElComm":case "errorBatElBat":case "errorBatElVoltage":return xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.handleStatusResponse(a,b);case "state":return xnm.aio.hm.HmIPChannel.MULTI_MODE_INPUT_TRANSMITTER.handleStatusResponse(a,{value:"state"});default:return"?"}};a.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==
  d)return null;d=b.channel.substr(d+1);var e=null;switch(parseInt(d)){case this._chMaintenance:e="MAINTENANCE_BAT_EL"==this._chMaintenanceHsstype?xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.resolveState(a,b,c):xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case this._chInputTransmitter:e=xnm.aio.hm.HmIPChannel.MULTI_MODE_INPUT_TRANSMITTER.resolveState(a,b,c)}return e};a.parseJSON=function(b){if(!b||!b.type||!b.channels)return null;var c=new a;c._type=b.type;c._address=b.address;if("HmIP-FCI"==
  b.type.substr(0,8)||"HmIP-MOD-RC"==b.type.substr(0,11))c._chMaintenanceHsstype="MAINTENANCE_BAT_EL";for(var d in b.channels)"MULTI_MODE_INPUT_TRANSMITTER"==d.substr(0,28)?c._chInputTransmitter=parseInt(b.channels[d].address):"KEY_TRANSCEIVER"==d.substr(0,15)&&"HmIP-MOD-RC"==b.type.substr(0,11)&&(c._chInputTransmitter=parseInt(b.channels[d].address));return c};return a}(),f=function(){var a=function(){this._address=this._type=null;this._chMaintenance=0;this._chMaintenanceHsstype=null;this._chHeatingClimateControlTransceiver=
  1};a.prototype.getCommandStatusMap=function(){return{command:[{type:"int",name:"set profile",ref:{value:"themoProf",ext:"%d",extMeta:"1-6",scale:"1"}},{type:"enum",name:"boost on",ref:{value:"themoBoostOn"}},{type:"enum",name:"boost off",ref:{value:"themoBoostOff"}},{type:"enum",name:"set auto mode",ref:{value:"themoAutoMode"}},{type:"enum",name:"set manu mode",ref:{value:"themoManuMode"}},{type:"float",name:"set temperature",ref:{value:"themoTemp",ext:"%f",extMeta:"4.5-30.5",scale:"0.5"}},{type:"enum",
  name:"on",ref:{value:"themoTempOn"}},{type:"enum",name:"off",ref:{value:"themoTempOff"}},{type:"enum",name:"temperature up",ref:{value:"themoTempUp"}},{type:"enum",name:"temperature down",ref:{value:"themoTempDown"}},{type:"enum",name:"set window open",ref:{value:"themoWinOpen"}},{type:"enum",name:"set window close",ref:{value:"themoWinClose"}}],status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"int",name:"profile",ref:{value:"themoProf"}},{type:"float",
  name:"actual temperature",ref:{value:"themoActualTemp",extMeta:"-10.0-56.0",scale:"0.1"}},{type:"enum",name:"boost mode",ref:{value:"themoBoostMode",options:["off","on"]}},{type:"enum",name:"frost protection",ref:{value:"themoFrost",options:["off","on"]}},{type:"int",name:"humidity",ref:{value:"themoHum"}},{type:"enum",name:"mode",ref:{value:"themoMode",options:["auto","manu"]}},{type:"float",name:"set temperature",ref:{value:"themoTemp",extMeta:"4.5-30.5",scale:"0.5"}},{type:"enum",name:"window state",
  ref:{value:"themoWinState",options:["open","closed"]}}]}};a.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorVoltage",ext:"%f",extMeta:"0.0-25.2"}},{type:"int",name:"profile",ref:{value:"themoProf"}},{type:"float",name:"actual temperature",ref:{value:"themoActualTemp",extMeta:"-10.0-56.0",scale:"0.1"}},{type:"enum",name:"boost mode",ref:{value:"themoBoostMode",
  options:["off","on"]}},{type:"enum",name:"frost protection",ref:{value:"themoFrost",options:["off","on"]}},{type:"int",name:"humidity",ref:{value:"themoHum"}},{type:"enum",name:"mode",ref:{value:"themoMode",options:["auto","manu"]}},{type:"float",name:"set temperature",ref:{value:"themoTemp",extMeta:"4.5-30.5",scale:"0.5"}},{type:"enum",name:"window state",ref:{value:"themoWinState",options:["open","closed"]}}]}};a.prototype.executeCommand=function(a,b,c,d){c?(script=xnm.aio.hm.HmIPChannel.HEATING_CLIMATECONTROL_TRANSCEIVER.buildCommandScript(a,
  {interface:b.interface,address:this._address,channels:b.channels},{address:this._chHeatingClimateControlTransceiver},{value:c.value,ext:c.ext}))?a._doRequestMarked(script,!0,{execute:function(a,b){setTimeout(function(){d&&d(a)},200)}}):d&&d(Error("invalid command")):d&&d(Error("command is null"))};a.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:this._chMaintenance},c);break;
  case "themoProf":case "themoActualTemp":case "themoBoostMode":case "themoFrost":case "themoHum":case "themoMode":case "themoTemp":case "themoValveLevel":case "themoWinState":d=xnm.aio.hm.HmIPChannel.HEATING_CLIMATECONTROL_TRANSCEIVER.buildStateScript(a,b,{address:this._chHeatingClimateControlTransceiver},{value:c.value})}return d};a.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "themoProf":case "themoActualTemp":case "themoBoostMode":case "themoFrost":case "themoHum":case "themoMode":case "themoTemp":case "themoValveLevel":case "themoWinState":return xnm.aio.hm.HmIPChannel.HEATING_CLIMATECONTROL_TRANSCEIVER.handleStatusResponse(a,
  b);default:return"?"}};a.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(parseInt(d)){case this._chMaintenance:e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case this._chHeatingClimateControlTransceiver:e=xnm.aio.hm.HmIPChannel.HEATING_CLIMATECONTROL_TRANSCEIVER.resolveState(a,b,c)}return e};a.parseJSON=function(b){if(!b||!b.type||!b.channels)return null;var c=new a;c._type=
  b.type;c._address=b.address;c._chMaintenanceHsstype="MAINTENANCE";return c};return a}(),h=function(){var a=function(){this._address=this._type=null;this._chMaintenance=0;this._chMaintenanceHsstype="MAINTENANCE";this._chMotionDetectorTransceiver=1;this._chKeyTransceivers=[]};a.prototype.getCommandStatusMap=function(){var a={command:[{type:"enum",name:"reset",ref:{value:"motionReset"}},{type:"enum",name:"activate detection",ref:{value:"motionOn"}},{type:"enum",name:"deactivate detection",ref:{value:"motionOff"}},
  {type:"enum",name:"toggle detection",ref:{value:"motionToggle"}}],status:[{type:"float",name:"illumination",ref:{value:"motionIllu"}},{type:"enum",name:"state",ref:{value:"motionState",options:["on","off"]}},{type:"enum",name:"detection activated",ref:{value:"motionActivate",options:["off","on"]}}]};a.status="MAINTENANCE_BAT_EL"==this._chMaintenanceHsstype?a.status.concat([{type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"enum",name:"battery low",
  ref:{value:"errorBatElBat",options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorBatElVoltage",ext:"%f",extMeta:"0.0-25.2"}}]):a.status.concat([{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}}]);return a};a.prototype.getIPEvtMap=function(){var a={ipevt:[{type:"float",name:"illumination",ref:{value:"motionIllu"}},{type:"enum",name:"state",ref:{value:"motionState",options:["on","off"]}},{type:"enum",name:"detection activated",ref:{value:"motionActivate",
  options:["off","on"]}}]};a.ipevt="MAINTENANCE_BAT_EL"==this._chMaintenanceHsstype?a.ipevt.concat([{type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBatElBat",options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorBatElVoltage",ext:"%f",extMeta:"0.0-25.2"}}]):a.ipevt.concat([{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}}]);if(1==this._chKeyTransceivers.length)a.ipevt.push({type:"enum",
  name:"short press",ref:{value:"pressShort",options:["true"]}}),a.ipevt.push({type:"enum",name:"long press",ref:{value:"pressLong",options:["true"]}});else for(var b=0;b<this._chKeyTransceivers.length;b++){var c=this._chKeyTransceivers[b];c&&(a.ipevt.push({type:"enum",name:"button "+c+" short press",ref:{value:"btn"+c+"pressShort",options:["true"]}}),a.ipevt.push({type:"enum",name:"button "+c+" long press",ref:{value:"btn"+c+"pressLong",options:["true"]}}))}return a};a.prototype.executeCommand=function(a,
  b,c,d){c?(script=xnm.aio.hm.HmIPChannel.MOTIONDETECTOR_TRANSCEIVER.buildCommandScript(a,{interface:b.interface,address:this._address,channels:b.channels},{address:this._chMotionDetectorTransceiver},{value:c.value,ext:c.ext}))?a._doRequestMarked(script,!0,{execute:function(a,b){setTimeout(function(){d&&d(a)},200)}}):d&&d(Error("invalid command")):d&&d(Error("command is null"))};a.prototype.buildStateScript=function(a,b,c){if(!c)return null;switch(c.value){case "errorComm":a=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,
  b,{address:this._chMaintenance},c);break;case "errorBatElComm":case "errorBatElBat":case "errorBatElVoltage":a=xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.buildStateScript(a,b,{address:this._chMaintenance},c);break;default:a=xnm.aio.hm.HmIPChannel.MOTIONDETECTOR_TRANSCEIVER.buildStateScript(a,b,{address:this._chMotionDetectorTransceiver},{value:c.value})}return a};a.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,
  b);case "errorBatElComm":case "errorBatElBat":case "errorBatElVoltage":return xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.handleStatusResponse(a,b);case "motionIllu":case "motionState":case "motionActivate":return xnm.aio.hm.HmIPChannel.MOTIONDETECTOR_TRANSCEIVER.handleStatusResponse(a,b);default:return"?"}};a.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(parseInt(d)){case this._chMaintenance:e=
  "MAINTENANCE_BAT_EL"==this._chMaintenanceHsstype?xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.resolveState(a,b,c):xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case this._chMotionDetectorTransceiver:e=xnm.aio.hm.HmIPChannel.MOTIONDETECTOR_TRANSCEIVER.resolveState(a,b,c)}return e};a.parseJSON=function(b){if(!b||!b.type||!b.channels)return null;var c=new a;c._type=b.type;c._address=b.address;"HmIP-SMI55"==b.type&&(c._chMaintenanceHsstype="MAINTENANCE_BAT_EL");-1!=b.type.indexOf("SMI55")&&
  (c._chKeyTransceivers=[1,2],c._chMotionDetectorTransceiver=3);return c};return a}(),g=function(){var a=function(){this._address=this._type=null;this._chMaintenance=0;this._chMaintenanceHsstype="MAINTENANCE";this._chPresenceDetectorTransceiver=1};a.prototype.getCommandStatusMap=function(){var a={command:[{type:"enum",name:"reset",ref:{value:"presenceReset"}},{type:"enum",name:"activate detection",ref:{value:"presenceOn"}},{type:"enum",name:"deactivate detection",ref:{value:"presenceOff"}},{type:"enum",
  name:"toggle detection",ref:{value:"presenceToggle"}}],status:[{type:"float",name:"illumination",ref:{value:"presenceIllu"}},{type:"enum",name:"state",ref:{value:"presenceState",options:["on","off"]}},{type:"enum",name:"detection activated",ref:{value:"presenceActivate",options:["off","on"]}}]};a.status="MAINTENANCE_BAT_EL"==this._chMaintenanceHsstype?a.status.concat([{type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBatElBat",
  options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorBatElVoltage",ext:"%f",extMeta:"0.0-25.2"}}]):a.status.concat([{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}}]);return a};a.prototype.getIPEvtMap=function(){var a={ipevt:[{type:"float",name:"illumination",ref:{value:"presenceIllu"}},{type:"enum",name:"state",ref:{value:"presenceState",options:["on","off"]}},{type:"enum",name:"detection activated",ref:{value:"presenceActivate",
  options:["off","on"]}}]};a.ipevt="MAINTENANCE_BAT_EL"==this._chMaintenanceHsstype?a.ipevt.concat([{type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBatElBat",options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorBatElVoltage",ext:"%f",extMeta:"0.0-25.2"}}]):a.ipevt.concat([{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}}]);return a};a.prototype.executeCommand=
  function(a,b,c,d){c?(script=xnm.aio.hm.HmIPChannel.PRESENCEDETECTOR_TRANSCEIVER.buildCommandScript(a,{interface:b.interface,address:this._address,channels:b.channels},{address:this._chPresenceDetectorTransceiver},{value:c.value,ext:c.ext}))?a._doRequestMarked(script,!0,{execute:function(a,b){setTimeout(function(){d&&d(a)},200)}}):d&&d(Error("invalid command")):d&&d(Error("command is null"))};a.prototype.buildStateScript=function(a,b,c){if(!c)return null;switch(c.value){case "errorComm":a=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,
  b,{address:this._chMaintenance},c);break;case "errorBatElComm":case "errorBatElBat":case "errorBatElVoltage":a=xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.buildStateScript(a,b,{address:this._chMaintenance},c);break;default:a=xnm.aio.hm.HmIPChannel.PRESENCEDETECTOR_TRANSCEIVER.buildStateScript(a,b,{address:this._chPresenceDetectorTransceiver},c)}return a};a.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,
  b);case "errorBatElComm":case "errorBatElBat":case "errorBatElVoltage":return xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.handleStatusResponse(a,b);case "presenceIllu":case "presenceState":case "presenceActivate":return xnm.aio.hm.HmIPChannel.PRESENCEDETECTOR_TRANSCEIVER.handleStatusResponse(a,b);default:return"?"}};a.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(parseInt(d)){case this._chMaintenance:e=
  "MAINTENANCE_BAT_EL"==this._chMaintenanceHsstype?xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.resolveState(a,b,c):xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case this._chPresenceDetectorTransceiver:e=xnm.aio.hm.HmIPChannel.PRESENCEDETECTOR_TRANSCEIVER.resolveState(a,b,c)}return e};a.parseJSON=function(b){if(!b||!b.type||!b.channels)return null;var c=new a;c._type=b.type;c._address=b.address;"HmIP-SPI"==b.type&&(c._chMaintenanceHsstype="MAINTENANCE_BAT_EL");return c};return a}(),l=function(){var a=
  function(){this._address=this._type=null;this._chMaintenance=0;this._chMaintenanceHsstype=null;this._chHeatingClimateControlFloorTransceiver=1};a.prototype.getCommandStatusMap=function(){return{status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"humidity limiter",ref:{value:"cl_f_humidityLimiter",options:["true","false"]}},{type:"enum",name:"emergency operation",ref:{value:"cl_f_emergencyOP",options:["true","false"]}},{type:"enum",name:"frost protection",
  ref:{value:"cl_f_frostProtection",options:["true","false"]}},{type:"float",name:"valve level",ref:{value:"cl_valve_level",extMeta:"0-100"}}]}};a.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"humidity limiter",ref:{value:"cl_f_humidityLimiter",options:["true","false"]}},{type:"enum",name:"emergency operation",ref:{value:"cl_f_emergencyOP",options:["true","false"]}},{type:"enum",name:"frost protection",
  ref:{value:"cl_f_frostProtection",options:["true","false"]}},{type:"float",name:"valve level",ref:{value:"cl_valve_level",extMeta:"0-100"}}]}};a.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:this._chMaintenance},c);break;case "cl_f_humidityLimiter":case "cl_f_emergencyOP":case "cl_f_frostProtection":case "cl_valve_level":d=xnm.aio.hm.HmIPChannel.CLIMATECONTROL_FLOOR_TRANSCEIVER.buildStateScript(a,
  b,{address:this._chHeatingClimateControlFloorTransceiver},{value:c.value})}return d};a.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "cl_f_humidityLimiter":case "cl_f_emergencyOP":case "cl_f_frostProtection":case "cl_valve_level":return xnm.aio.hm.HmIPChannel.CLIMATECONTROL_FLOOR_TRANSCEIVER.handleStatusResponse(a,b);default:return"?"}};a.prototype.resolveState=function(a,b,
  c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(parseInt(d)){case this._chMaintenance:e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case this._chHeatingClimateControlFloorTransceiver:e=xnm.aio.hm.HmIPChannel.CLIMATECONTROL_FLOOR_TRANSCEIVER.resolveState(a,b,c)}return e};a.parseJSON=function(b){if(!b||!b.type||!b.channels)return null;var c=new a;c._type=b.type;c._address=b.address;c._chMaintenanceHsstype=
  "MAINTENANCE";for(var d in b.channels)"CLIMATECONTROL_FLOOR_TRANSCEIVER"==d.substr(0,32)&&(c._chHeatingClimateControlFloorTransceiver=parseInt(b.channels[d].address));return c};return a}(),k=function(){};k.prototype.getCommandStatusMap=function(){return{command:[{type:"enum",name:"on",ref:{value:"on"}},{type:"enum",name:"off",ref:{value:"off"}},{type:"enum",name:"toggle",ref:{value:"toggle"}},{type:"enum",name:"ch.4 on",ref:{value:"ch4on"}},{type:"enum",name:"ch.4 off",ref:{value:"ch4off"}},{type:"enum",
  name:"ch.4 toggle",ref:{value:"ch4toggle"}},{type:"enum",name:"ch.5 on",ref:{value:"ch5on"}},{type:"enum",name:"ch.5 off",ref:{value:"ch5off"}},{type:"enum",name:"ch.5 toggle",ref:{value:"ch5toggle"}},{type:"enum",name:"ch.6 on",ref:{value:"ch6on"}},{type:"enum",name:"ch.6 off",ref:{value:"ch6off"}},{type:"enum",name:"ch.6 toggle",ref:{value:"ch6toggle"}}],status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"switch status",ref:{value:"switchState",
  options:["off","on"]}},{type:"enum",name:"ch.4 status",ref:{value:"ch4State",options:["off","on"]}},{type:"enum",name:"ch.5 status",ref:{value:"ch5State",options:["off","on"]}},{type:"enum",name:"ch.6 status",ref:{value:"ch6State",options:["off","on"]}},{type:"float",name:"voltage",ref:{value:"meterVoltage",extMeta:"0.0-409.5",scale:"0.1",unit:"V"}},{type:"float",name:"energy counter",ref:{value:"meterEnergyCounter",extMeta:"0.0-838859.1",scale:"0.1",unit:"Wh"}},{type:"float",name:"frequency",ref:{value:"meterFrequency",
  extMeta:"29.52-70.47",scale:"0.01",unit:"Hz"}},{type:"float",name:"power",ref:{value:"meterPower",extMeta:"0.0-163830.0",scale:"0.1",unit:"W"}},{type:"float",name:"current",ref:{value:"meterCurrent",extMeta:"0.0-65535.0",scale:"0.1",unit:"mA"}}]}};k.prototype.getIPEvtMap=function(){var a=this.getCommandStatusMap().status;return{ipevt:JSON.parse(JSON.stringify(a))}};k.prototype.executeCommand=function(a,b,c,d){if(c){var e=null;switch(c.value){case "on":case "ch4on":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,
  b,{address:4},{value:"on"});break;case "off":case "ch4off":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:4},{value:"off"});break;case "toggle":case "ch4toggle":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:4},{value:"toggle"});break;case "ch5on":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:5},{value:"on"});break;case "ch5off":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,
  b,{address:5},{value:"off"});break;case "ch5toggle":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:5},{value:"toggle"});break;case "ch6on":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:6},{value:"on"});break;case "ch6off":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:6},{value:"off"});break;case "ch6toggle":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:6},{value:"toggle"})}e?
  a._doRequestMarked(e,!0,{execute:function(a,b){setTimeout(function(){d&&d(a)},200)}}):d&&d(Error("invalid command"))}else d&&d(Error("command is null"))};k.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c);break;case "switchState":d=xnm.aio.hm.HmIPChannel.SWITCH_TRANSMITTER.buildStateScript(a,b,{address:3},{value:"switchTState"});break;case "ch4State":d=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildStateScript(a,
  b,{address:4},{value:"switchState"});break;case "ch5State":d=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:5},{value:"switchState"});break;case "ch6State":d=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:6},{value:"switchState"});break;case "meterVoltage":case "meterEnergyCounter":case "meterFrequency":case "meterPower":case "meterCurrent":d=xnm.aio.hm.HmIPChannel.ENERGIE_METER_TRANSMITTER.buildStateScript(a,b,{address:7},c)}return d};k.prototype.handleStatusResponse=
  function(a,b){if("?"==a)return a;switch(b.value){case "meterVoltage":case "meterEnergyCounter":case "meterFrequency":case "meterPower":case "meterCurrent":return xnm.aio.hm.HmIPChannel.ENERGIE_METER_TRANSMITTER.handleStatusResponse(a,b);case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "switchState":return xnm.aio.hm.HmIPChannel.SWITCH_TRANSMITTER.handleStatusResponse(a,{value:"switchTState"});case "ch4State":case "ch5State":case "ch6State":return xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.handleStatusResponse(a,
  {value:"switchState"});default:return"?"}};k.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(d){case "3":e=xnm.aio.hm.HmIPChannel.SWITCH_TRANSMITTER.resolveState(a,b,c);break;case "4":case "5":case "6":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.resolveState(a,b,c);e.key="4"==d?"ch4State":"5"==d?"ch5State":"ch6State";break;case "7":e=xnm.aio.hm.HmIPChannel.ENERGIE_METER_TRANSMITTER.resolveState(a,
  b,c)}return e};var n=function(){};n.prototype.getCommandStatusMap=function(){return{command:[{type:"enum",name:"on",ref:{value:"dimOn"}},{type:"enum",name:"off",ref:{value:"dimOff"}},{type:"int",name:"dim up",ref:{value:"dimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"dim down",ref:{value:"dimDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"dim to",ref:{value:"dimTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"int",name:"toggle to",ref:{value:"toggleTo",ext:"%d",extMeta:"0-100",
  unit:"%"}},{type:"enum",name:"ch.4 on",ref:{value:"ch4dimOn"}},{type:"enum",name:"ch.4 off",ref:{value:"ch4dimOff"}},{type:"int",name:"ch.4 dim up",ref:{value:"ch4dimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.4 dim down",ref:{value:"ch4dimDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.4 dim to",ref:{value:"ch4dimTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.4 toggle to",ref:{value:"ch4toggleTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"ch.5 on",
  ref:{value:"ch5dimOn"}},{type:"enum",name:"ch.5 off",ref:{value:"ch5dimOff"}},{type:"int",name:"ch.5 dim up",ref:{value:"ch5dimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.5 dim down",ref:{value:"ch5dimDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.5 dim to",ref:{value:"ch5dimTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.5 toggle to",ref:{value:"ch5toggleTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"ch.6 on",ref:{value:"ch6dimOn"}},{type:"enum",
  name:"ch.6 off",ref:{value:"ch6dimOff"}},{type:"int",name:"ch.6 dim up",ref:{value:"ch6dimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.6 dim down",ref:{value:"ch6dimDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.6 dim to",ref:{value:"ch6dimTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.6 toggle to",ref:{value:"ch6toggleTo",ext:"%d",extMeta:"0-100",unit:"%"}}],status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},
  {type:"int",name:"dimmer status",ref:{value:"dimmerTLevel",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.4 status",ref:{value:"ch4Level",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.5 status",ref:{value:"ch5Level",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.6 status",ref:{value:"ch6Level",extMeta:"0-100",unit:"%"}}]}};n.prototype.getIPEvtMap=function(){var a=this.getCommandStatusMap().status;return{ipevt:JSON.parse(JSON.stringify(a))}};n.prototype.executeCommand=function(a,b,c,d){if(c){var e=
  null;switch(c.value){case "dimOn":case "ch4dimOn":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:4},{value:"dimOn"});break;case "dimOff":case "ch4dimOff":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:4},{value:"dimOff"});break;case "dimUp":case "ch4dimUp":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:4},{value:"dimUp",ext:c.ext});break;case "dimDown":case "ch4dimDown":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,
  b,{address:4},{value:"dimDown",ext:c.ext});break;case "dimTo":case "ch4dimTo":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:4},{value:"dimTo",ext:c.ext});break;case "toggleTo":case "ch4toggleTo":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:4},{value:"toggleTo",ext:c.ext});break;case "ch5dimOn":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:5},{value:"dimOn"});break;case "ch5dimOff":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,
  b,{address:5},{value:"dimOff"});break;case "ch5dimUp":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:5},{value:"dimUp",ext:c.ext});break;case "ch5dimDown":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:5},{value:"dimDown",ext:c.ext});break;case "ch5dimTo":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:5},{value:"dimTo",ext:c.ext});break;case "ch5toggleTo":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,
  b,{address:5},{value:"toggleTo",ext:c.ext});break;case "ch6dimOn":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:6},{value:"dimOn"});break;case "ch6dimOff":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:6},{value:"dimOff"});break;case "ch6dimUp":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:6},{value:"dimUp",ext:c.ext});break;case "ch6dimDown":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,
  b,{address:6},{value:"dimDown",ext:c.ext});break;case "ch6dimTo":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:6},{value:"dimTo",ext:c.ext});break;case "ch6toggleTo":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:6},{value:"toggleTo",ext:c.ext})}e?a._doRequestMarked(e,!0,{execute:function(a,b){setTimeout(function(){d&&d(a)},200)}}):d&&d(Error("invalid command"))}else d&&d(Error("command is null"))};n.prototype.buildStateScript=function(a,
  b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c);break;case "dimmerTLevel":d=xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.buildStateScript(a,b,{address:3},{value:"dimmerTLevel"});break;case "ch4Level":d=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:4},{value:"dimmerLevel"});break;case "ch5Level":d=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:5},{value:"dimmerLevel"});
  break;case "ch6Level":d=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:6},{value:"dimmerLevel"})}return d};n.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "dimmerTLevel":return xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.handleStatusResponse(a,{value:"dimmerTLevel"});case "ch4Level":case "ch5Level":case "ch6Level":return xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.handleStatusResponse(a,
  {value:"dimmerLevel"});default:return"?"}};n.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(d){case "3":e=xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.resolveState(a,b,c);break;case "4":case "5":case "6":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.resolveState(a,b,c),e.key="4"==d?"ch4Level":"5"==d?"ch5Level":"ch6Level"}return e};var q=function(){};q.prototype.getCommandStatusMap=function(){return{status:[{type:"enum",
  name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBat",options:["false","true"]}}]}};q.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorLowbat",options:["false","true"]}},{type:"enum",name:"button 1 short press",ref:{value:"btn1pressShort",options:["true"]}},{type:"enum",name:"button 1 long press",
  ref:{value:"btn1pressLong",options:["true"]}},{type:"enum",name:"button 2 short press",ref:{value:"btn2pressShort",options:["true"]}},{type:"enum",name:"button 2 long press",ref:{value:"btn2pressLong",options:["true"]}}]}};q.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":case "errorBat":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c)}return d};q.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":case "errorBat":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,
  b);default:return"?"}};q.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(d){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case "1":case "2":e=xnm.aio.hm.HmIPChannel.KEY_TRANSCEIVER.resolveState(a,b,c),"pressShort"==e.key?e.key="1"==d?"btn1pressShort":"btn2pressShort":"pressLong"==e.key&&(e.key="1"==d?"btn1pressLong":"btn2pressLong")}return e};var p=function(){};
  p.prototype.getCommandStatusMap=function(){return{command:[{type:"multi",name:"trigger alarm",ref:{value:"alarmTrigger",ext:"%multi",extMeta:[{type:"enum",name:"set audio",ref:{value:"alarmAudio",ext:"%e",extMeta:"DISABLE_ACOUSTIC_SIGNAL FREQUENCY_RISING FREQUENCY_FALLING FREQUENCY_RISING_AND_FALLING FREQUENCY_ALTERNATING_LOW_HIGH FREQUENCY_ALTERNATING_LOW_MID_HIGH FREQUENCY_HIGHON_OFF FREQUENCY_HIGHON_LONGOFF FREQUENCY_LOWON_OFF_HIGHON_OFF FREQUENCY_LOWON_LONGOFF_HIGHON_LONGOFF LOW_BATTERY DISARMED INTERNALLY_ARMED EXTERNALLY_ARMED DELAYED_INTERNALLY_ARMED DELAYED_EXTERNALLY_ARMED EVENT ERROR".split(" ")}},
  {type:"enum",name:"set visual",ref:{value:"alarmVisual",ext:"%e",extMeta:"DISABLE_OPTICAL_SIGNAL BLINKING_ALTERNATELY_REPEATING BLINKING_BOTH_REPEATING DOUBLE_FLASHING_REPEATING FLASHING_BOTH_REPEATING CONFIRMATION_SIGNAL_0 CONFIRMATION_SIGNAL_1 CONFIRMATION_SIGNAL_2".split(" ")}},{type:"int",name:"set duration",ref:{value:"alarmDur",ext:"%d",extMeta:"0-16343"}},{type:"enum",name:"set duration unit",ref:{value:"alarmDurUnit",ext:"%e",extMeta:["S","M","H","D"]}}]}}],status:[{type:"enum",name:"communication error",
  ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBat",options:["false","true"]}},{type:"enum",name:"sabotage",ref:{value:"errorSabo",options:["false","true"]}},{type:"enum",name:"alarm state",ref:{value:"alarmState",options:["on","off"]}}]}};p.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorLowbat",options:["false",
  "true"]}},{type:"enum",name:"sabotage",ref:{value:"errorSabo",options:["false","true"]}},{type:"enum",name:"alarm state",ref:{value:"alarmState",options:["on","off"]}}]}};p.prototype.executeCommand=function(a,b,c,d){if(c){var e=null;switch(c.value){case "alarmTrigger":e=xnm.aio.hm.HmIPChannel.ALARM_SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:3},c)}e?a._doRequestMarked(e,!0,{execute:function(a,b){setTimeout(function(){d&&d(a)},200)}}):d&&d(Error("invalid command"))}else d&&d(Error("command is null"))};
  p.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":case "errorBat":case "errorSabo":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c);break;case "alarmState":d=xnm.aio.hm.HmIPChannel.ALARM_SWITCH_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:3},c)}return d};p.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":case "errorBat":case "errorSabo":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,
  b);case "alarmState":return xnm.aio.hm.HmIPChannel.ALARM_SWITCH_VIRTUAL_RECEIVER.handleStatusResponse(a,b);default:return"?"}};p.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;var e=null;switch(b.channel.substr(d+1)){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case "3":e=xnm.aio.hm.HmIPChannel.ALARM_SWITCH_VIRTUAL_RECEIVER.resolveState(a,b,c)}return e};var t=function(){};t.prototype.getCommandStatusMap=
  function(){return{command:[{type:"enum",name:"intrusion alarm off",ref:{value:"intrusionAlarmOff"}},{type:"enum",name:"intrusion alarm on",ref:{value:"intrusionAlarmOn"}}],status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBat",options:["false","true"]}},{type:"enum",name:"alarm state",ref:{value:"smokeState",options:["on","off"]}},{type:"enum",name:"alarm detail",ref:{value:"smokeAlarmDetail",options:["off",
  "primary_alarm","intrusion_alarm","secondary_alarm"]}}]}};t.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorLowbat",options:["false","true"]}},{type:"enum",name:"alarm state",ref:{value:"smokeState",options:["on","off"]}},{type:"enum",name:"alarm detail",ref:{value:"smokeAlarmDetail",options:["off","primary_alarm","intrusion_alarm","secondary_alarm"]}}]}};t.prototype.executeCommand=
  function(a,b,c,d){if(c){var e=null;switch(c.value){case "intrusionAlarmOff":case "intrusionAlarmOn":e=xnm.aio.hm.HmIPChannel.SMOKE_DETECTOR.buildCommandScript(a,b,{address:1},c)}e?a._doRequestMarked(e,!0,{execute:function(a){d&&d(a)}}):d&&d(Error("invalid command"))}else d&&d(Error("command is null"))};t.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":case "errorBat":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c);break;
  case "smokeState":d=xnm.aio.hm.HmIPChannel.SMOKE_DETECTOR.buildStateScript(a,b,{address:3},c)}return d};t.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":case "errorBat":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "smokeState":case "smokeAlarmDetail":return xnm.aio.hm.HmIPChannel.SMOKE_DETECTOR.handleStatusResponse(a,b);default:return"?"}};t.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");
  if(-1==d)return null;var e=null;switch(b.channel.substr(d+1)){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case "1":e=xnm.aio.hm.HmIPChannel.SMOKE_DETECTOR.resolveState(a,b,c)}return e};var r=function(){};r.prototype.getCommandStatusMap=function(){return{status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBat",options:["false","true"]}},{type:"enum",name:"sabotage",ref:{value:"errorSabo",
  options:["false","true"]}},{type:"enum",name:"window state",ref:{value:"handleState",options:["closed","tilted","open"]}}]}};r.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorLowbat",options:["false","true"]}},{type:"enum",name:"sabotage",ref:{value:"errorSabo",options:["false","true"]}},{type:"enum",name:"window state",ref:{value:"handleState",options:["closed",
  "tilted","open"]}}]}};r.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":case "errorBat":case "errorSabo":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c);break;case "handleState":d=xnm.aio.hm.HmIPChannel.ROTARY_HANDLE_TRANSCEIVER.buildStateScript(a,b,{address:1},c)}return d};r.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":case "errorBat":case "errorSabo":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,
  b);case "handleState":return xnm.aio.hm.HmIPChannel.ROTARY_HANDLE_TRANSCEIVER.handleStatusResponse(a,b);default:return"?"}};r.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;var e=null;switch(b.channel.substr(d+1)){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case "1":e=xnm.aio.hm.HmIPChannel.ROTARY_HANDLE_TRANSCEIVER.resolveState(a,b,c)}return e};var w=function(){};w.prototype.getCommandStatusMap=function(){return{command:[{type:"enum",
  name:"on",ref:{value:"on"}},{type:"enum",name:"off",ref:{value:"off"}},{type:"enum",name:"toggle",ref:{value:"toggle"}},{type:"enum",name:"ch.2 on",ref:{value:"ch2on"}},{type:"enum",name:"ch.2 off",ref:{value:"ch2off"}},{type:"enum",name:"ch.2 toggle",ref:{value:"ch2toggle"}},{type:"enum",name:"ch.3 on",ref:{value:"ch3on"}},{type:"enum",name:"ch.3 off",ref:{value:"ch3off"}},{type:"enum",name:"ch.3 toggle",ref:{value:"ch3toggle"}},{type:"enum",name:"ch.4 on",ref:{value:"ch4on"}},{type:"enum",name:"ch.4 off",
  ref:{value:"ch4off"}},{type:"enum",name:"ch.4 toggle",ref:{value:"ch4toggle"}}],status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"switch status",ref:{value:"switchState",options:["off","on"]}},{type:"enum",name:"ch.2 status",ref:{value:"ch2State",options:["off","on"]}},{type:"enum",name:"ch.3 status",ref:{value:"ch3State",options:["off","on"]}},{type:"enum",name:"ch.4 status",ref:{value:"ch4State",options:["off","on"]}},{type:"float",
  name:"voltage",ref:{value:"meterVoltage",extMeta:"0.0-409.5",scale:"0.1",unit:"V"}},{type:"float",name:"energy counter",ref:{value:"meterEnergyCounter",extMeta:"0.0-838859.1",scale:"0.1",unit:"Wh"}},{type:"float",name:"frequency",ref:{value:"meterFrequency",extMeta:"29.52-70.47",scale:"0.01",unit:"Hz"}},{type:"float",name:"power",ref:{value:"meterPower",extMeta:"0.0-163830.0",scale:"0.1",unit:"W"}},{type:"float",name:"current",ref:{value:"meterCurrent",extMeta:"0.0-65535.0",scale:"0.1",unit:"mA"}}]}};
  w.prototype.getIPEvtMap=function(){var a=this.getCommandStatusMap().status;return{ipevt:JSON.parse(JSON.stringify(a))}};w.prototype.executeCommand=function(a,b,c,d){if(c){var e=null,f=null;switch(c.value){case "on":case "ch2on":case "ch3on":case "ch4on":switch(c.value){case "on":case "ch2on":f=2;break;case "ch3on":f=3;break;case "ch4on":f=4}e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:f},{value:"on"});break;case "off":case "ch2off":case "ch3off":case "ch4off":switch(c.value){case "off":case "ch2off":f=
  2;break;case "ch3off":f=3;break;case "ch4off":f=4}e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:f},{value:"off"});break;case "toggle":case "ch2toggle":case "ch3toggle":case "ch4toggle":switch(c.value){case "toggle":case "ch2toggle":f=2;break;case "ch3toggle":f=3;break;case "ch4toggle":f=4}e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:f},{value:"toggle"})}e?a._doRequestMarked(e,!0,{execute:function(a,b){setTimeout(function(){d&&
  d(a)},200)}}):d&&d(Error("invalid command"))}else d&&d(Error("command is null"))};w.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c);break;case "switchState":d=xnm.aio.hm.HmIPChannel.SWITCH_TRANSMITTER.buildStateScript(a,b,{address:1},{value:"switchTState"});break;case "ch2State":d=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:2},{value:"switchState"});
  break;case "ch3State":d=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:3},{value:"switchState"});break;case "ch4State":d=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:4},{value:"switchState"});break;case "meterVoltage":case "meterEnergyCounter":case "meterFrequency":case "meterPower":case "meterCurrent":d=xnm.aio.hm.HmIPChannel.ENERGIE_METER_TRANSMITTER.buildStateScript(a,b,{address:5},c)}return d};w.prototype.handleStatusResponse=function(a,
  b){if("?"==a)return a;switch(b.value){case "meterVoltage":case "meterEnergyCounter":case "meterFrequency":case "meterPower":case "meterCurrent":return xnm.aio.hm.HmIPChannel.ENERGIE_METER_TRANSMITTER.handleStatusResponse(a,b);case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "switchState":return xnm.aio.hm.HmIPChannel.SWITCH_TRANSMITTER.handleStatusResponse(a,{value:"switchTState"});case "ch2State":case "ch3State":case "ch4State":return xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.handleStatusResponse(a,
  {value:"switchState"});default:return"?"}};w.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(d){case "1":e=xnm.aio.hm.HmIPChannel.SWITCH_TRANSMITTER.resolveState(a,b,c);break;case "2":case "3":case "4":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.resolveState(a,b,c);e.key="2"==d?"ch2State":"3"==d?"ch3State":"ch4State";break;case "5":e=xnm.aio.hm.HmIPChannel.ENERGIE_METER_TRANSMITTER.resolveState(a,
  b,c)}return e};var u=function(){};u.prototype.getCommandStatusMap=function(){return{command:[{type:"enum",name:"on",ref:{value:"dimOn"}},{type:"enum",name:"off",ref:{value:"dimOff"}},{type:"int",name:"dim up",ref:{value:"dimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"dim down",ref:{value:"dimDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"dim to",ref:{value:"dimTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"int",name:"toggle to",ref:{value:"toggleTo",ext:"%d",extMeta:"0-100",
  unit:"%"}},{type:"enum",name:"ch.3 on",ref:{value:"ch3dimOn"}},{type:"enum",name:"ch.3 off",ref:{value:"ch3dimOff"}},{type:"int",name:"ch.3 dim up",ref:{value:"ch3dimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.3 dim down",ref:{value:"ch3dimDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.3 dim to",ref:{value:"ch3dimTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.3 toggle to",ref:{value:"ch3toggleTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"ch.4 on",
  ref:{value:"ch4dimOn"}},{type:"enum",name:"ch.4 off",ref:{value:"ch4dimOff"}},{type:"int",name:"ch.4 dim up",ref:{value:"ch4dimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.4 dim down",ref:{value:"ch4dimDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.4 dim to",ref:{value:"ch4dimTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.4 toggle to",ref:{value:"ch4toggleTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"ch.5 on",ref:{value:"ch5dimOn"}},{type:"enum",
  name:"ch.5 off",ref:{value:"ch5dimOff"}},{type:"int",name:"ch.5 dim up",ref:{value:"ch5dimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.5 dim down",ref:{value:"ch5dimDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.5 dim to",ref:{value:"ch5dimTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.5 toggle to",ref:{value:"ch5toggleTo",ext:"%d",extMeta:"0-100",unit:"%"}}],status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},
  {type:"int",name:"dimmer status",ref:{value:"dimmerTLevel",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.3 status",ref:{value:"ch3Level",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.4 status",ref:{value:"ch4Level",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.5 status",ref:{value:"ch5Level",extMeta:"0-100",unit:"%"}}]}};u.prototype.getIPEvtMap=function(){var a=this.getCommandStatusMap().status;return{ipevt:JSON.parse(JSON.stringify(a))}};u.prototype.executeCommand=function(a,b,c,d){if(c){var e=
  null,f=null;switch(c.value){case "dimOn":case "ch3dimOn":case "ch4dimOn":case "ch5dimOn":switch(c.value){case "dimOn":case "ch3dimOn":f=3;break;case "ch4dimOn":f=4;break;case "ch5dimOn":f=5}e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:f},{value:"dimOn"});break;case "dimOff":case "ch3dimOff":case "ch4dimOff":case "ch5dimOff":switch(c.value){case "dimOff":case "ch3dimOff":f=3;break;case "ch4dimOff":f=4;break;case "ch5dimOff":f=5}e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,
  b,{address:f},{value:"dimOff"});break;case "dimUp":case "ch3dimUp":case "ch4dimUp":case "ch5dimUp":switch(c.value){case "dimUp":case "ch3dimUp":f=3;break;case "ch4dimUp":f=4;break;case "ch5dimUp":f=5}e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:f},{value:"dimUp",ext:c.ext});break;case "dimDown":case "ch3dimDown":case "ch4dimDown":case "ch5dimDown":switch(c.value){case "dimDown":case "ch3dimDown":f=3;break;case "ch4dimDown":f=4;break;case "ch5dimDown":f=5}e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,
  b,{address:f},{value:"dimDown",ext:c.ext});break;case "dimTo":case "ch3dimTo":case "ch4dimTo":case "ch5dimTo":switch(c.value){case "dimTo":case "ch3dimTo":f=3;break;case "ch4dimTo":f=4;break;case "ch5dimTo":f=5}e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:f},{value:"dimTo",ext:c.ext});break;case "toggleTo":case "ch3toggleTo":case "ch4toggleTo":case "ch5toggleTo":switch(c.value){case "toggleTo":case "ch3toggleTo":f=3;break;case "ch4toggleTo":f=4;break;case "ch5toggleTo":f=
  5}e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:f},{value:"toggleTo",ext:c.ext})}e?a._doRequestMarked(e,!0,{execute:function(a,b){setTimeout(function(){d&&d(a)},200)}}):d&&d(Error("invalid command"))}else d&&d(Error("command is null"))};u.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c);break;case "dimmerTLevel":d=xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.buildStateScript(a,
  b,{address:2},{value:"dimmerTLevel"});break;case "ch3Level":d=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:3},{value:"dimmerLevel"});break;case "ch4Level":d=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:4},{value:"dimmerLevel"});break;case "ch5Level":d=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:5},{value:"dimmerLevel"})}return d};u.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,
  b);case "dimmerTLevel":return xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.handleStatusResponse(a,{value:"dimmerTLevel"});case "ch3Level":case "ch4Level":case "ch5Level":return xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.handleStatusResponse(a,{value:"dimmerLevel"});default:return"?"}};u.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(d){case "2":e=xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.resolveState(a,
  b,c);break;case "3":case "4":case "5":e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.resolveState(a,b,c),e.key="3"==d?"ch3Level":"4"==d?"ch4Level":"ch5Level"}return e};var m=function(){};m.prototype.getCommandStatusMap=function(){return{command:[{type:"enum",name:"stop",ref:{value:"stop"}},{type:"enum",name:"move up",ref:{value:"moveUp"}},{type:"enum",name:"move down",ref:{value:"moveDown"}},{type:"int",name:"step up",ref:{value:"stepUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"step down",
  ref:{value:"stepDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"move to",ref:{value:"moveTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"ch.4 stop",ref:{value:"ch4stop"}},{type:"enum",name:"ch.4 move up",ref:{value:"ch4moveUp"}},{type:"enum",name:"ch.4 move down",ref:{value:"ch4moveDown"}},{type:"int",name:"ch.4 step up",ref:{value:"ch4stepUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.4 step down",ref:{value:"ch4stepDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",
  name:"ch.4 move to",ref:{value:"ch4moveTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"ch.5 stop",ref:{value:"ch5stop"}},{type:"enum",name:"ch.5 move up",ref:{value:"ch5moveUp"}},{type:"enum",name:"ch.5 move down",ref:{value:"ch5moveDown"}},{type:"int",name:"ch.5 step up",ref:{value:"ch5stepUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.5 step down",ref:{value:"ch5stepDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.5 move to",ref:{value:"ch5moveTo",ext:"%d",
  extMeta:"0-100",unit:"%"}},{type:"enum",name:"ch.6 stop",ref:{value:"ch6stop"}},{type:"enum",name:"ch.6 move up",ref:{value:"ch6moveUp"}},{type:"enum",name:"ch.6 move down",ref:{value:"ch6moveDown"}},{type:"int",name:"ch.6 step up",ref:{value:"ch6stepUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.6 step down",ref:{value:"ch6stepDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.6 move to",ref:{value:"ch6moveTo",ext:"%d",extMeta:"0-100",unit:"%"}}],status:[{type:"enum",name:"communication error",
  ref:{value:"errorComm",options:["false","true"]}},{type:"int",name:"blind status",ref:{value:"blindTLevel",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.4 status",ref:{value:"ch4Level",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.5 status",ref:{value:"ch5Level",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.6 status",ref:{value:"ch6Level",extMeta:"0-100",unit:"%"}}]}};m.prototype.getIPEvtMap=function(){var a=this.getCommandStatusMap().status;a=JSON.parse(JSON.stringify(a));a=a.concat([{type:"enum",
  name:"button 1 short press",ref:{value:"btn1pressShort",options:["true"]}},{type:"enum",name:"button 1 long press",ref:{value:"btn1pressLong",options:["true"]}},{type:"enum",name:"button 2 short press",ref:{value:"btn2pressShort",options:["true"]}},{type:"enum",name:"button 2 long press",ref:{value:"btn2pressLong",options:["true"]}}]);return{ipevt:a}};m.prototype.executeCommand=function(a,b,c,d){if(c){var e=null;e=4;var f=null;-1!=c.value.indexOf("ch5")?e=5:-1!=c.value.indexOf("ch6")&&(e=6);-1!=c.value.indexOf("stop")?
  f="stop":-1!=c.value.indexOf("moveUp")?f="moveUp":-1!=c.value.indexOf("moveDown")?f="moveDown":-1!=c.value.indexOf("stepUp")?f="stepUp":-1!=c.value.indexOf("stepDown")?f="stepDown":-1!=c.value.indexOf("moveTo")&&(f="moveTo");f?(e=xnm.aio.hm.HmIPChannel.SHUTTER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:e},{value:f,ext:c.ext}))?a._doRequestMarked(e,!0,{execute:function(a,b){setTimeout(function(){d&&d(a)},200)}}):d&&d(Error("invalid command")):d&&d(Error("unknown command"))}else d&&d(Error("command is null"))};
  m.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c);break;case "blindTLevel":d=xnm.aio.hm.HmIPChannel.SHUTTER_TRANSMITTER.buildStateScript(a,b,{address:3},{value:"blindTLevel"});break;case "ch4Level":d=xnm.aio.hm.HmIPChannel.SHUTTER_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:4},{value:"blindLevel"});break;case "ch5Level":d=xnm.aio.hm.HmIPChannel.SHUTTER_VIRTUAL_RECEIVER.buildStateScript(a,
  b,{address:5},{value:"blindLevel"});break;case "ch6Level":d=xnm.aio.hm.HmIPChannel.SHUTTER_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:6},{value:"blindLevel"})}return d};m.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "blindTLevel":return xnm.aio.hm.HmIPChannel.SHUTTER_TRANSMITTER.handleStatusResponse(a,{value:"blindTLevel"});case "ch4Level":case "ch5Level":case "ch6Level":return xnm.aio.hm.HmIPChannel.SHUTTER_VIRTUAL_RECEIVER.handleStatusResponse(a,
  {value:"blindLevel"});default:return"?"}};m.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(d){case "1":case "2":if(e=xnm.aio.hm.HmIPChannel.KEY_TRANSCEIVER.resolveState(a,b,c))"pressShort"==e.key?e.key="btn"+d+"pressShort":"pressLong"==e.key&&(e.key="btn"+d+"pressLong");break;case "3":e=xnm.aio.hm.HmIPChannel.SHUTTER_TRANSMITTER.resolveState(a,b,c);break;case "4":case "5":case "6":if(e=
  xnm.aio.hm.HmIPChannel.SHUTTER_VIRTUAL_RECEIVER.resolveState(a,b,c))e.key="4"==d?"ch4Level":"5"==d?"ch5Level":"ch6Level"}return e};var y=function(){};y.prototype.getCommandStatusMap=function(){return{command:[{type:"enum",name:"stop",ref:{value:"stop"}},{type:"enum",name:"move up",ref:{value:"moveUp"}},{type:"enum",name:"move down",ref:{value:"moveDown"}},{type:"int",name:"step up",ref:{value:"stepUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"step down",ref:{value:"stepDown",ext:"%d",
  extMeta:"1-100",unit:"%"}},{type:"int",name:"move to",ref:{value:"moveTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"lamella up",ref:{value:"lamellaUp"}},{type:"enum",name:"lamella down",ref:{value:"lamellaDown"}},{type:"int",name:"lamella step up",ref:{value:"lamellaStepUp",ext:"%d",extMeta:"1-10",unit:"%"}},{type:"int",name:"lamella step down",ref:{value:"lamellaStepDown",ext:"%d",extMeta:"1-10",unit:"%"}},{type:"int",name:"lamella to",ref:{value:"lamellaTo",ext:"%d",extMeta:"0-100",
  unit:"%"}},{type:"enum",name:"ch.4 stop",ref:{value:"ch4stop"}},{type:"enum",name:"ch.4 move up",ref:{value:"ch4moveUp"}},{type:"enum",name:"ch.4 move down",ref:{value:"ch4moveDown"}},{type:"int",name:"ch.4 step up",ref:{value:"ch4stepUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.4 step down",ref:{value:"ch4stepDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.4 move to",ref:{value:"ch4moveTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"ch.4 lamella up",ref:{value:"ch4lamellaUp"}},
  {type:"enum",name:"ch.4 lamella down",ref:{value:"ch4lamellaDown"}},{type:"int",name:"ch.4 lamella step up",ref:{value:"ch4lamellaStepUp",ext:"%d",extMeta:"1-10",unit:"%"}},{type:"int",name:"ch.4 lamella step down",ref:{value:"ch4lamellaStepDown",ext:"%d",extMeta:"1-10",unit:"%"}},{type:"int",name:"ch.4 lamella to",ref:{value:"ch4lamellaTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"ch.5 stop",ref:{value:"ch5stop"}},{type:"enum",name:"ch.5 move up",ref:{value:"ch5moveUp"}},{type:"enum",
  name:"ch.5 move down",ref:{value:"ch5moveDown"}},{type:"int",name:"ch.5 step up",ref:{value:"ch5stepUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.5 step down",ref:{value:"ch5stepDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.5 move to",ref:{value:"ch5moveTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"ch.5 lamella up",ref:{value:"ch5lamellaUp"}},{type:"enum",name:"ch.5 lamella down",ref:{value:"ch5lamellaDown"}},{type:"int",name:"ch.5 lamella step up",ref:{value:"ch5lamellaStepUp",
  ext:"%d",extMeta:"1-10",unit:"%"}},{type:"int",name:"ch.5 lamella step down",ref:{value:"ch5lamellaStepDown",ext:"%d",extMeta:"1-10",unit:"%"}},{type:"int",name:"ch.5 lamella to",ref:{value:"ch5lamellaTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"ch.6 stop",ref:{value:"ch6stop"}},{type:"enum",name:"ch.6 move up",ref:{value:"ch6moveUp"}},{type:"enum",name:"ch.6 move down",ref:{value:"ch6moveDown"}},{type:"int",name:"ch.6 step up",ref:{value:"ch6stepUp",ext:"%d",extMeta:"1-100",unit:"%"}},
  {type:"int",name:"ch.6 step down",ref:{value:"ch6stepDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"ch.6 move to",ref:{value:"ch6moveTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"ch.6 lamella up",ref:{value:"ch6lamellaUp"}},{type:"enum",name:"ch.6 lamella down",ref:{value:"ch6lamellaDown"}},{type:"int",name:"ch.6 lamella step up",ref:{value:"ch6lamellaStepUp",ext:"%d",extMeta:"1-10",unit:"%"}},{type:"int",name:"ch.6 lamella step down",ref:{value:"ch6lamellaStepDown",ext:"%d",
  extMeta:"1-10",unit:"%"}},{type:"int",name:"ch.6 lamella to",ref:{value:"ch6lamellaTo",ext:"%d",extMeta:"0-100",unit:"%"}}],status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"int",name:"blind status",ref:{value:"blindTPos",extMeta:"0-100",unit:"%"}},{type:"int",name:"lamella status",ref:{value:"lamellaTPos",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.4 blind status",ref:{value:"ch4blindPos",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.4 lamella status",
  ref:{value:"ch4lamellaPos",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.5 blind status",ref:{value:"ch5blindPos",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.5 lamella status",ref:{value:"ch5lamellaPos",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.6 blind status",ref:{value:"ch6blindPos",extMeta:"0-100",unit:"%"}},{type:"int",name:"ch.6 lamella status",ref:{value:"ch6lamellaPos",extMeta:"0-100",unit:"%"}}]}};y.prototype.getIPEvtMap=function(){var a=this.getCommandStatusMap().status;a=JSON.parse(JSON.stringify(a));
  a=a.concat([{type:"enum",name:"button 1 short press",ref:{value:"btn1pressShort",options:["true"]}},{type:"enum",name:"button 1 long press",ref:{value:"btn1pressLong",options:["true"]}},{type:"enum",name:"button 2 short press",ref:{value:"btn2pressShort",options:["true"]}},{type:"enum",name:"button 2 long press",ref:{value:"btn2pressLong",options:["true"]}}]);return{ipevt:a}};y.prototype.executeCommand=function(a,b,c,d){if(c){var e=4,f=null;-1!=c.value.indexOf("ch5")?e=5:-1!=c.value.indexOf("ch6")&&
  (e=6);-1!=c.value.indexOf("stop")?f="stop":-1!=c.value.indexOf("moveUp")?f="moveUp":-1!=c.value.indexOf("moveDown")?f="moveDown":-1!=c.value.indexOf("stepUp")?f="stepUp":-1!=c.value.indexOf("stepDown")?f="stepDown":-1!=c.value.indexOf("moveTo")?f="moveTo":-1!=c.value.indexOf("lamellaUp")?f="lamellaUp":-1!=c.value.indexOf("lamellaDown")?f="lamellaDown":-1!=c.value.indexOf("lamellaStepUp")?f="lamellaStepUp":-1!=c.value.indexOf("lamellaStepDown")?f="lamellaStepDown":-1!=c.value.indexOf("lamellaTo")&&
  (f="lamellaTo");f?(b=xnm.aio.hm.HmIPChannel.BLIND_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:e,stateAddress:3},{value:f,ext:c.ext}))?a._doRequestMarked(b,!0,{execute:function(a,b){setTimeout(function(){d&&d(a)},200)}}):d&&d(Error("invalid command")):d&&d(Error("unknown command"))}else d&&d(Error("command is null"))};y.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},
  c);break;case "blindTPos":d=xnm.aio.hm.HmIPChannel.BLIND_TRANSMITTER.buildStateScript(a,b,{address:3},{value:"blindTPos"});break;case "lamellaTPos":d=xnm.aio.hm.HmIPChannel.BLIND_TRANSMITTER.buildStateScript(a,b,{address:3},{value:"lamellaTPos"});break;case "ch4blindPos":d=xnm.aio.hm.HmIPChannel.BLIND_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:4},{value:"blindPos"});break;case "ch4lamellaPos":d=xnm.aio.hm.HmIPChannel.BLIND_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:4},{value:"lamellaPos"});
  break;case "ch5blindPos":d=xnm.aio.hm.HmIPChannel.BLIND_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:5},{value:"blindPos"});break;case "ch5lamellaPos":d=xnm.aio.hm.HmIPChannel.BLIND_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:5},{value:"lamellaPos"});break;case "ch6blindPos":d=xnm.aio.hm.HmIPChannel.BLIND_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:6},{value:"blindPos"});break;case "ch6lamellaPos":d=xnm.aio.hm.HmIPChannel.BLIND_VIRTUAL_RECEIVER.buildStateScript(a,b,{address:6},{value:"lamellaPos"})}return d};
  y.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "blindTPos":return xnm.aio.hm.HmIPChannel.BLIND_TRANSMITTER.handleStatusResponse(a,{value:"blindTPos"});case "lamellaTPos":return xnm.aio.hm.HmIPChannel.BLIND_TRANSMITTER.handleStatusResponse(a,{value:"lamellaTPos"});case "ch4blindPos":case "ch5blindPos":case "ch6blindPos":return xnm.aio.hm.HmIPChannel.BLIND_VIRTUAL_RECEIVER.handleStatusResponse(a,
  {value:"blindPos"});case "ch4lamellaPos":case "ch5lamellaPos":case "ch6lamellaPos":return xnm.aio.hm.HmIPChannel.BLIND_VIRTUAL_RECEIVER.handleStatusResponse(a,{value:"lamellaPos"});default:return"?"}};y.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(d){case "1":case "2":if(e=xnm.aio.hm.HmIPChannel.KEY_TRANSCEIVER.resolveState(a,b,c))"pressShort"==e.key?e.key="btn"+d+"pressShort":"pressLong"==
  e.key&&(e.key="btn"+d+"pressLong");break;case "3":e=xnm.aio.hm.HmIPChannel.BLIND_TRANSMITTER.resolveState(a,b,c);break;case "4":case "5":case "6":if(e=xnm.aio.hm.HmIPChannel.BLIND_VIRTUAL_RECEIVER.resolveState(a,b,c))"LEVEL"==b.datapoint?e.key="4"==d?"ch4blindPos":"5"==d?"ch5blindPos":"ch6blindPos":"LEVEL_2"==b.datapoint&&(e.key="4"==d?"ch4lamellaPos":"5"==d?"ch5lamellaPos":"ch6lamellaPos")}return e};var C=function(){};C.prototype.getCommandStatusMap=function(){return{status:[{type:"enum",name:"communication error",
  ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBat",options:["false","true"]}}]}};C.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorLowbat",options:["false","true"]}},{type:"enum",name:"button 1 short press",ref:{value:"btn1pressShort",options:["true"]}},{type:"enum",name:"button 1 long press",ref:{value:"btn1pressLong",
  options:["true"]}},{type:"enum",name:"button 2 short press",ref:{value:"btn2pressShort",options:["true"]}},{type:"enum",name:"button 2 long press",ref:{value:"btn2pressLong",options:["true"]}},{type:"enum",name:"button 3 short press",ref:{value:"btn3pressShort",options:["true"]}},{type:"enum",name:"button 3 long press",ref:{value:"btn3pressLong",options:["true"]}},{type:"enum",name:"button 4 short press",ref:{value:"btn4pressShort",options:["true"]}},{type:"enum",name:"button 4 long press",ref:{value:"btn4pressLong",
  options:["true"]}},{type:"enum",name:"button 5 short press",ref:{value:"btn5pressShort",options:["true"]}},{type:"enum",name:"button 5 long press",ref:{value:"btn5pressLong",options:["true"]}},{type:"enum",name:"button 6 short press",ref:{value:"btn6pressShort",options:["true"]}},{type:"enum",name:"button 6 long press",ref:{value:"btn6pressLong",options:["true"]}}]}};C.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":case "errorBat":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,
  b,{address:0},c)}return d};C.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":case "errorBat":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);default:return"?"}};C.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(d){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case "1":case "2":case "3":case "4":case "5":case "6":e=
  xnm.aio.hm.HmIPChannel.KEY_TRANSCEIVER.resolveState(a,b,c),"pressShort"==e.key?e.key="btn"+d+"pressShort":"pressLong"==e.key&&(e.key="btn"+d+"pressLong")}return e};var D=function(){};D.prototype.getCommandStatusMap=function(){return{status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBat",options:["false","true"]}},{type:"enum",name:"passages detected",ref:{value:"passageCurrentDirection",options:["right_to_left",
  "left_to_right"]}},{type:"enum",name:"previous passage",ref:{value:"passageLastDirection",options:["right_to_left","left_to_right"]}},{type:"int",name:"passage count from left to right",ref:{value:"passageL2RC",extMeta:"0-127"}},{type:"enum",name:"passage count overflow from left to right",ref:{value:"passageL2RCOF",options:["false","true"]}},{type:"int",name:"passage count from right to left",ref:{value:"passageR2LC",extMeta:"0-127"}},{type:"enum",name:"passage count overflow from right to left",
  ref:{value:"passageR2LCOF",options:["false","true"]}}]}};D.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBat",options:["false","true"]}},{type:"enum",name:"passages detected",ref:{value:"passageCurrentDirection",options:["right_to_left","left_to_right"]}},{type:"enum",name:"previous passage",ref:{value:"passageLastDirection",options:["right_to_left","left_to_right"]}},
  {type:"int",name:"passage count from left to right",ref:{value:"passageL2RC",extMeta:"0-127"}},{type:"enum",name:"passage count overflow from left to right",ref:{value:"passageL2RCOF",options:["false","true"]}},{type:"int",name:"passage count from right to left",ref:{value:"passageR2LC",extMeta:"0-127"}},{type:"enum",name:"passage count overflow from right to left",ref:{value:"passageR2LCOF",options:["false","true"]}}]}};D.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":case "errorBat":d=
  xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c);break;case "passageCurrentDirection":d=xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.buildStateScript(a,b,{address:2},{value:"passageCurrentDirection"});break;case "passageLastDirection":d=xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.buildStateScript(a,b,{address:2},{value:"passageLastDirection"});break;case "passageR2LCurrent":d=xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.buildStateScript(a,
  b,{address:2},{value:"passageCurrent"});break;case "passageR2LLast":d=xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.buildStateScript(a,b,{address:2},{value:"passageLast"});break;case "passageR2LC":d=xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.buildStateScript(a,b,{address:2},{value:"passageC"});break;case "passageR2LCOF":d=xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.buildStateScript(a,b,{address:2},{value:"passageCOF"});break;case "passageL2RCurrent":d=
  xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.buildStateScript(a,b,{address:3},{value:"passageCurrent"});break;case "passageL2RLast":d=xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.buildStateScript(a,b,{address:3},{value:"passageLast"});break;case "passageL2RC":d=xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.buildStateScript(a,b,{address:3},{value:"passageC"});break;case "passageL2RCOF":d=xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.buildStateScript(a,
  b,{address:3},{value:"passageCOF"})}return d};D.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":case "errorBat":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "passageCurrentDirection":case "passageLastDirection":return xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.handleStatusResponse(a,b);case "passageR2LCurrent":case "passageL2RCurrent":return xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.handleStatusResponse(a,
  {value:"passageCurrent"});case "passageR2LLast":case "passageL2RLast":return xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.handleStatusResponse(a,{value:"passageLast"});case "passageR2LC":case "passageL2RC":return xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.handleStatusResponse(a,{value:"passageC"});case "passageL2RCOF":case "passageR2LCOF":return xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.handleStatusResponse(a,{value:"passageCOF"});default:return"?"}};
  D.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(d){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case "2":case "3":e=xnm.aio.hm.HmIPChannel.PASSAGE_DETECTOR_DIRECTION_TRANSMITTER.resolveState(a,b,c),"passageCurrentDirection"==e.key?e.key="passageCurrentDirection":"passageLastDirection"==e.key?e.key="passageLastDirection":"passageC"==e.key?e.key="2"==d?"passageR2LC":
  "passageL2RC":"passageCOF"==e.key&&(e.key="2"==d?"passageR2LCOF":"passageL2RCOF")}return e};var E=function(){};E.prototype.getCommandStatusMap=function(){return{status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBat",options:["false","true"]}},{type:"enum",name:"alarm state",ref:{value:"waterAlarmState",options:["on","off"]}},{type:"enum",name:"moisture detected",ref:{value:"waterMoistureDetected",options:["true",
  "false"]}},{type:"enum",name:"water detected",ref:{value:"waterWaterDetected",options:["true","false"]}}]}};E.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBat",options:["false","true"]}},{type:"enum",name:"alarm state",ref:{value:"waterAlarmState",options:["on","off"]}},{type:"enum",name:"moisture detected",ref:{value:"waterMoistureDetected",options:["true",
  "false"]}},{type:"enum",name:"water detected",ref:{value:"waterWaterDetected",options:["true","false"]}}]}};E.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":case "errorBat":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c);break;case "waterAlarmState":d=xnm.aio.hm.HmIPChannel.WATER_DETECTION_TRANSMITTER.buildStateScript(a,b,{address:1},{value:"waterAlarmState"});break;case "waterMoistureDetected":d=xnm.aio.hm.HmIPChannel.WATER_DETECTION_TRANSMITTER.buildStateScript(a,
  b,{address:1},{value:"waterMoistureDetected"});break;case "waterWaterDetected":d=xnm.aio.hm.HmIPChannel.WATER_DETECTION_TRANSMITTER.buildStateScript(a,b,{address:1},{value:"waterWaterDetected"})}return d};E.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":case "errorBat":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "waterAlarmState":case "waterMoistureDetected":case "waterWaterDetected":return xnm.aio.hm.HmIPChannel.WATER_DETECTION_TRANSMITTER.handleStatusResponse(a,
  b);default:return"?"}};E.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;var e=null;switch(b.channel.substr(d+1)){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case "1":e=xnm.aio.hm.HmIPChannel.WATER_DETECTION_TRANSMITTER.resolveState(a,b,c)}return e};var F=function(){};F.prototype.getCommandStatusMap=function(){return{status:[{type:"enum",name:"duty cycle error",ref:{value:"errorBatElDutyCycle",options:["false",
  "true"]}},{type:"int",name:"error code",ref:{value:"errorBatElCode",ext:"%d",extMeta:"0-255"}},{type:"enum",name:"battery low",ref:{value:"errorBatElBat",options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorBatElVoltage",ext:"%f",extMeta:"0-25.2"}},{type:"enum",name:"sensor error",ref:{value:"errorBatElSensor",options:["false","true"]}},{type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"enum",name:"motion",ref:{value:"acceMotion",
  options:["false","true"]}}]}};F.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"duty cycle error",ref:{value:"errorBatElDutyCycle",options:["false","true"]}},{type:"int",name:"error code",ref:{value:"errorBatElCode",ext:"%d",extMeta:"0-255"}},{type:"enum",name:"battery low",ref:{value:"errorBatElBat",options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorBatElVoltage",ext:"%f",extMeta:"0-25.2"}},{type:"enum",name:"sensor error",ref:{value:"errorBatElSensor",
  options:["false","true"]}},{type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"enum",name:"motion",ref:{value:"acceMotion",options:["false","true"]}}]}};F.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorBatElDutyCycle":case "errorBatElCode":case "errorBatElBat":case "errorBatElVoltage":case "errorBatElSensor":case "errorBatElComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.buildStateScript(a,b,{address:0},
  c);break;case "acceMotion":d=xnm.aio.hm.HmIPChannel.ROTARY_HANDLE_TRANSCEIVER.buildStateScript(a,b,{address:1},c)}return d};F.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorBatElDutyCycle":case "errorBatElCode":case "errorBatElBat":case "errorBatElVoltage":case "errorBatElSensor":case "errorBatElComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.handleStatusResponse(a,b);case "acceMotion":return xnm.aio.hm.HmIPChannel.ACCELERATION_TRANSCEIVER.handleStatusResponse(a,
  b);default:return"?"}};F.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;var e=null;switch(b.channel.substr(d+1)){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case "1":e=xnm.aio.hm.HmIPChannel.ACCELERATION_TRANSCEIVER.resolveState(a,b,c)}return e};var A=function(){};A.prototype.getCommandStatusMap=function(){return{command:[{type:"enum",name:"on",ref:{value:"on"}},{type:"float",name:"on for",ref:{value:"onFor",
  ext:"%f",unit:"s"}}],status:[{type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBatElBat",options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorBatElVoltage",ext:"%f",extMeta:"0.0-25.2"}}]}};A.prototype.getIPEvtMap=function(){var a=this.getCommandStatusMap().status;a=JSON.parse(JSON.stringify(a));a.push({type:"enum",name:"button short press",ref:{value:"btnPressShort",options:["true"]}});
  a.push({type:"enum",name:"button long press",ref:{value:"btnPressLong",options:["true"]}});return{ipevt:a}};A.prototype.executeCommand=function(a,b,c,d){if(c){var e=null;switch(c.value){case "on":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:3},{value:"onFor",ext:.5});break;case "onFor":e=xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:3},c);break;default:d&&d(Error("unknown command"));return}e?a._doRequestMarked(e,!0,{execute:function(a,
  b){d&&d(a)}}):d&&d(Error("invalid command"))}else d&&d(Error("command is null"))};A.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorBatElComm":case "errorBatElBat":case "errorBatElVoltage":d=xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.buildStateScript(a,b,{address:0},c)}return d};A.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorBatElComm":case "errorBatElBat":case "errorBatElVoltage":return xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.handleStatusResponse(a,
  b);default:return"?"}};A.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;var e=null;switch(b.channel.substr(d+1)){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.resolveState(a,b,c);break;case "1":e=xnm.aio.hm.HmIPChannel.KEY_TRANSCEIVER.resolveState(a,b,c),"pressShort"==e.key?e.key="btnPressShort":"pressLong"==e.key&&(e.key="btnPressLong")}return e};var B=function(){};B.prototype.getCommandStatusMap=function(){return{command:[{type:"enum",
  name:"on",ref:{value:"on"}},{type:"enum",name:"off",ref:{value:"off"}},{type:"enum",name:"toggle",ref:{value:"toggle"}},{type:"enum",name:"led 1 on",ref:{value:"led1On"}},{type:"enum",name:"led 1 off",ref:{value:"led1Off"}},{type:"int",name:"led 1 dim up",ref:{value:"led1DimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"led 1 dim down",ref:{value:"led1DimDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"led 1 dim to",ref:{value:"led1DimTo",ext:"%d",extMeta:"0-100",unit:"%"}},
  {type:"int",name:"led 1 toggle to",ref:{value:"led1ToggleTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"led 1 color",ref:{value:"led1Color",ext:"%e",extMeta:"off blue green torqoise red purple yellow white".split(" ")}},{type:"enum",name:"led 2 on",ref:{value:"led2On"}},{type:"enum",name:"led 2 off",ref:{value:"led2Off"}},{type:"int",name:"led 2 dim up",ref:{value:"led2DimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"led 2 dim down",ref:{value:"led2DimDown",ext:"%d",extMeta:"1-100",
  unit:"%"}},{type:"int",name:"led 2 dim to",ref:{value:"led2DimTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"int",name:"led 2 toggle to",ref:{value:"led2ToggleTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"led 2 color",ref:{value:"led2Color",ext:"%e",extMeta:"off blue green torqoise red purple yellow white".split(" ")}}],status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"switch status",ref:{value:"switchState",options:["off",
  "on"]}},{type:"int",name:"led 1 status",ref:{value:"led1Level",extMeta:"0-100",unit:"%"}},{type:"enum",name:"led 1 color",ref:{value:"led1Color",options:"off blue green torqoise red purple yellow white".split(" ")}},{type:"int",name:"led 2 status",ref:{value:"led2Level",extMeta:"0-100",unit:"%"}},{type:"enum",name:"led 2 color",ref:{value:"led2Color",options:"off blue green torqoise red purple yellow white".split(" ")}}]}};B.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"communication error",
  ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"button 1 short press",ref:{value:"btn1pressShort",options:["true"]}},{type:"enum",name:"button 1 long press",ref:{value:"btn1pressLong",options:["true"]}},{type:"enum",name:"button 2 short press",ref:{value:"btn2pressShort",options:["true"]}},{type:"enum",name:"button 2 long press",ref:{value:"btn2pressLong",options:["true"]}},{type:"enum",name:"switch status",ref:{value:"switchState",options:["off","on"]}},{type:"int",name:"led 1 status",
  ref:{value:"led1Level",extMeta:"0-100",unit:"%"}},{type:"enum",name:"led 1 color",ref:{value:"led1Color",options:"off blue green torqoise red purple yellow white".split(" ")}},{type:"int",name:"led 2 status",ref:{value:"led2Level",extMeta:"0-100",unit:"%"}},{type:"enum",name:"led 2 color",ref:{value:"led2Color",options:"off blue green torqoise red purple yellow white".split(" ")}}]}};B.prototype.executeCommand=function(a,b,c,d){if(c){var e=null,f=e=null;switch(c.value){case "on":case "off":case "toggle":e=
  xnm.aio.hm.HmIPChannel.SWITCH_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:4},c);break;case "led1On":case "led1Off":case "led1DimUp":case "led1DimDown":case "led1DimTo":case "led1ToggleTo":case "led1Color":case "led2On":case "led2Off":case "led2DimUp":case "led2DimDown":case "led2DimTo":case "led2ToggleTo":case "led2Color":f="led1"==c.value.substr(0,4)?{address:12}:{address:8};"On"==c.value.substr(4)?e={value:"dimOn"}:"Off"==c.value.substr(4)?e={value:"dimOff"}:"DimUp"==c.value.substr(4)?e={value:"dimUp",
  ext:c.ext}:"DimDown"==c.value.substr(4)?e={value:"dimDown",ext:c.ext}:"DimTo"==c.value.substr(4)?e={value:"dimTo",ext:c.ext}:"ToggleTo"==c.value.substr(4)?e={value:"toggleTo",ext:c.ext}:"Color"==c.value.substr(4)&&(e={value:"color",ext:c.ext});e=xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,f,e);break;default:d&&d(Error("unknown command"));return}e?a._doRequestMarked(e,!0,{execute:function(a,b){d&&d(a)}}):d&&d(Error("invalid command"))}else d&&d(Error("command is null"))};
  B.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null,e;switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c);break;case "switchState":d=xnm.aio.hm.HmIPChannel.SWITCH_TRANSMITTER.buildStateScript(a,b,{address:3},{value:"switchTState"});break;case "led1Level":case "led1Color":case "led2Level":case "led2Color":d="led1"==c.value.substr(0,4)?{address:11}:{address:7},"Level"==c.value.substr(4)?e={value:"dimmerTLevel"}:"Color"==c.value.substr(4)&&
  (e={value:"dimmerTColor"}),d=xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.buildStateScript(a,b,d,e)}return d};B.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "switchState":return xnm.aio.hm.HmIPChannel.SWITCH_TRANSMITTER.handleStatusResponse(a,{value:"switchTState"});case "led1Level":case "led2Level":return xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.handleStatusResponse(a,{value:"dimmerTLevel"});
  case "led1Color":case "led2Color":return xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.handleStatusResponse(a,{value:"dimmerTColor"});default:return"?"}};B.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;d=b.channel.substr(d+1);var e=null;switch(d){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case "1":case "2":e=xnm.aio.hm.HmIPChannel.KEY_TRANSCEIVER.resolveState(a,b,c);"pressShort"==e.key?e.key="btn"+d+
  "pressShort":"pressLong"==e.key&&(e.key="btn"+d+"pressLong");break;case "3":e=xnm.aio.hm.HmIPChannel.SWITCH_TRANSMITTER.resolveState(a,b,c);break;case "7":case "11":e=xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.resolveState(a,b,c),"7"==d?"dimmerTLevel"==e.key?e.key="led2Level":"dimmerTColor"==e.key&&(e.key="led2Color"):"11"==d&&("dimmerTLevel"==e.key?e.key="led1Level":"dimmerTColor"==e.key&&(e.key="led1Color"))}return e};var z=function(){};z.prototype.getCommandStatusMap=function(){return{command:[{type:"enum",
  name:"open",ref:{value:"open"}},{type:"enum",name:"close",ref:{value:"close"}},{type:"enum",name:"stop",ref:{value:"stop"}},{type:"enum",name:"partial open",ref:{value:"partialOpen"}},{type:"enum",name:"light on",ref:{value:"lightOn"}},{type:"enum",name:"light off",ref:{value:"lightOff"}},{type:"enum",name:"light toggle",ref:{value:"lightToggle"}}],status:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"door status",ref:{value:"doorState",
  options:["open","closed","ventilation","unknown"]}},{type:"enum",name:"light status",ref:{value:"lightState",options:["off","on"]}}]}};z.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"door status",ref:{value:"doorState",options:["open","closed","ventilation","unknown"]}},{type:"enum",name:"light status",ref:{value:"lightState",options:["off","on"]}}]}};z.prototype.executeCommand=function(a,
  b,c,d){if(c){var e=null;switch(c.value){case "open":case "close":case "stop":case "partialOpen":e=xnm.aio.hm.HmIPChannel.DOOR_RECEIVER.buildCommandScript(a,b,{address:1},c);break;case "lightOn":case "lightOff":case "lightToggle":e=xnm.aio.hm.HmIPChannel.SIMPLE_SWITCH_RECEIVER.buildCommandScript(a,b,{address:2},{value:c.value.substr(5).toLowerCase()});break;default:d&&d(Error("unknown command"));return}e?a._doRequestMarked(e,!0,{execute:function(a,b){d&&d(a)}}):d&&d(Error("invalid command"))}else d&&
  d(Error("command is null"))};z.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,b,{address:0},c);break;case "doorState":d=xnm.aio.hm.HmIPChannel.DOOR_RECEIVER.buildStateScript(a,b,{address:1},c);break;case "lightState":d=xnm.aio.hm.HmIPChannel.SIMPLE_SWITCH_RECEIVER.buildStateScript(a,b,{address:2},{value:"state"})}return d};z.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;
  switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "doorState":return xnm.aio.hm.HmIPChannel.DOOR_RECEIVER.handleStatusResponse(a,b);case "lightState":return xnm.aio.hm.HmIPChannel.SIMPLE_SWITCH_RECEIVER.handleStatusResponse(a,{value:"state"});default:return"?"}};z.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;var e=null;switch(b.channel.substr(d+1)){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,
  b,c);break;case "1":e=xnm.aio.hm.HmIPChannel.DOOR_RECEIVER.resolveState(a,b,c);break;case "2":e=xnm.aio.hm.HmIPChannel.SIMPLE_SWITCH_RECEIVER.resolveState(a,b,c)}return e};var G=function(){var a=function(){};a.prototype.getCommandStatusMap=function(){return{status:[{type:"enum",name:"duty cycle error",ref:{value:"errorBatElDutyCycle",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBatElBat",options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorBatElVoltage",
  ext:"%f",extMeta:"0-25.2"}},{type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"float",name:"average brightness",ref:{value:"briAvgIllu",ext:"%f",extMeta:"0-163830.0",unit:"lux"}},{type:"float",name:"current brightness",ref:{value:"briIllu",ext:"%f",extMeta:"0-163830.0",unit:"lux"}},{type:"float",name:"maximum brightness",ref:{value:"briMaxIllu",ext:"%f",extMeta:"0-163830.0",unit:"lux"}},{type:"float",name:"minimum brightness",ref:{value:"briMinIllu",
  ext:"%f",extMeta:"0-163830.0",unit:"lux"}}]}};a.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"duty cycle error",ref:{value:"errorBatElDutyCycle",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBatElBat",options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorBatElVoltage",ext:"%f",extMeta:"0-25.2"}},{type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"float",name:"average brightness",
  ref:{value:"briAvgIllu",ext:"%f",extMeta:"0-163830.0",unit:"lux"}},{type:"float",name:"current brightness",ref:{value:"briIllu",ext:"%f",extMeta:"0-163830.0",unit:"lux"}},{type:"float",name:"maximum brightness",ref:{value:"briMaxIllu",ext:"%f",extMeta:"0-163830.0",unit:"lux"}},{type:"float",name:"minimum brightness",ref:{value:"briMinIllu",ext:"%f",extMeta:"0-163830.0",unit:"lux"}}]}};a.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorBatElDutyCycle":case "errorBatElBat":case "errorBatElVoltage":case "errorBatElComm":d=
  xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.buildStateScript(a,b,{address:0},c);break;case "briAvgIllu":case "briIllu":case "briMaxIllu":case "briMinIllu":d=xnm.aio.hm.HmIPChannel.BRIGHTNESS_TRANSMITTER.buildStateScript(a,b,{address:1},c)}return d};a.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorBatElDutyCycle":case "errorBatElBat":case "errorBatElVoltage":case "errorBatElComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.handleStatusResponse(a,b);case "briAvgIllu":case "briIllu":case "briMaxIllu":case "briMinIllu":return xnm.aio.hm.HmIPChannel.BRIGHTNESS_TRANSMITTER.handleStatusResponse(a,
  b);default:return"?"}};a.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;var e=null;switch(b.channel.substr(d+1)){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.resolveState(a,b,c);break;case "1":e=xnm.aio.hm.HmIPChannel.BRIGHTNESS_TRANSMITTER.resolveState(a,b,c)}return e};return a}(),H=function(){var a=function(){};a.prototype.getCommandStatusMap=function(){return{status:[{type:"enum",name:"communication error",ref:{value:"errorComm",
  options:["false","true"]}},{type:"enum",name:"power failure",ref:{value:"powerMainsFailure",options:["false","true"]}}]}};a.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",name:"communication error",ref:{value:"errorComm",options:["false","true"]}},{type:"enum",name:"power failure",ref:{value:"powerMainsFailure",options:["false","true"]}}]}};a.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE.buildStateScript(a,
  b,{address:0},c);break;case "powerMainsFailure":d=xnm.aio.hm.HmIPChannel.POWER_MAINS_TRANSMITTER.buildStateScript(a,b,{address:1},c)}return d};a.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE.handleStatusResponse(a,b);case "powerMainsFailure":return xnm.aio.hm.HmIPChannel.POWER_MAINS_TRANSMITTER.handleStatusResponse(a,b);default:return"?"}};a.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;
  var d=b.channel.indexOf(":");if(-1==d)return null;var e=null;switch(b.channel.substr(d+1)){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE.resolveState(a,b,c);break;case "1":e=xnm.aio.hm.HmIPChannel.POWER_MAINS_TRANSMITTER.resolveState(a,b,c)}return e};return a}(),I=function(){var a=function(){};a.prototype.getCommandStatusMap=function(){return{command:[{type:"multi",name:"play sound",ref:{value:"acousticPlay",ext:"%multi",extMeta:[{type:"int",name:"set sound",ref:{value:"acousticSound",ext:"%d",extMeta:"0-255"}},
  {type:"int",name:"set level",ref:{value:"acousticLevel",ext:"%d",extMeta:"0-100"}},{type:"int",name:"set duration",ref:{value:"acousticDur",ext:"%d",extMeta:"0-16343"}},{type:"enum",name:"set duration unit",ref:{value:"acousticDurUnit",ext:"%e",extMeta:["S","M","H","10MS"]}},{type:"int",name:"set repeat",ref:{value:"acousticRepeat",ext:"%d",extMeta:"0-15"}}]}},{type:"multi",name:"play sound list",ref:{value:"acousticPlayList",ext:"%multi",extMeta:[{type:"string",name:"set sound list",ref:{value:"acousticSoundList",
  ext:"%s"}},{type:"int",name:"set level",ref:{value:"acousticLevel",ext:"%d",extMeta:"0-100"}},{type:"int",name:"set duration",ref:{value:"acousticDur",ext:"%d",extMeta:"0-16343"}},{type:"enum",name:"set duration unit",ref:{value:"acousticDurUnit",ext:"%e",extMeta:["S","M","H","10MS"]}},{type:"int",name:"set repeat",ref:{value:"acousticRepeat",ext:"%d",extMeta:"0-15"}}]}},{type:"enum",name:"led on",ref:{value:"dimOn"}},{type:"enum",name:"led off",ref:{value:"dimOff"}},{type:"int",name:"led dim up",
  ref:{value:"dimUp",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"led dim down",ref:{value:"dimDown",ext:"%d",extMeta:"1-100",unit:"%"}},{type:"int",name:"led dim to",ref:{value:"dimTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"int",name:"led toggle to",ref:{value:"toggleTo",ext:"%d",extMeta:"0-100",unit:"%"}},{type:"enum",name:"led color",ref:{value:"color",ext:"%e",extMeta:"off blue green torqoise red purple yellow white".split(" ")}},{type:"multi",name:"play color",ref:{value:"colorList",
  ext:"%multi",extMeta:[{type:"int",name:"set level",ref:{value:"colorLevel",ext:"%d",extMeta:"0-100"}},{type:"enum",name:"set color",ref:{value:"colorValue",ext:"%e",extMeta:"off blue green torqoise red purple yellow white".split(" ")}},{type:"enum",name:"set on time",ref:{value:"colorOnTime",ext:"%e",extMeta:"100MS 200MS 300MS 400MS 500MS 700MS 1S 2S 3S 5S 7S 10S 20S 40S 50S ALWAYS".split(" ")}},{type:"int",name:"set duration",ref:{value:"colorDur",ext:"%d",extMeta:"0-16343"}},{type:"enum",name:"set duration unit",
  ref:{value:"colorDurUnit",ext:"%e",extMeta:["S","M","H","10MS"]}},{type:"int",name:"set repeat",ref:{value:"colorRepeat",ext:"%d",extMeta:"0-15"}}]}},{type:"multi",name:"play color list",ref:{value:"colorPlayList",ext:"%multi",extMeta:[{type:"int",name:"set level",ref:{value:"colorLevel",ext:"%d",extMeta:"0-100"}},{type:"string",name:"set color list",ref:{value:"colorList",ext:"%s"}},{type:"string",name:"set on time list",ref:{value:"colorOnTime",ext:"%s"}},{type:"int",name:"set duration",ref:{value:"colorDur",
  ext:"%d",extMeta:"0-16343"}},{type:"enum",name:"set duration unit",ref:{value:"colorDurUnit",ext:"%e",extMeta:["S","M","H","10MS"]}},{type:"int",name:"set repeat",ref:{value:"colorRepeat",ext:"%d",extMeta:"0-15"}}]}}],status:[{type:"enum",name:"duty cycle error",ref:{value:"errorBatElDutyCycle",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBatElBat",options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorBatElVoltage",ext:"%f",extMeta:"0-25.2"}},
  {type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"int",name:"sound level",ref:{value:"acousticTLevel",extMeta:"0-100"}},{type:"int",name:"sound file",ref:{value:"acousticTSoundfile",extMeta:"0-255"}},{type:"int",name:"led level",ref:{value:"dimmerTLevel",extMeta:"0-100",unit:"%"}},{type:"enum",name:"led color",ref:{value:"dimmerTColor",options:"off blue green torqoise red purple yellow white".split(" ")}}]}};a.prototype.getIPEvtMap=function(){return{ipevt:[{type:"enum",
  name:"duty cycle error",ref:{value:"errorBatElDutyCycle",options:["false","true"]}},{type:"enum",name:"battery low",ref:{value:"errorBatElBat",options:["false","true"]}},{type:"float",name:"battery voltage",ref:{value:"errorBatElVoltage",ext:"%f",extMeta:"0-25.2"}},{type:"enum",name:"communication error",ref:{value:"errorBatElComm",options:["false","true"]}},{type:"int",name:"sound level",ref:{value:"acousticTLevel",extMeta:"0-100"}},{type:"int",name:"sound file",ref:{value:"acousticTSoundfile",extMeta:"0-255"}},
  {type:"int",name:"led level",ref:{value:"dimmerTLevel",extMeta:"0-100",unit:"%"}},{type:"enum",name:"led color",ref:{value:"dimmerTColor",options:"off blue green torqoise red purple yellow white".split(" ")}}]}};a.prototype.executeCommand=function(a,b,c,d){if(c){var e=null;switch(c.value){case "acousticPlay":case "acousticPlayList":e=xnm.aio.hm.HmIPChannel.ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:2},c);break;case "dimOn":case "dimOff":case "dimUp":case "dimDown":case "dimTo":case "toggleTo":case "color":case "colorPlay":case "colorPlayList":e=
  xnm.aio.hm.HmIPChannel.DIMMER_VIRTUAL_RECEIVER.buildCommandScript(a,b,{address:6},c)}e?a._doRequestMarked(e,!0,{execute:function(a,b){d&&d(a)}}):d&&d(Error("invalid command"))}else d&&d(Error("command is null"))};a.prototype.buildStateScript=function(a,b,c){if(!c)return null;var d=null;switch(c.value){case "errorBatElDutyCycle":case "errorBatElBat":case "errorBatElVoltage":case "errorBatElComm":d=xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.buildStateScript(a,b,{address:0},c);break;case "acousticTLevel":case "acousticTSoundfile":d=
  xnm.aio.hm.HmIPChannel.ACOUSTIC_SIGNAL_TRANSMITTER.buildStateScript(a,b,{address:1},c);break;case "dimmerTLevel":case "dimmerTColor":d=xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.buildStateScript(a,b,{address:5},c)}return d};a.prototype.handleStatusResponse=function(a,b){if("?"==a)return a;switch(b.value){case "errorBatElDutyCycle":case "errorBatElBat":case "errorBatElVoltage":case "errorBatElComm":return xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.handleStatusResponse(a,b);case "acousticTLevel":case "acousticTSoundfile":return xnm.aio.hm.HmIPChannel.ACOUSTIC_SIGNAL_TRANSMITTER.handleStatusResponse(a,
  b);case "dimmerTLevel":case "dimmerTColor":return xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.handleStatusResponse(a,b);default:return"?"}};a.prototype.resolveState=function(a,b,c){if(!b||!b.channel)return null;var d=b.channel.indexOf(":");if(-1==d)return null;var e=null;switch(b.channel.substr(d+1)){case "0":e=xnm.aio.hm.HmIPChannel.MAINTENANCE_BAT_EL.resolveState(a,b,c);break;case "1":e=xnm.aio.hm.HmIPChannel.ACOUSTIC_SIGNAL_TRANSMITTER.resolveState(a,b,c);break;case "5":e=xnm.aio.hm.HmIPChannel.DIMMER_TRANSMITTER.resolveState(a,
  b,c)}return e};return a}();return{"HmIP-BSM":new k,"HmIP-BDT":new n,"HMIP-WRC2":new q,"HmIP-ASIR":new p,"HmIP-SWSD":new t,"HmIP-SRH":new r,"HmIP-FSM":new w,"HmIP-PDT":new u,"HmIP-BROLL":new m,"HmIP-FROLL":new m,"HmIP-BBL":new y,"HmIP-FBL":new y,"HmIP-WRC6":new C,"HmIP-SPDR":new D,"HmIP-SWD":new E,"HmIP-SAM":new F,"HmIP-WGC":new A,"HmIP-BSL":new B,"HmIP-MOD-TM":new z,"HmIP-SLO":new G,"HmIP-PMFS":new H,"HmIP-MP3P":new I,"HmIP-MOD-HO":new z,resolveJSON:function(k){if(!k||!k.type)return null;if("HmIP-PDT"==
  k.type)return d.parseJSON(k);if(this[k.type])return this[k.type];var m=null;switch(k.type){case "HmIP-WHS2":m=c.parseJSON(k);break;case "HmIP-DBB":case "HmIP-BRC2":m=a.parseJSON(k);break;case "HmIP-RCV-50":m=a.parseJSON(k)}if("HmIPW-DRS"==k.type.substr(0,9))m=c.parseJSON(k);else if("HmIPW-DRD"==k.type.substr(0,9))m=d.parseJSON(k);else if("HmIPW-DRBL"==k.type.substr(0,10))m=b.parseJSON(k);else if("HmIPW-DRI"==k.type.substr(0,9))m=e.parseJSON(k);else if("HmIPW-FIO"==k.type.substr(0,9)){if(k.channels)for(var v in k.channels)if("MULTI_MODE_INPUT_TRANSMITTER"==
  v.substr(0,28)){m=e.parseJSON(k);break}else if("SWITCH_TRANSMITTER"==v.substr(0,18)){m=c.parseJSON(k);break}}else if("HmIPW-STH"==k.type.substr(0,9)||"HmIPW-STHD"==k.type.substr(0,10)||"HmIPW-WTH"==k.type.substr(0,9))m=f.parseJSON(k);else if("HmIPW-SMI55"==k.type)m=h.parseJSON(k);else if("HmIPW-SPI"==k.type)m=g.parseJSON(k);else if("HmIP-FCI"==k.type.substr(0,8))m=e.parseJSON(k);else if("HmIP-MOD-RC"==k.type.substr(0,11))m=e.parseJSON(k);else if("HmIP-MOD-OC"==k.type.substr(0,11)){v=parseInt(k.type.substr(11));
  var n=0,p=k.address.indexOf(":");-1!=p&&(n=parseInt(k.address.substr(p+1)));0<n&&n<=v?m=a.parseJSON(k):0!=n&&(m=c.parseJSON(k))}else if("HmIP-FDT"==k.type.substr(0,8))m=d.parseJSON(k);else if("HmIP-FALMOT"==k.type.substr(0,11))m=l.parseJSON(k);else if(this[k.type])return this[k.type];return m},parseDevice:function(a){return a.channels&&a.hsstype&&a["interface"]?0==a.hsstype.indexOf("HmIPW")?this._parseHMIPWDevice(a):this._parseHmIPRFDevice(a):null},_parseHMIPWDevice:function(a){var b=function(a){var b=
  [];var c={sys:"hm"};c.id=a.name;c.type=a.hsstype;c.address=a.address;c.interface=a.interface;c.channels={};var d=0,e=JSON.parse(JSON.stringify(c)),f=null,g=a.channels,h=!1,l;for(l in g)if(g.hasOwnProperty(l)){var k=a.channels[l];if(k.hsstype&&("DIMMER_TRANSMITTER"==k.hsstype&&(0!=d&&(b.push(e),e=JSON.parse(JSON.stringify(c)),h=!1,f&&(e.channels.MAINTENANCE=f)),d++),k.address)){var m=k.address.indexOf(":");if(-1!==m){"DIMMER_VIRTUAL_RECEIVER"!=k.hsstype||h||(e.id=k.name?k.name:e.id,h=!0);m=k.address.substring(m+
  1);"DIMMER_TRANSMITTER"==k.hsstype&&(e.address+=":"+m);var n={id:k.name,address:m,room:k.room,group:k.func};0==m?(f=n,e.channels.MAINTENANCE=f):e.channels[k.hsstype+":"+m]=n;if("DIMMER_WEEK_PROFILE"==k.hsstype){for(var v=0;v<b.length;v++)b[v].channels[k.hsstype+":"+m]=n;b.push(e)}}}}return b},c=function(a){var b=[];var c={sys:"hm"};c.id=a.name;c.type=a.hsstype;c.address=a.address;c.interface=a.interface;c.channels={};var d=0,e=JSON.parse(JSON.stringify(c)),f=null,g=a.channels,h=!1,k;for(k in g)if(g.hasOwnProperty(k)){var l=
  a.channels[k];if(l.hsstype&&("BLIND_TRANSMITTER"==l.hsstype&&(0!=d&&(b.push(e),e=JSON.parse(JSON.stringify(c)),h=!1,f&&(e.channels.MAINTENANCE=f)),d++),l.address)){var m=l.address.indexOf(":");if(-1!==m){"BLIND_VIRTUAL_RECEIVER"!=l.hsstype||h||(e.id=l.name?l.name:e.id,h=!0);m=l.address.substring(m+1);"BLIND_TRANSMITTER"==l.hsstype&&(e.address+=":"+m);var n={id:l.name,address:m,room:l.room,group:l.func};0==m?(f=n,e.channels.MAINTENANCE=f):e.channels[l.hsstype+":"+m]=n;if("BLIND_WEEK_PROFILE"==l.hsstype){for(var v=
  0;v<b.length;v++)b[v].channels[l.hsstype+":"+m]=n;b.push(e)}}}}return b},d=function(a){var b=[];var c={sys:"hm"};c.id=a.name;c.type=a.hsstype;c.address=a.address;c.interface=a.interface;c.channels={};var d=0,e=JSON.parse(JSON.stringify(c)),f=null,g=a.channels,h=!1,l;for(l in g)if(g.hasOwnProperty(l)){var k=a.channels[l];if(k.hsstype)if("ALARM_COND_SWITCH_TRANSMITTER"==k.hsstype)b.push(e);else if("MULTI_MODE_INPUT_TRANSMITTER"==k.hsstype&&(0!=d&&(b.push(e),e=JSON.parse(JSON.stringify(c)),h=!1,f&&(e.channels.MAINTENANCE=
  f)),d++),k.address){var m=k.address.indexOf(":");if(-1!==m){"MULTI_MODE_INPUT_TRANSMITTER"!=k.hsstype||h||(e.id=k.name?k.name:e.id,h=!0);m=k.address.substring(m+1);"MULTI_MODE_INPUT_TRANSMITTER"==k.hsstype&&(e.address+=":"+m);var n={id:k.name,address:m,room:k.room,group:k.func};0==m?(f=n,e.channels.MAINTENANCE=f):e.channels[k.hsstype+":"+m]=n}}}return b},e=function(a){var b={sys:"hm"};b.id=a.name;b.type=a.hsstype;b.address=a.address;b.interface=a.interface;b.channels={};var c=0,d=!1,e=[];var f=[];
  var g=JSON.parse(JSON.stringify(b)),h=null,k=a.channels,l;for(l in k)if(k.hasOwnProperty(l)){var m=a.channels[l];if(m.hsstype&&m.address){var n=m.address.indexOf(":");if(-1!==n){n=m.address.substring(n+1);var v={id:m.name,address:n,room:m.room,group:m.func};if("MAINTENANCE"==m.hsstype)h=v,g.channels.MAINTENANCE=h;else if("MULTI_MODE_INPUT_TRANSMITTER"==m.hsstype)g.channels[m.hsstype+":"+n]=v,g.id=m.name?m.name:g.id,g.address+=":"+n,e.push(g),g=JSON.parse(JSON.stringify(b)),h&&(g.channels.MAINTENANCE=
  h);else if("SWITCH_TRANSMITTER"==m.hsstype)0!=c&&(f.push(g),g=JSON.parse(JSON.stringify(b)),d=!1,h&&(g.channels.MAINTENANCE=h)),c++,g.channels[m.hsstype+":"+n]=v,g.address+=":"+n;else if("SWITCH_VIRTUAL_RECEIVER"==m.hsstype&&!d)g.channels[m.hsstype+":"+n]=v,g.id=m.name?m.name:g.id,d=!0;else if("SWITCH_WEEK_PROFILE"==m.hsstype){for(var p=0;p<f.length;p++)f[p].channels[m.hsstype+":"+n]=v;f.push(g)}}}}return f.concat(e)},f=a.hsstype;if("HmIPW-DRS"==f.substr(0,9))return this._resolveHmIPMultiSwitch(a);
  if("HmIPW-DRD"==f.substr(0,9))return b(a);if("HmIPW-DRBL"==f.substr(0,10))return c(a);if("HmIPW-DRI"==f.substr(0,9))return d(a);if("HmIPW-FIO"==f.substr(0,9))return e(a);if("HmIPW-SMI55"==f)return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1==["0","1","2","3"].indexOf(a)?0:-1!=["1","2"].indexOf(a)?2:1});if("HmIPW-SPI"==f)return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1==["0","1"].indexOf(a)?0:1});var g={};return this._resolveHmIPDeviceFromScript(a,function(a,b){if(!xnm.aio.hm.HMIP_CHANNEL[b])return 0;
  g[b]||(g[b]=a);return g[b]!=a?0:1})},_parseHmIPRFDevice:function(a){if("HMIP-BSM"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1=="034567".split("").indexOf(a)?0:-1!=["4","5","6"].indexOf(a)?2:1});if("HMIP-FSM"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1=="012345".split("").indexOf(a)?0:-1!=["2","3","4"].indexOf(a)?2:1});if("HMIP-BDT"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,
  b){return-1==["0","3","4","5","6"].indexOf(a)?0:-1!=["4","5","6"].indexOf(a)?2:1});if("HMIP-PDT"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1==["0","2","3","4","5"].indexOf(a)?0:-1!=["3","4","5"].indexOf(a)?2:1});if("HMIP-FDT"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1=="012345".split("").indexOf(a)?0:-1!=["2","3","4"].indexOf(a)?2:1});if("HMIP-BROLL"==a.hsstype.toUpperCase()||"HMIP-FROLL"==a.hsstype.toUpperCase()||
  "HMIP-FBL"==a.hsstype.toUpperCase()||"HMIP-BBL"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1!=["1","2"].indexOf(a)?2:-1==["0","3","4","5","6"].indexOf(a)?0:-1!=["4","5","6"].indexOf(a)?2:1});if(-1!=a.hsstype.toUpperCase().indexOf("HMIP-WRC"))return this._resolveHmIPDeviceFromScript(a,function(a,b){return 0==a?1:"KEY_TRANSCEIVER"==b?2:0});if(0==a.hsstype.toUpperCase().indexOf("HMIP-FAL"))return this._resolveHmIPDeviceFromScript(a,function(a,b){return"CLIMATECONTROL_FLOOR_PUMP_TRANSCEIVER"==
  b||"CLIMATECONTROL_FLOOR_TRANSCEIVER"==b?3:0});if("HMIP-SPDR"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1==["0","2","3"].indexOf(a)?0:-1!=["2","3"].indexOf(a)?2:1});if("HMIP-SMI55"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1==["0","1","2","3"].indexOf(a)?0:-1!=["1","2"].indexOf(a)?3:1});if("HMIP-MIOB"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1!=["3","7","9",
  "10","11"].indexOf(a)?3:0});if("HMIP-SWD"==a.hsstype.toUpperCase()||"HMIP-SAM"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return 1});if("HMIP-WGC"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1=="012345".split("").indexOf(a)?0:-1!=["3","4","5"].indexOf(a)?2:1});if("HMIP-BSL"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1!="5 6 9 10 13 14".split(" ").indexOf(a)?0:-1!="1 2 7 8 11 12".split(" ").indexOf(a)?
  2:1});if("HMIP-MOD-TM"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return 1});if("HMIP-SLO"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1!=["2","3"].indexOf(a)?0:1});if("HMIP-PMFS"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return 1});if("HMIP-MP3P"==a.hsstype.toUpperCase())return this._resolveHmIPDeviceFromScript(a,function(a,b){return-1!=["0","1","5","9"].indexOf(a)?1:-1!="234678".split("").indexOf(a)?
  2:0});if("HmIP-MOD-OC"==a.hsstype.substr(0,11)){var b=this._resolveHmIPDeviceFromScript(a,function(a,b){return"MAINTENANCE"==b?1:"KEY_TRANSCEIVER"==b?3:0});a=this._resolveHmIPMultiSwitch(a,[1,2,3,4,5,6,7,8]);return b?a?b.concat(a):b:a}if(-1!=a.hsstype.indexOf("HmIP-FCI"))return this._resolveHmIPDeviceFromScript(a,function(a,b){return 0==a?1:"MULTI_MODE_INPUT_TRANSMITTER"==b?3:0});b=this._getChannelCount(a.channels,"SWITCH_TRANSMITTER");var c=this._getChannelCount(a.channels,"SWITCH_VIRTUAL_RECEIVER");
  if(1<this._getChannelCount(a.channels,"KEY_TRANSCEIVER"))return this._resolveHmIPDeviceFromScript(a,function(a,b){return"MAINTENANCE"==b?1:"KEY_TRANSCEIVER"==b?3:0});if(1<b&&1<c)return this._resolveHmIPMultiSwitch(a);var d={};return this._resolveHmIPDeviceFromScript(a,function(a,b){if(!xnm.aio.hm.HMIP_CHANNEL[b])return 0;d[b]||(d[b]=a);return d[b]!=a?0:1})},_getChannelCount:function(a,b){var c=0,d;for(d in a)a.hasOwnProperty(d)&&a[d].hsstype==b&&c++;return c},_parseDeviceBasic:function(a){var b={sys:"hm"};
  b.id=a.name;b.type=a.hsstype;b.address=a.address;b.interface=a.interface;b.channels={};return b},_resolveHmIPMultiSwitch:function(a,b){var c=[];var d={sys:"hm"};d.id=a.name;d.type=a.hsstype;d.address=a.address;d.interface=a.interface;d.channels={};var e=0,f=JSON.parse(JSON.stringify(d)),g=null,h=a.channels,k=!1,l;for(l in h)if(h.hasOwnProperty(l)){var m=a.channels[l];if(m.hsstype&&("SWITCH_TRANSMITTER"==m.hsstype&&(0!=e&&(c.push(f),f=JSON.parse(JSON.stringify(d)),k=!1,g&&(f.channels.MAINTENANCE=g)),
  e++),m.address)){var n=m.address.indexOf(":");if(-1!==n&&("SWITCH_VIRTUAL_RECEIVER"!=m.hsstype||k||(f.id=m.name?m.name:f.id,k=!0),n=m.address.substring(n+1),!b||-1==b.indexOf(parseInt(n)))){"SWITCH_TRANSMITTER"==m.hsstype&&(f.address+=":"+n);var p={id:m.name,address:n,room:m.room,group:m.func};0==n?(g=p,f.channels.MAINTENANCE=g):f.channels[m.hsstype+":"+n]=p;if("SWITCH_WEEK_PROFILE"==m.hsstype){for(var q=0;q<c.length;q++)c[q].channels[m.hsstype+":"+n]=p;c.push(f)}}}}return c},_resolveHmIPDeviceFromScript:function(a,
  b){var c=[],d={sys:"hm"};d.id=a.name;d.type=a.hsstype;d.address=a.address;d["interface"]=a["interface"];d.channels={};var e=a.channels,f=!1,g;for(g in e)if(channel=a.channels[g],channel.address&&(e=channel.address.indexOf(":"),-1!==e)){e=channel.address.substring(e+1);var h=channel.hsstype;if(channel.hsstype){var k=1;b&&(k=b(e,h));0!=k&&(3==k?(k=JSON.parse(JSON.stringify(d)),k.address=k.address+":"+e,k.id=k.id+"("+k.address+")",k.channels[h]={id:channel.name,address:e,room:channel.room,group:channel.func},
  c.push(k)):(f=!0,2==k&&(h=h+":"+e),d.channels[h]={id:channel.name,address:e,room:channel.room,group:channel.func}))}}f&&c.push(d);return c}}}();
  xnm.aio.hm.VirtualDevice=function(){var a=function(){return{"VIR-LG-ONOFF-CH":{buildCommandScript:function(a,b,c,d){if(!b.channels||!d.value)return null;switch(d.value){case "onoffChOn":a="LEVEL";d="if(o!=null){o.State(0.9);}\n";break;case "onoffChOff":a="LEVEL";d="if(o!=null){o.State(0.0);}\n";break;case "onoffChToggle":a="LEVEL";d="if(o!=null){if(o.Value()>0.0){o.State(0.0);}else{o.State(0.9);}}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(b,c,a,d)},buildStateScript:function(a,
  b,c,d){if(!b.channels||!d.value)return null;switch(d.value){case "onoffChState":a="LEVEL";break;case "onoffChLevel":a="LEVEL";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(b,c,a)},handleStatusResponse:function(a,b){if("?"==a)return a;switch(b.value){case "onoffChState":return parseFloat(a)?"on":"off";default:return"?"}},resolveState:function(a,b,c){switch(b.datapoint){case "LEVEL":var d="onoffChState"}if(!d)return null;a=this.handleStatusResponse(c+"",{value:d});return{key:d,
  value:a}}},"VIR-LG-RGBW-DIM-CH":{buildCommandScript:function(a,b,c,d){if(!b.channels||!d.value)return null;var e=null;switch(d.value){case "rgbwChOn":a="LEVEL";d="if(o!=null){o.State(1.0);}\n";break;case "rgbwChOff":a="LEVEL";d="if(o!=null){o.State(0.0);}\n";break;case "rgbwChUp":d=null==d.ext||"undefined"==typeof d.ext?.1:"number"==typeof d.ext?(parseInt(d.ext)/100).toFixed(2):d.ext.match(/^[-+]?[0-9]+$/)?(parseInt(d.ext)/100).toFixed(2):.1;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,
  b,c,{value:"rgbwChLevel"}));d=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()+"+d+";if(v>1){v=1.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"+"+d+";if(v>1){v=1.0;}o.State(v);}\n";a="LEVEL";break;case "rgbwChDown":d=null==d.ext||"undefined"==typeof d.ext?.1:"number"==typeof d.ext?(parseInt(d.ext)/100).toFixed(2):d.ext.match(/^[-+]?[0-9]+$/)?(parseInt(d.ext)/100).toFixed(2):.1;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,b,c,{value:"rgbwChLevel"}));d=null==e||"undefined"==typeof e?
  "if(o!=null){var v=o.Value()-"+d+";if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-"+d+";if(v<0){v=0.0;}o.State(v);}\n";a="LEVEL";break;case "rgbwChLvlTo":if(null==d.ext||"undefined"==typeof d.ext)return null;if("number"==typeof d.ext)d=parseInt(d.ext);else if(d.ext.match(/^[-+]?[0-9]+$/))d=d.ext;else return null;a="LEVEL";d/=100;d=0>d?0:d;d="if(o!=null){o.State("+(1<d?1:d)+");}\n";break;case "rgbwChRgbwTo":if(null==d.ext||"undefined"==typeof d.ext)return null;d=d.ext;if(8>d.length)return null;
  a="RGBW";e=parseInt(d.substr(0,2),16);var f=parseInt(d.substr(2,2),16),g=parseInt(d.substr(4,2),16);d=parseInt(d.substr(6,2),16);d='if(o!=null){o.State("rgb('+e+","+f+","+g+","+d+')");}\n';break;case "rgbwChCtTo":if(null==d.ext||"undefined"==typeof d.ext)return null;if("number"==typeof d.ext)d=parseInt(d.ext);else if(d.ext.match(/^[-+]?[0-9]+$/))d=d.ext;else return null;a="WHITE";d="if(o!=null){o.State("+d+");}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(b,c,a,d)},buildStateScript:function(a,
  b,c,d){if(!b.channels||!d.value)return null;switch(d.value){case "rgbwChLevel":a="LEVEL";break;case "rgbwChRgbw":a="RGBW";break;case "rgbwChCt":a="WHITE";break;default:return null}return xnm.aio.hm.Channel.buildStateScript(b,c,a)},handleStatusResponse:function(a,b){if("?"==a)return a;switch(b.value){case "rgbwChLevel":return parseFloat(a);case "rgbwChRgbw":return a;case "rgbwChCt":return parseInt(a);default:return"?"}},resolveState:function(a,b,c){switch(b.datapoint){case "LEVEL":var d="rgbwChLevel";
  break;case "RGBW":d="rgbwChRgbw";break;case "WHITE":d="rgbwChCt"}if(!d)return null;a=this.handleStatusResponse(c+"",{value:d});return{key:d,value:a}}},"VIR-LG-DIM-CH":{buildCommandScript:function(a,b,c,d){if(!b.channels||!d.value)return null;var e=null;switch(d.value){case "dimChOn":a="LEVEL";d="if(o!=null){o.State(1.0);}\n";break;case "dimChOff":a="LEVEL";d="if(o!=null){o.State(0.0);}\n";break;case "dimChUp":d=null==d.ext||"undefined"==typeof d.ext?.1:"number"==typeof d.ext?(parseInt(d.ext)/100).toFixed(2):
  d.ext.match(/^[-+]?[0-9]+$/)?(parseInt(d.ext)/100).toFixed(2):.1;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,b,c,{value:"rgbwChLevel"}));d=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()+"+d+";if(v>1){v=1.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"+"+d+";if(v>1){v=1.0;}o.State(v);}\n";a="LEVEL";break;case "dimChDown":d=null==d.ext||"undefined"==typeof d.ext?.1:"number"==typeof d.ext?(parseInt(d.ext)/100).toFixed(2):d.ext.match(/^[-+]?[0-9]+$/)?(parseInt(d.ext)/100).toFixed(2):
  .1;a._statebuffer&&(e=this.getBufferedState(a._statebuffer,b,c,{value:"rgbwChLevel"}));d=null==e||"undefined"==typeof e?"if(o!=null){var v=o.Value()-"+d+";if(v<0){v=0.0;}o.State(v);}\n":"if(o!=null){var v="+e/100+"-"+d+";if(v<0){v=0.0;}o.State(v);}\n";a="LEVEL";break;case "dimChLvlTo":if(null==d.ext||"undefined"==typeof d.ext)return null;if("number"==typeof d.ext)d=parseInt(d.ext);else if(d.ext.match(/^[-+]?[0-9]+$/))d=d.ext;else return null;a="LEVEL";d/=100;d=0>d?0:d;d="if(o!=null){o.State("+(1<
  d?1:d)+");}\n";break;default:return null}return xnm.aio.hm.Channel.buildCommandScript(b,c,a,d)},buildStateScript:function(a,b,c,d){if(!b.channels||!d.value)return null;switch(d.value){case "dimChLevel":break;default:return null}return xnm.aio.hm.Channel.buildStateScript(b,c,"LEVEL")},handleStatusResponse:function(a,b){if("?"==a)return a;switch(b.value){case "dimChLevel":return parseFloat(a);default:return"?"}},resolveState:function(a,b,c){switch(b.datapoint){case "LEVEL":var d="dimChLevel"}if(!d)return null;
  a=this.handleStatusResponse(c+"",{value:d});return{key:d,value:a}}}}}(),c=function(){};c.prototype.executeCommand=function(b,c,d,g){if(d){var e=null;switch(d.value){case "onoffChOn":e=a["VIR-LG-ONOFF-CH"].buildCommandScript(b,c,{address:1},{value:"onoffChOn"});break;case "onoffChOff":e=a["VIR-LG-ONOFF-CH"].buildCommandScript(b,c,{address:1},{value:"onoffChOff"});break;case "onoffChToggle":e=a["VIR-LG-ONOFF-CH"].buildCommandScript(b,c,{address:1},{value:"onoffChToggle"})}e?b._doRequestMarked(e,!0,
  {execute:function(a,c){"onoffChOn"!=d.value||a?setTimeout(function(){g&&g(a)},200):setTimeout(function(){b._doRequestMarked(e,!0,{execute:function(a,b){g&&g(a)}})},3E3)}}):g&&g(Error("invalid command"))}else g&&g(Error("command is null"))};c.prototype.buildStateScript=function(b,c,d){if(!d)return null;var e=null;switch(d.value){case "onoffChState":e=a["VIR-LG-ONOFF-CH"].buildStateScript(b,c,{address:1},d)}return e};c.prototype.handleStatusResponse=function(b,c){if("?"==b)return b;switch(c.value){case "onoffChState":return a["VIR-LG-ONOFF-CH"].handleStatusResponse(b,
  c);default:return"?"}};c.prototype.resolveState=function(b,c,d){if(!c||!c.channel)return null;var e=c.channel.indexOf(":");if(-1==e)return null;var f=null;switch(c.channel.substr(e+1)){case "1":f=a["VIR-LG-ONOFF-CH"].resolveState(b,c,d)}return f};var d=function(){};d.prototype.executeCommand=function(b,c,d,g){d?(c=a["VIR-LG-RGBW-DIM-CH"].buildCommandScript(b,c,{address:1},d))?b._doRequestMarked(c,!0,{execute:function(a,b){setTimeout(function(){g&&g(a)},200)}}):g&&g(Error("invalid command")):g&&g(Error("command is null"))};
  d.prototype.buildStateScript=function(b,c,d){return d?a["VIR-LG-RGBW-DIM-CH"].buildStateScript(b,c,{address:1},d):null};d.prototype.handleStatusResponse=function(b,c){return"?"==b?b:a["VIR-LG-RGBW-DIM-CH"].handleStatusResponse(b,c)};d.prototype.resolveState=function(b,c,d){if(!c||!c.channel)return null;var e=c.channel.indexOf(":");if(-1==e)return null;var f=null;switch(c.channel.substr(e+1)){case "1":f=a["VIR-LG-RGBW-DIM-CH"].resolveState(b,c,d)}return f};var b=function(){};b.prototype.executeCommand=
  function(b,c,d,g){d?(c=a["VIR-LG-DIM-CH"].buildCommandScript(b,c,{address:1},d))?b._doRequestMarked(c,!0,{execute:function(a,b){setTimeout(function(){g&&g(a)},200)}}):g&&g(Error("invalid command")):g&&g(Error("command is null"))};b.prototype.buildStateScript=function(b,c,d){return d?a["VIR-LG-DIM-CH"].buildStateScript(b,c,{address:1},d):null};b.prototype.handleStatusResponse=function(b,c){return"?"==b?b:a["VIR-LG-DIM-CH"].handleStatusResponse(b,c)};b.prototype.resolveState=function(b,c,d){if(!c||
  !c.channel)return null;var e=c.channel.indexOf(":");if(-1==e)return null;var f=null;switch(c.channel.substr(e+1)){case "1":f=a["VIR-LG-DIM-CH"].resolveState(b,c,d)}return f};return{"VIR-LG-ONOFF":c,"VIR-LG-RGBW-DIM":d,"VIR-LG-DIM":b,parseDevice:function(a){var b={sys:"hm"};b.id=a.name;b.type=a.hsstype;b.address=a.address;b["interface"]=a["interface"];b.channels={};var c=a.channels,d;for(d in c)if(c.hasOwnProperty(d)){var e=a.channels[d];if(e.address){var k=e.address.indexOf(":");-1!==k&&(k=e.address.substring(k+
  1),e.hsstype&&(b.channels[e.hsstype]={id:e.name,address:k,room:e.room,group:e.func}))}}return[b]}}}();
  xnm.aio.hm.VirtualDevice_MAP={"VIR-LG-ONOFF-CH":{LEVEL:{command:[{type:"enum",name:"on",ref:{value:"onoffChOn"}},{type:"enum",name:"off",ref:{value:"onoffChOff"}}]}},"VIR-LG-RGBW-DIM-CH":{LEVEL:{command:[{type:"enum",name:"on",ref:{value:"rgbwChOn"}},{type:"enum",name:"off",ref:{value:"rgbwChOff"}},{type:"int",name:"dim to",ref:{value:"rgbwChLvlTo",ext:"%d",extMeta:"0-100"}}]},RGBW:{command:[{type:"rgbw",name:"set rgbw",ref:{value:"rgbwChRgbwTo",ext:"%s"}}]},WHITE:{command:[{type:"int",name:"set color temperature",
  ref:{value:"rgbwChCtTo",ext:"%d",extMeta:"2000-6500",scale:"50"}}]}},"VIR-LG-DIM-CH":{LEVEL:{command:[{type:"enum",name:"on",ref:{value:"dimChOn"}},{type:"enum",name:"off",ref:{value:"dimChOff"}},{type:"int",name:"dim to",ref:{value:"dimChLvlTo",ext:"%d",extMeta:"0-100"}}]}}};xnm.aio.hm.DMError=function(a,c){this.code=a;this.message=c;this.stack=Error().stack};xnm.aio.hm.DMError.prototype=Error();xnm.aio.hm.DMError.prototype.name="HomeMaticDeviceManagerError";xnm.aio.hm.DMError.prototype.code=0;
  xnm.aio.hm.DMError.ERROR_CODE={DEFAULT:0,INDEX_EXISTS:1,ID_EXISTS:2,INVALID:3,UNKNOW:4,NOT_FOUND:5,IP_EXISTS:6};
  xnm.aio.hm.DM={SYS:"hm",SYSVAR:"SysVar",PROG:"Prog",getGatewayType:function(){return[{sys:this.SYS,name:"HomeMatic CCU"}]},createGateway:function(a,c,d){c=xnm.aio.hm.DMError;var b=xnm.aio.hm.DMError.ERROR_CODE;a?a.ip?d(null,a):d(new c(b.INVALID,"ip is invalid")):d(new c(b.INVALID,"info is invalid"))},updateGateway:function(a,c,d,b){a=xnm.aio.hm.DMError;d=xnm.aio.hm.DMError.ERROR_CODE;c?c.ip?b(null,c):b(new a(d.INVALID,"ip is invalid")):b(new a(d.INVALID,"update is invalid"))},deleteGateway:function(a,
  c,d){d()},createDevice:function(a,c,d){var b=xnm.aio.hm.DMError,e=xnm.aio.hm.DMError.ERROR_CODE;if(a)if(a.gateway)if(a["interface"])if(a.address)if(a.type)if("SysVar"==a.type||"Prog"==a.type||a.channels)if(c.data&&c.data.gateways&&0!==c.data.gateways.length){c=c.data.gateways;var f;for(f=0;f<c.length;f++)if(c[f].index===a.gateway){var h=c[f];break}h?d(null,a):d(new b(e.NOT_FOUND,"gateway with index "+a.gateway+" not exists"))}else d(new b(e.NOT_FOUND,"gateway with index "+a.gateway+" not exists"));
  else d(new b(e.INVALID,"channels is invalid"));else d(new b(e.INVALID,"type is invalid"));else d(new b(e.INVALID,"address is invalid"));else d(new b(e.INVALID,"interface is invalid"));else d(new b(e.INVALID,"gateway is invalid"));else d(new b(e.INVALID,"info is invalid"))},updateDevice:function(a,c,d){var b=xnm.aio.hm.DMError,e=xnm.aio.hm.DMError.ERROR_CODE;if(a)if(a.address)if(a["interface"])if(a.type)if("SysVar"==a.type||"Prog"==a.type||a.channels)if(a.gateway){c=c.data.gateways;var f;for(f=0;f<
  c.length;f++)if(c[f].index===a.gateway){var h=c[f];break}h?d(null,a):d(new b(e.NOT_FOUND,"gateway with index "+a.gateway+" not exists"))}else d(new b(e.INVALID,"gateway is invalid"));else d(new b(e.INVALID,"channels is invalid"));else d(new b(e.INVALID,"type is invalid"));else d(new b(e.INVALID,"interface is invalid"));else d(new b(e.INVALID,"address is invalid"));else d(new b(e.INVALID,"info is invalid"))},deleteDevice:function(a,c,d){d()},_getChannels:function(a){var c={},d=void 0==xnm.aio.hm.TYPE[a.type];
  a=d?a.channels:xnm.aio.hm.CATAGORY[xnm.aio.hm.TYPE[a.type]].channels;for(var b in a)if(a.hasOwnProperty(b)){var e=d?0:a[b];xnm.aio.hm.CHANNEL[b]&&xnm.aio.hm.CHANNEL[b].datapoints[e]&&(c[b]=xnm.aio.hm.CHANNEL[b].datapoints[e])}return c},_getHmIPChannels:function(a){var c={},d=void 0==xnm.aio.hm.HMIP_TYPE[a.type];a=d?a.channels:xnm.aio.hm.HMIP_CATAGORY[xnm.aio.hm.HMIP_TYPE[a.type]].channels;for(var b in a)if(a.hasOwnProperty(b)){var e=d?0:a[b];xnm.aio.hm.HMIP_CHANNEL[b]&&xnm.aio.hm.HMIP_CHANNEL[b].datapoints[e]&&
  (c[b]=xnm.aio.hm.HMIP_CHANNEL[b].datapoints[e])}c.KEY_TRANSCEIVER&&delete c.KEY_TRANSCEIVER;return c},_getCUxDChannels:function(a){var c={};a.cuxd||(a.cuxd=xnm.aio.hm.MHMCCU._resolveCUxDType(a));var d=a.cuxd?!1:!0,b=a.channels,e;for(e in b)if(b.hasOwnProperty(e)){var f=d?0:xnm.aio.hm.CUxDTYPE[a.cuxd][e];xnm.aio.hm.CUxDCHANNEL[e]&&xnm.aio.hm.CUxDCHANNEL[e].datapoints[f]?c[e]=xnm.aio.hm.CUxDCHANNEL[e].datapoints[f]:xnm.aio.hm.CHANNEL[e]&&xnm.aio.hm.CHANNEL[e].datapoints[f]&&(f=0,c[e]=xnm.aio.hm.CHANNEL[e].datapoints[f])}return c},
  applyUIFilter:function(a,c){var d=this,b=function(a,b){if("*"==a)return!0;for(var c=!1,d=0;d<a.length;d++)if(a[d]==b){c=!0;break}return c},e=function(a,b){switch(a.type){case "SysVar":return h(a,b);case "Prog":return f(a,b);default:return r(a,b)}},f=function(a,c){var d=[],e=c.elems;switch(c.catagory){case "command":[{type:"enum",name:"execute",ref:{value:"progExec"}}].forEach(function(a){b(e,a.type)&&(a=JSON.parse(JSON.stringify(a)),d.push(a))})}return d},h=function(a,c){var d=[],e=c.elems;if(a["class"]&&
  (a=xnm.aio.hm.MAP.SysVar[a["class"]]))switch(c.catagory){case "command":a.command&&a.command.forEach(function(a){b(e,a.type)&&(a=JSON.parse(JSON.stringify(a)),d.push(a))});break;case "status":a.status&&a.status.forEach(function(a){b(e,a.type)&&(a=JSON.parse(JSON.stringify(a)),d.push(a))})}return d},g=function(a,d,e,f,g){var h=[];if(a=a[d][e])switch(c.catagory){case "command":a.command&&f.access&&-1!=f.access.indexOf("w")&&a.command.forEach(function(a){b(g,a.type)&&(a=JSON.parse(JSON.stringify(a)),
  h.push(a))});break;case "status":a.status&&f.access&&-1!=f.access.indexOf("r")&&a.status.forEach(function(a){b(g,a.type)&&(a=JSON.parse(JSON.stringify(a)),h.push(a))})}return h},l=function(a,c){var d=[],e=c.elems;switch(c.catagory){case "command":a.command&&a.command.forEach(function(a){b(e,a.type)&&(a=JSON.parse(JSON.stringify(a)),d.push(a))});break;case "status":a.status&&a.status.forEach(function(a){b(e,a.type)&&(a=JSON.parse(JSON.stringify(a)),d.push(a))})}return d},k=function(a,b){if(a){var c=
  xnm.aio.hm.HmIPDevice.resolveJSON(a);if(c&&c.getCommandStatusMap&&(c=c.getCommandStatusMap(a)))return l(c,b)}c=[];var d=a.channels;a=xnm.aio.hm.DM._getHmIPChannels(a);var e=b.elems,f;for(f in d)if(d.hasOwnProperty(f)){var h=a[f];if(h)for(var k in h)h.hasOwnProperty(k)&&xnm.aio.hm.HMIP_MAP[f]&&(b=g(xnm.aio.hm.HMIP_MAP,f,k,h[k],e),c=c.concat(b))}return c},n=function(a,c){var d=[],e=c.elems;a=xnm.aio.hm.HM_Sec_Sir_WM_MAP;switch(c.catagory){case "command":a.command.forEach(function(a){b(e,a.type)&&(a=
  JSON.parse(JSON.stringify(a)),d.push(a))});break;case "status":a.status.forEach(function(a){b(e,a.type)&&(a=JSON.parse(JSON.stringify(a)),d.push(a))})}return d},q=function(a,c){var d=[],e=c.elems;a=xnm.aio.hm.HM_WDS30_OT2_SM_2_MAP;switch(c.catagory){case "status":a.status.forEach(function(a){b(e,a.type)&&(a=JSON.parse(JSON.stringify(a)),d.push(a))})}return d},p=function(a,c){var d=[],e=c.elems;a=xnm.aio.hm.HM_ES_TX_WM_MAP;switch(c.catagory){case "status":a.status.forEach(function(a){b(e,a.type)&&
  (a=JSON.parse(JSON.stringify(a)),d.push(a))})}return d},t=function(a,c){var d=[],e=c.elems;a=[{type:"int",name:"dim to",ref:{value:"dimRaw",ext:"%d",extMeta:"0-100",scale:"10"}}];switch(c.catagory){case "command":a.forEach(function(a){b(e,a.type)&&(a=JSON.parse(JSON.stringify(a)),d.push(a))})}return d},r=function(a,b){if("HmIP-HEATING"==a.type)return k(a,b);if(a["interface"]&&"CUxD"==a["interface"]){var c=[];a.cuxd||(a.cuxd=xnm.aio.hm.MHMCCU._resolveCUxDType(a));var e=a.channels,f=xnm.aio.hm.DM._getCUxDChannels(a),
  h=b.elems,m;for(m in e)if(e.hasOwnProperty(m)){var r=f[m];if(r)for(var u in r)r.hasOwnProperty(u)&&("FHT_Multiventil"==a.cuxd&&"DIMMER"==m?m="FHT_Multiventil_Dimmer":"HMS_100_Contact"==a.cuxd&&"SENSOR"==m?m="HMS_100_Contact":"FHT_Contact"==a.cuxd&&"SENSOR"==m?m="FHT_Contact":"Security_Sensor"==a.cuxd&&"SENSOR"==m?m="Security_Sensor":"HMS_100_W/WD"==a.cuxd&&"SENSOR"==m&&(m="Security_Sensor"),xnm.aio.hm.CUxDMAP[m]?(b=g(xnm.aio.hm.CUxDMAP,m,u,r[u],h),c=c.concat(b)):xnm.aio.hm.MAP[m]&&(b=g(xnm.aio.hm.MAP,
  m,u,r[u],h),c=c.concat(b)))}return c}if(a["interface"]&&"HmIP-RF"==a["interface"])return k(a,b);if(a["interface"]&&"BidCos-RF"==a["interface"]&&a.type&&xnm.aio.hm.BidCosDevice[a.type]&&(m=xnm.aio.hm.BidCosDevice[a.type])&&m.getCommandStatusMap&&(m=m.getCommandStatusMap(a))||a["interface"]&&"VirtualDevices"==a["interface"]&&-1==a.type.indexOf("HM-CC-VG")&&(m=d._getVirtualDevicesMap(a)))return l(m,b);if("DimmerKey"==a.type)return t(a,b);if("HM-Sec-Sir-WM"==a.type)return n(a,b);if("HM-WDS30-OT2-SM-2"==
  a.type)return q(a,b);if("HM-ES-TX-WM"==a.type&&a.channels&&a.channels.POWERMETER_IEC1)return p(a,b);m=[];u=a.channels;a=xnm.aio.hm.DM._getChannels(a);f=b.elems;for(c in u)if(u.hasOwnProperty(c)&&(h=a[c]))for(e in h)h.hasOwnProperty(e)&&xnm.aio.hm.MAP[c]&&(b=g(xnm.aio.hm.MAP,c,e,h[e],f),m=m.concat(b));return m};if(!a.type)return null;var w=JSON.parse(JSON.stringify(a)),u=null;switch(c.catagory){case "command":u=e(a,c);w.command=u;break;case "status":u=e(a,c);w.status=u;break;default:return null}return u&&
  0!=u.length?w:null},applyUIFilterGateway:function(a,c){var d=function(a,b){if("*"==a)return!0;for(var c=!1,d=0;d<a.length;d++)if(a[d]==b){c=!0;break}return c},b=function(a,b){var c=[],e=b.elems;if(a=xnm.aio.hm.MAP.CCU)switch(b.catagory){case "command":a.command&&a.command.forEach(function(a){d(e,a.type)&&(a=JSON.parse(JSON.stringify(a)),c.push(a))});break;case "status":a.status&&a.status.forEach(function(a){d(e,a.type)&&(a=JSON.parse(JSON.stringify(a)),c.push(a))})}return c},e=JSON.parse(JSON.stringify(a)),
  f=null;switch(c.catagory){case "command":f=b(a,c);e.command=f;break;case "status":f=b(a,c);e.status=f;break;default:return null}return f&&0!=f.length?e:null},applyIPEventFilter:function(a){if(!a||"SysVar"==a.type)return null;if("HM-MOD-EM-8Bit"==a.type){var c={};c.ipevt=xnm.aio.hm.HM_MOD_EM_8BIT_MAP.ipevt;return c}if("VirtualDevices"==a["interface"])return null;if("HmIP-RF"==a["interface"]&&a.type&&(c=xnm.aio.hm.HmIPDevice.resolveJSON(a))&&c.getIPEvtMap&&(c=c.getIPEvtMap(a))&&c.ipevt)return{ipevt:c.ipevt};
  c=xnm.aio.hm.DM.applyUIFilter(a,{catagory:"status",elems:"*"});"HmIP-RF"==a["interface"]&&a.type&&a.channels&&a.channels.KEY_TRANSCEIVER&&(c||(c={}),c.ipevt||(c.ipevt=[]),c.ipevt.push({type:"enum",name:"short press",ref:{value:"pressShort",options:["true"]}}),c.ipevt.push({type:"enum",name:"long press",ref:{value:"pressLong",options:["true"]}}));"BidCos-Wired"==a["interface"]&&a.channels&&(a.channels.KEY||a.channels.VIRTUAL_KEY)&&(c||(c={}),c.ipevt||(c.ipevt=[]),c.ipevt.push({type:"enum",name:"short press",
  ref:{value:"pressShort",options:["true"]}}),c.ipevt.push({type:"enum",name:"long press",ref:{value:"pressLong",options:["true"]}}));"BidCos-RF"==a["interface"]&&a.channels&&(a.channels.KEY||a.channels.VIRTUAL_KEY)&&(c||(c={}),c.ipevt||(c.ipevt=[]),c.ipevt.push({type:"enum",name:"short press",ref:{value:"pressShort",options:["true"]}}),c.ipevt.push({type:"enum",name:"long press",ref:{value:"pressLong",options:["true"]}}));if(!c)return null;c.ipevt||(c.ipevt=[]);c.status&&(c.ipevt=c.ipevt.concat(c.status),
  delete c.status);return c},_insertIntoArray:function(a,c){for(var d=-1,b=0;b<c.length;b++)if(c[b].index>a.index){d=b;break}-1===d?c.push(a):c.splice(d,0,a)},_getVirtualDevicesMap:function(a){if(!a||!a.channels)return null;var c={command:[],status:[]},d;for(d in a.channels)if(a=xnm.aio.hm.VirtualDevice_MAP[d])for(var b in a){var e=a[b];e&&e.command&&(c.command=c.command.concat(e.command));e&&e.status&&(c.status=c.status.concat(e.status))}return c},supportSmartWidget:function(a){if(!a||"Prog"==a.type||
  "Sysvar"==a.type)return!1;var c=a.channels;if(!c)return!1;var d={},b;for(b in c)if(c.hasOwnProperty(b)){var e=b,f=e.indexOf(":");-1!=f&&(e=e.substr(0,f));d[e]=!0}return"BidCos-RF"==a["interface"]?d.SWITCH||d.DIMMER||d.VIRTUAL_DIMMER||d.BLIND||d.JALOUSIE||d.POWERMETER||d.CLIMATECONTROL_REGULATOR||d.THERMALCONTROL_TRANSMIT||d.CLIMATECONTROL_RT_TRANSCEIVER||d.SHUTTER_CONTACT||d.ROTARY_HANDLE_SENSOR||d.WEATHER||d.MOTION_DETECTOR||d.SMOKE_DETECTOR||d.SMOKE_DETECTOR_TEAM||d.SMOKE_DETECTOR_TEAM_V2||d.RGBW_COLOR||
  d.KEYMATIC||d.WINMATIC||d.SENSOR_FOR_CARBON_DIOXIDE||d.WATERDETECTIONSENSOR?!0:!1:a["interface"]&&"HMIP-RF"==a["interface"].toUpperCase()?d.SWITCH_VIRTUAL_RECEIVER||d.DIMMER_VIRTUAL_RECEIVER||d.SHUTTER_VIRTUAL_RECEIVER||d.BLIND_VIRTUAL_RECEIVER||d.ENERGIE_METER_TRANSMITTER||d.HEATING_CLIMATECONTROL_TRANSCEIVER||d.SHUTTER_CONTACT_TRANSCEIVER||d.ROTARY_HANDLE_TRANSCEIVER||d.CLIMATE_TRANSCEIVER||d.WEATHER_TRANSMIT||d.SHUTTER_CONTACT||d.MOTIONDETECTOR_TRANSCEIVER||d.SMOKE_DETECTOR||d.ANALOG_OUTPUT_TRANSCEIVER?
  !0:!1:"BidCos-Wired"==a["interface"]?d.DIGITAL_OUTPUT||d.DIGITAL_ANALOG_OUTPUT||d.SWITCH||d.DIMMER||d.BLIND?!0:!1:!1},applySmartWidgetFilter:function(a,c,d){return a&&"Prog"!=a.type&&"Sysvar"!=a.type?"BidCos-RF"==a["interface"]||"BidCos-Wired"==a["interface"]?this._applySmartWidget_BidCos(a,c,d):a["interface"]&&"HMIP-RF"==a["interface"].toUpperCase()?this._applySmartWidget_HmIP(a,c,d):null:null},_applySmartWidget_BidCos:function(a,c,d,b,e){if(!a.channels)return null;b={};for(var f in a.channels)if(a.channels.hasOwnProperty(f)){e=
  f;var h=e.indexOf(":");-1!=h&&(e=e.substr(0,h));b[e]=!0}if(b.DIGITAL_OUTPUT){var g={"%on%":{value:"digOutOn",name:"on"},"%off%":{value:"digOutOff",name:"off"},"%toggle%":{value:"digOutToggle",name:"toggle"}};var l={"%switchState%":{value:"digOutState",options:["off","on"],name:"state"}};var k=["switch"]}b.DIGITAL_ANALOG_OUTPUT&&(g={"%on%":{value:"daOutOn",name:"on"},"%off%":{value:"daOutOff",name:"off"},"%toggle%":{value:"daOutToggle",name:"toggle"}},l={"%switchState%":{value:"daOutState",options:["off",
  "on"],name:"state"}},k=["switch"]);b.SWITCH&&(g={"%on%":{value:"on",name:"on"},"%off%":{value:"off",name:"off"},"%toggle%":{value:"toggle",name:"toggle"}},l={"%switchState%":{value:"switchState",options:["off","on"],name:"switch status"}},k=["switch"]);if(b.DIMMER||b.VIRTUAL_DIMMER)g={"%on%":{value:"dimOn",name:"on"},"%off%":{value:"dimOff",name:"off"},"%dimOn%":{value:"dimOn",name:"on"},"%dimOff%":{value:"dimOff",name:"off"},"%dimUp%":{value:"dimUp",name:"dim up"},"%dimDown%":{value:"dimDown",name:"dim down"},
  "%dimTo%":{value:"dimRaw",ext:"%d",extMeta:"0-100",name:"dim to"}},l={"%dimmerState%":{value:"dimmerLevel",ext:"%d",extMeta:"0-100",name:"dimmer status"}},k=["switch","dimmer"];b.BLIND&&(g||(g={}),g["%stop%"]||(g["%stop%"]={value:"blindStop",name:"stop"}),g["%moveUp%"]||(g["%moveUp%"]={value:"blindUp",name:"move up"}),g["%moveDown%"]||(g["%moveDown%"]={value:"blindDown",name:"move down"}),g["%stepUp%"]||(g["%stepUp%"]={value:"blindStepUp",name:"step up"}),g["%stepDown%"]||(g["%stepDown%"]={value:"blindStepDown",
  name:"step down"}),g["%moveTo%"]||(g["%moveTo%"]={value:"blindRaw",ext:"%d",extMeta:"0-100",name:"move to"}),l={"%shutterState%":{value:"blindLevel",ext:"%d",extMeta:"0-100",name:"blind status"}},k=["shutter"]);b.JALOUSIE&&(g||(g={}),g["%stop%"]||(g["%stop%"]={value:"jalStop",name:"stop"}),g["%moveUp%"]||(g["%moveUp%"]={value:"jalUp",name:"move up"}),g["%moveDown%"]||(g["%moveDown%"]={value:"jalDown",name:"move down"}),g["%stepUp%"]||(g["%stepUp%"]={value:"jalStepUp",name:"step up"}),g["%stepDown%"]||
  (g["%stepDown%"]={value:"jalStepDown",name:"step down"}),g["%moveTo%"]||(g["%moveTo%"]={value:"jalRaw",ext:"%d",extMeta:"0-100",name:"move to"}),g["%lamellaUp%"]||(g["%lamellaUp%"]={value:"jalLmlUp",name:"lamella up"}),g["%lamellaDown%"]||(g["%lamellaDown%"]={value:"jalLmlDown",name:"lamella down"}),g["%lamellaStepUp%"]||(g["%lamellaStepUp%"]={value:"jalLmlStepUp",name:"lamella step up",ext:10}),g["%lamellaStepDown%"]||(g["%lamellaStepDown%"]={value:"jalLmlStepDown",name:"lamella step down",ext:10}),
  g["%lamellaTo%"]||(g["%lamellaTo%"]={value:"jalLmlRaw",ext:"%d",extMeta:"0-100",name:"lamella to"}),l={"%blindState%":{value:"jalLevel",ext:"%d",extMeta:"0-100",name:"status"},"%lamellaState%":{value:"jalLmlLevel",ext:"%d",extMeta:"0-100",name:"lamella status"}},k=["shutter","blind"]);b.POWERMETER&&(l||(l={}),l["%meterVoltage%"]||(l["%meterVoltage%"]={value:"meterVoltage",extMeta:"0.0-6553.5",scale:"0.1",unit:"V",name:"voltage"}),l["%meterEnergyCounter%"]||(l["%meterEnergyCounter%"]={value:"meterEnergyCounter",
  extMeta:"0.0-838860.7",scale:"0.1",unit:"Wh",name:"energy counter"}),l["%meterFrequency%"]||(l["%meterFrequency%"]={value:"meterFrequency",extMeta:"48.72-51.27",scale:"0.01",unit:"Hz",name:"frequency"}),l["%meterPower%"]||(l["%meterPower%"]={value:"meterPower",extMeta:"0.0-167772.15",scale:"0.1",unit:"W",name:"power"}),l["%meterCurrent%"]||(l["%meterCurrent%"]={value:"meterCurrent",extMeta:"0.0-65535.0",scale:"0.1",unit:"mA",name:"current"}),k||(k=[]),-1==k.indexOf("powermeter")&&k.push("powermeter"));
  b.CLIMATECONTROL_REGULATOR&&(g||(g={}),g["%thermoTempUp%"]||(g["%thermoTempUp%"]={value:"themoRTempUp",name:"temperature up"}),g["%thermoTempDown%"]||(g["%thermoTempDown%"]={value:"themoRTempDown",name:"temperature down"}),g["%thermoTempTo%"]||(g["%thermoTempTo%"]={value:"themoRTempRaw",ext:"%f",extMeta:"6-30",scale:"0.5",name:"temperature to"}),g["%thermoOn%"]||(g["%thermoOn%"]={value:"themoTempOn",name:"on"}),g["%thermoOff%"]||(g["%thermoOff%"]={value:"themoRTempClose",name:"close"}),l={"%thermoCurrentTemp%":{value:"weatherTemp",
  name:"temperature"},"%thermoHum%":{value:"weatherHum",name:"humidity"},"%thermoSetTemp%":{value:"themoRSetTemp",extMeta:"6-30",scale:"0.5",name:"set temperature"}},k=["thermostat"]);b.THERMALCONTROL_TRANSMIT&&(g||(g={}),g["%thermoAuto%"]||(g["%thermoAuto%"]={value:"themoTAutoMode",name:"set auto mode"}),g["%thermoManu%"]||(g["%thermoManu%"]={value:"themoTManuMode",ext:"20.0",name:"set manual mode"}),g["%thermoBoost%"]||(g["%thermoBoost%"]={value:"themoTBoostMode",name:"set boost mode"}),g["%thermoTempUp%"]||
  (g["%thermoTempUp%"]={value:"themoTTempUp",name:"temperature up"}),g["%thermoTempDown%"]||(g["%thermoTempDown%"]={value:"themoTTempDown",name:"temperature down"}),g["%thermoTempTo%"]||(g["%thermoTempTo%"]={value:"themoTTempRaw",ext:"%f",extMeta:"4.5-30.5",scale:"0.5",name:"temperature to"}),g["%thermoOff%"]||(g["%thermoOff%"]={value:"themoTTempOff",name:"off"}),l={"%thermoCurrentTemp%":{value:"themoTActualTemp",name:"actual temperature"},"%thermoHum%":{value:"themoTActualHum",name:"actual humidity"},
  "%thermoMode%":{value:"themoTMode",options:["auto","manu","party","boost"],name:"mode"},"%thermoSetTemp%":{value:"themoTSetTemp",extMeta:"4.5-30.5",scale:"0.5",name:"set temperature"},"%thermoWindow%":{value:"themoTWin",options:["open","closed"],name:"window open"}},k=["thermostat"]);b.CLIMATECONTROL_RT_TRANSCEIVER&&(g||(g={}),g["%thermoAuto%"]||(g["%thermoAuto%"]={value:"themoAutoMode",name:"set auto mode"}),g["%thermoManu%"]||(g["%thermoManu%"]={value:"themoManuMode",ext:"20.0",name:"set manual mode"}),
  g["%thermoBoost%"]||(g["%thermoBoost%"]={value:"themoBoostMode",name:"set boost mode"}),g["%thermoTempUp%"]||(g["%thermoTempUp%"]={value:"themoTempUp",name:"temperature up"}),g["%thermoTempDown%"]||(g["%thermoTempDown%"]={value:"themoTempDown",name:"temperature down"}),g["%thermoTempTo%"]||(g["%thermoTempTo%"]={value:"themoTempRaw",ext:"%f",extMeta:"4.5-30.5",scale:"0.5",name:"temperature to"}),g["%thermoOff%"]||(g["%thermoOff%"]={value:"themoTempOff",name:"off"}),l={"%thermoCurrentTemp%":{value:"themoActualTemp",
  name:"actual temperature"},"%thermoHum%":{value:"themoActualHum",name:"actual humidit"},"%thermoMode%":{value:"themoMode",options:["auto","manu","party","boost"],name:"mode"},"%thermoSetTemp%":{value:"themoSetTemp",extMeta:"4.5-30.5",scale:"0.5",name:"set temperature"},"%thermoWindow%":{value:"themoWinState",options:["open","closed"],name:"window state"}},k=["thermostat"]);b.SHUTTER_CONTACT&&(l={"%contactState%":{value:"shutterState",options:["closed","open"],name:"shutter state"}},k=["contact"]);
  b.ROTARY_HANDLE_SENSOR&&(l={"%windowState%":{value:"handleState",options:["closed","tilted","open"],name:"handle state"}},k=["window"]);b.WEATHER&&((a=a.type)&&"HM-WDS30"==a.substr(0,8)?(l={"%tempState%":{value:"weatherTemp",name:"temperature"}},k=["climate"]):a&&"HM-WDS100"==a.substr(0,9)?(l={"%tempState%":{value:"weatherTemp",name:"temperature"},"%humState%":{value:"weatherHum",name:"humidity"},"%brightnessState%":{value:"weatherBright",name:"brightness"},"%sunshineState%":{value:"weatherSunD",
  name:"sunshine duration"},"%windDirection%":{value:"weatherWindD",name:"wind direction",options:"N NO O SO S SW W NW".split(" ")},"%windspeedState%":{value:"weatherWindS",name:"wind speed"},"%rainingState%":{value:"weatherRaining",name:"raining"},"%rainingCounterState%":{value:"weatherRainCounter",name:"rain counter"}},k=["weather_station"]):(l={"%tempState%":{value:"weatherTemp",name:"temperature"},"%humState%":{value:"weatherHum",name:"humidity"}},k=["climate"]));b.MOTION_DETECTOR&&(l={"%motionState%":{value:"motionState",
  options:["on","off"],name:"state"},"%motionBrightness%":{value:"motionBright",name:"brightness"}},k=["motion"]);b.SMOKE_DETECTOR&&(l={"%smokeState%":{value:"smokeState",options:["on","off"],name:"state"}},k=["smoke"]);b.SMOKE_DETECTOR_TEAM&&(l={"%smokeState%":{value:"smokeGroup1State",options:["on","off"],name:"state"}},k=["smoke"]);b.SMOKE_DETECTOR_TEAM_V2&&(l={"%smokeState%":{value:"smokeGroupState",options:["on","off"],name:"state"}},k=["smoke"]);b.RGBW_COLOR&&(g||(g={}),g["%rgb%"]||(g["%rgb%"]=
  {value:"rgb",ext:"%s",name:"rgb color"}),g["%white%"]||(g["%white%"]={value:"white",name:"white"}),k||(k=[]),-1==k.indexOf("rgb")&&k.push("rgb"));b.WINMATIC&&(g||(g={}),g["%windowUp%"]||(g["%windowUp%"]={value:"windowUp"}),g["%windowDown%"]||(g["%windowDown%"]={value:"windowDown"}),g["%windowTo%"]||(g["%windowTo%"]={value:"windowTo",ext:"%d",extMeta:"0-100"}),g["%windowLock%"]||(g["%windowLock%"]={value:"winLock"}),g["%windowStop%"]||(g["%windowStop%"]={value:"winStop"}),l={"%windowLevel%":{value:"winLevel"}},
  k=["winmatic"]);b.KEYMATIC&&(g||(g={}),g["%lock%"]||(g["%lock%"]={value:"keyLock"}),g["%unlock%"]||(g["%unlock%"]={value:"keyOpen"}),g["%open%"]||(g["%open%"]={value:"keyOpenDo"}),l={"%lockStatus%":{value:"keyState",options:["open","lock"]}},k=["keymatic"]);b.SENSOR_FOR_CARBON_DIOXIDE&&(l={"%co2State%":{value:"co2State",options:["normal","added","added_strong"]}},k=["sensor_co2"]);b.WATERDETECTIONSENSOR&&(l={"%waterState%":{value:"waterState",options:["dry","wet","water"]}},k=["sensor_water"]);return k&&
  0!=k.length?this._injectToSmartWidgetTemplate(c,k,d,g,l):null},_applySmartWidget_HmIP:function(a,c,d,b,e){if(!a.channels||"HmIP-WGC"==a.type)return null;var f,h,g;if("HmIP-BSL"==a.type)return f||(f={}),f["%on%"]||(f["%on%"]={value:"on",name:"on"}),f["%off%"]||(f["%off%"]={value:"off",name:"off"}),f["%toggle%"]||(f["%toggle%"]={value:"toggle",name:"toggle"}),h||(h={}),h["%switchState%"]||(h["%switchState%"]={value:"switchState",options:["off","on"],name:"switch status"}),this._injectToSmartWidgetTemplate(c,
  ["switch"],d,f,h);b={};for(var l in a.channels)if(a.channels.hasOwnProperty(l)){e=l;var k=e.indexOf(":");-1!=k&&(e=e.substr(0,k));b[e]=!0}b.SWITCH_VIRTUAL_RECEIVER&&(f||(f={}),"HmIP-BSM"==a.type?(f["%on%"]||(f["%on%"]={value:"ch4on",name:"ch.4 on"}),f["%off%"]||(f["%off%"]={value:"ch4off",name:"ch.4 off"}),f["%toggle%"]||(f["%toggle%"]={value:"ch4toggle",name:"ch.4 toggle"})):(f["%on%"]||(f["%on%"]={value:"on",name:"on"}),f["%off%"]||(f["%off%"]={value:"off",name:"off"}),f["%toggle%"]||(f["%toggle%"]=
  {value:"toggle",name:"toggle"})),h||(h={}),h["%switchState%"]||(h["%switchState%"]={value:"switchState",options:["off","on"],name:"switch status"}),g||(g=[]),-1==g.indexOf("switch")&&g.push("switch"));b.DIMMER_VIRTUAL_RECEIVER&&(f||(f={}),f["%on%"]||(f["%on%"]={value:"dimTo",ext:100,name:"dim to"}),f["%off%"]||(f["%off%"]={value:"dimOff",name:"off"}),f["%dimOn%"]||(f["%dimOn%"]={value:"dimTo",ext:100,name:"dim to"}),f["%dimOff%"]||(f["%dimOff%"]={value:"dimOff",name:"off"}),f["%dimUp%"]||(f["%dimUp%"]=
  {value:"dimUp",ext:5,name:"dim up"}),f["%dimDown%"]||(f["%dimDown%"]={value:"dimDown",ext:5,name:"dim down"}),f["%dimTo%"]||(f["%dimTo%"]={value:"dimTo",ext:"%d",extMeta:"0-100",name:"dim to"}),h={"%dimmerState%":{value:"dimmerTLevel",ext:"%d",extMeta:"0-100",name:"dimmer status"}},g=["switch","dimmer"]);b.SHUTTER_VIRTUAL_RECEIVER&&(f||(f={}),f["%stop%"]||(f["%stop%"]={value:"stop",name:"stop"}),f["%moveUp%"]||(f["%moveUp%"]={value:"moveUp",name:"move up"}),f["%moveDown%"]||(f["%moveDown%"]={value:"moveDown",
  name:"move down"}),f["%stepUp%"]||(f["%stepUp%"]={value:"stepUp",ext:5,name:"step up"}),f["%stepDown%"]||(f["%stepDown%"]={value:"stepDown",ext:5,name:"step down"}),f["%moveTo%"]||(f["%moveTo%"]={value:"moveTo",ext:"%d",extMeta:"0-100",name:"move to"}),h={"%shutterState%":{value:"blindTLevel",ext:"%d",extMeta:"0-100",name:"blind status"}},g=["shutter"]);b.BLIND_VIRTUAL_RECEIVER&&(f||(f={}),f["%stop%"]||(f["%stop%"]={value:"stop",name:"stop"}),f["%moveUp%"]||(f["%moveUp%"]={value:"moveUp",name:"move up"}),
  f["%moveDown%"]||(f["%moveDown%"]={value:"moveDown",name:"move down"}),f["%stepUp%"]||(f["%stepUp%"]={value:"stepUp",ext:5,name:"step up"}),f["%stepDown%"]||(f["%stepDown%"]={value:"stepDown",ext:5,name:"step down"}),f["%moveTo%"]||(f["%moveTo%"]={value:"moveTo",ext:"%d",extMeta:"0-100",name:"move to"}),f["%lamellaUp%"]||(f["%lamellaUp%"]={value:"lamellaUp",name:"lamella up"}),f["%lamellaDown%"]||(f["%lamellaDown%"]={value:"lamellaDown",name:"lamella down"}),f["%lamellaStepUp%"]||(f["%lamellaStepUp%"]=
  {value:"lamellaStepUp",ext:5,name:"lamella step up"}),f["%lamellaStepDown%"]||(f["%lamellaStepDown%"]={value:"lamellaStepDown",ext:5,name:"lamella step down"}),f["%lamellaTo%"]||(f["%lamellaTo%"]={value:"lamellaTo",ext:"%d",extMeta:"0-100",name:"lamella to"}),h={"%blindState%":{value:"blindTPos",ext:"%d",extMeta:"0-100",name:"blind status"},"%lamellaState%":{value:"lamellaTPos",ext:"%d",extMeta:"0-100",name:"lamella status"}},g=["shutter","blind"]);b.ENERGIE_METER_TRANSMITTER&&(h||(h={}),h["%meterVoltage%"]||
  (h["%meterVoltage%"]={value:"meterVoltage",extMeta:"0.0-409.5",scale:"0.1",unit:"V",name:"voltage"}),h["%meterEnergyCounter%"]||(h["%meterEnergyCounter%"]={value:"meterEnergyCounter",extMeta:"0.0-838859.1",scale:"0.1",unit:"Wh",name:"energy counter"}),h["%meterFrequency%"]||(h["%meterFrequency%"]={value:"meterFrequency",extMeta:"29.52-70.47",scale:"0.01",unit:"Hz",name:"frequency"}),h["%meterPower%"]||(h["%meterPower%"]={value:"meterPower",extMeta:"0.0-163830.0",scale:"0.1",unit:"W",name:"power"}),
  h["%meterCurrent%"]||(h["%meterCurrent%"]={value:"meterCurrent",extMeta:"0.0-65535.0",scale:"0.1",unit:"mA",name:"current"}),g||(g=[]),-1==g.indexOf("powermeter")&&g.push("powermeter"));b.HEATING_CLIMATECONTROL_TRANSCEIVER&&(f||(f={}),f["%thermoAuto%"]||(f["%thermoAuto%"]={value:"themoAutoMode",name:"set auto mode"}),f["%thermoManu%"]||(f["%thermoManu%"]={value:"themoManuMode",name:"set manu mode"}),f["%thermoBoost%"]||(f["%thermoBoost%"]={value:"themoBoostOn",name:"boost on"}),f["%thermoTempUp%"]||
  (f["%thermoTempUp%"]={value:"themoTempUp",name:"temperature up"}),f["%thermoTempDown%"]||(f["%thermoTempDown%"]={value:"themoTempDown",name:"temperature down"}),f["%thermoTempTo%"]||(f["%thermoTempTo%"]={value:"themoTemp",ext:"%f",extMeta:"4.5-30.5",scale:"0.5",name:"set temperature"}),f["%thermoOn%"]||(f["%thermoOn%"]={value:"themoTempOn",name:"on"}),f["%thermoOff%"]||(f["%thermoOff%"]={value:"themoTempOff",name:"off"}),f["%thermoBoostOff%"]||(f["%thermoBoostOff%"]={value:"themoBoostOff",name:"boost off"}),
  f["%thermoProfile%"]||(f["%thermoProfile%"]={value:"themoProf",ext:"%d",extMeta:"1-6",scale:"1",name:"set profile"}),h={"%thermoCurrentTemp%":{value:"themoActualTemp",name:"actual temperature"},"%thermoHum%":{value:"themoHum",name:"humidity"},"%thermoMode%":{value:"themoMode",options:["auto","manu"],name:"mode"},"%thermoSetTemp%":{value:"themoTemp",extMeta:"4.5-30.5",scale:"0.5",name:"set temperature"},"%thermoProfile%":{value:"themoProf",ext:"%d",extMeta:"1-6",scale:"1",name:"set profile"},"%thermoBoostMode%":{value:"themoBoostMode",
  options:["off","on"],name:"boost mode"},"%thermoWindow%":{value:"themoWinState",options:["open","closed"],name:"window state"}},g=["thermostat"]);b.SHUTTER_CONTACT&&(h={"%contactState%":{value:"shutterState",options:["closed","open"],name:"shutter state"}},g=["contact"]);b.SHUTTER_CONTACT_TRANSCEIVER&&(h={"%contactState%":{value:"shutterTState",options:["closed","open"],name:"shutter state"}},g=["contact"]);b.ROTARY_HANDLE_TRANSCEIVER&&(h={"%windowState%":{value:"handleState",options:["closed","tilted",
  "open"],name:"handle state"}},g=["window"]);b.CLIMATE_TRANSCEIVER&&(h={"%tempState%":{value:"climateActualTemp",extMeta:"-3276.8-3276.7",scale:"0.1",name:"actual temperature"},"%humState%":{value:"climateHum",name:"humidity"}},g=["climate"]);b.WEATHER_TRANSMIT&&(h={"%tempState%":{value:"weatherActualTemp",name:"actual temperature"},"%humState%":{value:"weatherHum",name:"humidity"},"%brightnessState%":{value:"weatherIllu",name:"brightness"},"%sunshineState%":{value:"weatherSunD",name:"sunshine duration"},
  "%windspeedState%":{value:"weatherWindS",name:"wind speed"},"%rainingState%":{value:"weatherRain",name:"raining"},"%rainingCounterState%":{value:"weatherRainC",name:"rain counter"}},g=["weather_station"]);b.MOTIONDETECTOR_TRANSCEIVER&&(f||(f={}),f["%motionActivate%"]||(f["%motionActivate%"]={value:"motionOn",name:"activate detection"}),f["%motionDeactivate%"]||(f["%motionDeactivate%"]={value:"motionOff",name:"deactivate detection"}),f["%motionToggle%"]||(f["%motionToggle%"]={value:"motionToggle",
  name:"toggle detection"}),f["%motionReset%"]||(f["%motionReset%"]={value:"motionReset",name:"reset"}),h={"%motionState%":{value:"motionState",options:["on","off"],name:"state",conv_s:{on:"true",off:"false"}},"%motionBrightness%":{value:"motionIllu",name:"illumination"},"%motionActivate%":{value:"motionActivate",options:["off","on"],name:"detection activated"}},g=["motion"]);b.SMOKE_DETECTOR&&(h={"%smokeState%":{value:"smokeState",options:["on","off"],name:"alarm state"}},g=["smoke"]);b.ANALOG_OUTPUT_TRANSCEIVER&&
  (f||(f={}),f["%dimOn%"]||(f["%dimOn%"]={value:"analogOutputTo",ext:100,name:"output to"}),f["%dimOff%"]||(f["%dimOff%"]={value:"analogOutputOff",name:"off"}),f["%dimUp%"]||(f["%dimUp%"]={value:"analogOutputUp",ext:5,name:"up"}),f["%dimDown%"]||(f["%dimDown%"]={value:"analogOutputDown",ext:5,name:"down"}),f["%dimTo%"]||(f["%dimTo%"]={value:"analogOutputTo",ext:"%d",extMeta:"0-100",name:"output to"}),h={"%dimmerState%":{value:"analogOutputLevel",ext:"%d",extMeta:"0-100",name:"output status"}},g=["dimmer"]);
  return g&&0!=g.length?this._injectToSmartWidgetTemplate(c,g,d,f,h):null},_injectToSmartWidgetTemplate:function(a,c,d,b,e){var f=[];a||(b={});b||(b={});e||(e={});for(var h=0;h<a.length;h++){var g=a[h];if(g.meta&&-1!=c.indexOf(g.meta.type)&&g.elements){g=JSON.parse(JSON.stringify(g));var l=!1,k;for(k in g.elements){var n=g.elements[k];if(n&&Array.isArray(n))for(var q=0;q<n.length;q++){var p=n[q];if(p){if(p.action&&"command"==p.action.type&&p.action.ref&&p.action.ref.value){var t=p.action.ref.ext;b[p.action.ref.value]?
  (p.action.ref=b[p.action.ref.value],t&&(p.action.ref.ext=t),p.action.device=d,l=!0):p.action=null}p.status&&p.status.ref&&p.status.ref.value&&(e[p.status.ref.value]?(p.status.ref=e[p.status.ref.value],p.status.device=d,l=!0):p.status=null)}}}l&&f.push(g)}}return f},toGeneralDevice:function(a,c){if(!a)return null;c={};for(e in a.channels){var d=e,b=d.indexOf(":");-1!=b&&(d=d.substr(0,b));c[d]=!0}var e=null;c.SWITCH&&(e={type:"switch",commands:{on:{},off:{},toggle:{}},states:{state:{values:["on","off"]}},
  details:{commands:{on:{value:"on"},off:{value:"off"},toggle:{value:"toggle"}},states:{state:{value:"switchState"}}}});c.DIMMER&&(e={type:"dimmer",commands:{on:{},off:{},brightness:{value:{type:"INT",min:0,max:100,step:1}}},states:{brightness:{min:0,max:100,unit:"%"}},details:{commands:{on:{value:"dimTo",ext:100},off:{value:"dimOff"},brightness:{value:"dimTo",ext:"%d"}},states:{brightness:{value:"dimmerTLevel"}}}});c.BLIND&&(e={type:"blind",commands:{up:{},down:{},stop:{},position:{value:{type:"INT",
  min:0,max:100,step:1}}},states:{position:{min:0,max:100}},details:{commands:{up:{value:"blindUp"},down:{value:"blindDown"},stop:{value:"stop"},position:{value:"moveTo",ext:"%d"}},states:{position:{value:"blindLevel"}}}});c.JALOUSIE&&(e={type:"blind",commands:{up:{},down:{},stop:{},position:{value:{type:"INT",min:0,max:100,step:1}},rotation:{value:{type:"INT",min:0,max:100,step:1}}},states:{position:{min:0,max:100},rotation:{min:0,max:100}},details:{commands:{up:{value:"jalUp"},down:{value:"jalDown"},
  stop:{value:"jalStop"},position:{value:"jalRaw",ext:"%d"},rotation:{value:"jalLmlRaw",ext:"%d"}},states:{position:{value:"jalLevel"},rotation:{value:"jalLmlLevel"}}}});c.CLIMATECONTROL_REGULATOR&&(e={type:"heater",commands:{tempUp:{},tempDown:{},tempTo:{value:{type:"FLOAT",min:6,max:30,step:.5}}},states:{setpoint:{type:"FLOAT",min:6,max:30,step:.5,unit:"\u00b0C"},temperature:{type:"FLOAT"},humidity:{type:"INT"}},details:{commands:{tempUp:{value:"themoRTempUp"},tempDown:{value:"themoRTempDown"},tempTo:{value:"themoRTempRaw",
  ext:"%f"}},states:{setpoint:{value:"themoRSetTemp"},temperature:{value:"weatherTemp"},humidity:{value:"weatherHum"}}}});c.THERMALCONTROL_TRANSMIT&&(e={type:"heater",commands:{tempUp:{},tempDown:{},tempTo:{value:{type:"FLOAT",min:4,max:30.5,step:.5}},auto:{},manu:{}},states:{setpoint:{type:"FLOAT",min:4,max:30.5,step:.5,unit:"\u00b0C"},temperature:{type:"FLOAT"},humidity:{type:"INT"}},details:{commands:{tempUp:{value:"themoTTempUp"},tempDown:{value:"themoTTempDown"},tempTo:{value:"themoTTempRaw",ext:"%f"},
  auto:{value:"themoAutoMode"},manu:{value:"themoManuMode"}},states:{setpoint:{value:"themoTSetTemp"},temperature:{value:"themoTActualTemp"},humidity:{value:"themoTActualHum"},mode:{value:"themoTMode"}}}});c.CLIMATECONTROL_RT_TRANSCEIVER&&(e={type:"heater",commands:{tempUp:{},tempDown:{},tempTo:{value:{type:"FLOAT",min:4,max:30.5,step:.5}},auto:{},manu:{}},states:{setpoint:{type:"FLOAT",min:4,max:30.5,step:.5,unit:"\u00b0C"},temperature:{type:"FLOAT"},humidity:{type:"INT"}},details:{commands:{tempUp:{value:"themoTempUp"},
  tempDown:{value:"themoTempDown"},tempTo:{value:"themoTempRaw",ext:"%f"},auto:{value:"themoAutoMode"},manu:{value:"themoManuMode"}},states:{setpoint:{value:"themoSetTemp"},temperature:{value:"themoActualTemp"},humidity:{value:"themoActualHum"},mode:{value:"themoMode"}}}});if("HmIP-WGC"==a.type)return null;c.SWITCH_VIRTUAL_RECEIVER&&(e={type:"switch",commands:{on:{},off:{},toggle:{}},states:{state:{values:["on","off"]}},details:{commands:{on:{value:"on"},off:{value:"off"},toggle:{value:"toggle"}},states:{state:{value:"switchState"}}}});
  c.DIMMER_VIRTUAL_RECEIVER&&(e={type:"dimmer",commands:{on:{},off:{},brightness:{value:{type:"INT",min:0,max:100,step:1}}},states:{brightness:{min:0,max:100,unit:"%"}},details:{commands:{on:{value:"dimOn"},off:{value:"dimOff"},brightness:{value:"dimRaw",ext:"%d"}},states:{brightness:{value:"dimmerLevel"}}}});c.SHUTTER_VIRTUAL_RECEIVER&&(e={type:"blind",commands:{up:{},down:{},stop:{},position:{value:{type:"INT",min:0,max:100,step:1}}},states:{position:{min:0,max:100}},details:{commands:{up:{value:"moveUp"},
  down:{value:"moveDown"},stop:{value:"blindStop"},position:{value:"blindRaw",ext:"%d"}},states:{position:{value:"blindTLevel"}}}});c.BLIND_VIRTUAL_RECEIVER&&(e={type:"blind",commands:{up:{},down:{},stop:{},position:{value:{type:"INT",min:0,max:100,step:1}},rotation:{value:{type:"INT",min:0,max:100,step:1}}},states:{position:{min:0,max:100},rotation:{min:0,max:100}},details:{commands:{up:{value:"moveUp"},down:{value:"moveDown"},stop:{value:"stop"},position:{value:"moveTo",ext:"%d"},rotation:{value:"lamellaTo",
  ext:"%d"}},states:{position:{value:"blindTPos"},rotation:{value:"lamellaTPos"}}}});c.HEATING_CLIMATECONTROL_TRANSCEIVER&&(e={type:"heater",commands:{tempUp:{},tempDown:{},tempTo:{value:{type:"FLOAT",min:4,max:30.5,step:.5}},auto:{},manu:{}},states:{setpoint:{type:"FLOAT",min:4,max:30.5,step:.5,unit:"\u00b0C"},temperature:{type:"FLOAT"},humidity:{type:"INT"}},details:{commands:{tempUp:{value:"themoTempUp"},tempDown:{value:"themoTempDown"},tempTo:{value:"themoTemp",ext:"%f"},auto:{value:"themoTAutoMode"},
  manu:{value:"themoTManuMode"}},states:{setpoint:{value:"themoTemp"},temperature:{value:"themoActualTemp"},humidity:{value:"themoHum"},mode:{value:"themoMode"}}}});return e}};xnm.aio.hm.Handler=function(){var a=require("x.logger.js");this._logger=a?a.getLogger("xnm.aio.hm.Handler"):{log:function(){}};xnm.aio.hm.Handler._logger=a?a.getLogger("xnm.aio.hm.Handler"):{log:function(){}}};
  xnm.aio.hm.Handler.prototype={CCU:xnm.aio.hm.MHMCCU,devicemanager:xnm.aio.hm.DM,_discoveryCallbacks:[],_upnpCallback:null,_udpSockets:null,registModule:function(a){a.register(this.devicemanager.SYS,"hm")},resolveGateway:function(a){return a.ip?new xnm.aio.hm.MHMCCU(a.ip,a.password,a.port,a.tclport,a.uuid,a.type,a.username,a.cloudmatic):null},getDeviceCommands:function(a,c){a=(a=xnm.aio.hm.DM.applyUIFilter(a,{catagory:"command",elems:"*"}))?a.command:[];c&&c(null,a)},getDeviceStatus:function(a,c){a=
  (a=xnm.aio.hm.DM.applyUIFilter(a,{catagory:"status",elems:"*"}))?a.status:[];c&&c(null,a)},doCommand:function(a,c,d,b){this.resolveGateway(a).executeCommandCreator(c,d,function(a){b&&b(a)})},doStatus:function(a,c,d,b,e){(c=this.resolveGateway(c))?c.getStatesCreator(null,[{id:a,device:d,status:b}],function(a,b){a?e&&e(a):e&&e(null,b[0])}):e&&e(Error("gateway json invalid"))},discoverCCUs:function(a){var c=require("x.upnp.js");if(c){var d=!1;this._discoveryCallbacks.forEach(function(b){b==a&&(d=!0)});
  d||this._discoveryCallbacks.push(a);if(!this._upnpCallback){var b=this;this._upnpCallback=function(a,c){b._onDiscover(a,c)}}c.discoverDevices(this._upnpCallback);this._discoverUdp()}else a&&a(Error("upnp module is not avaliable"))},_discoverUdp:function(){var a=function(a){for(var b=0;b<a.length-1;b+=2)if("00"==a.substr(b,2))return b;return-1},c=function(b,c){b=b.address;c=c.toString("hex");if(8<c.length&&"02a5db30"==c.substr(0,8)){c=c.substr(8);var d=a(c);if(-1!=d&&d<c.length-2){var e=c.substr(2,
  d-2),f=(new Buffer(e,"hex")).toString();e=1;-1!=f.indexOf("CCU2")?e=2:-1!=f.indexOf("CCU3")&&(e=3);c=c.substr(d+2);d=a(c);if(-1!=d&&(c=c.substr(0,d))){c=(new Buffer(c,"hex")).toString();var h=new xnm.aio.hm.MHMCCU(b,"",80,8181,c,e);this._discoveryCallbacks&&this._discoveryCallbacks.forEach(function(a){a&&a(h)})}}}},d=function(a,b,d){xnm.aio.hm.Handler._logger.log("debug","create discover socket @:"+b);var e=require("dgram"),f=this;try{var g=e.createSocket({reuseAddr:!0,type:"udp4"})}catch(p){g=e.createSocket("udp4")}var h=
  d;g.on("listening",function(){g.setBroadcast&&g.setBroadcast(!0);h&&(h(null,g),h=null)});g.on("message",function(a,b){c.call(f,b,a)});g.on("error",function(a){xnm.aio.hm.Handler._logger.log("warn","create discover socket error:"+a);h&&(h(a),h=null)});g.bind(a,b);return g},b=function(a,b){var c=new Buffer([2,165,219,48,1,101,81,51,45,42,0,42,0,73]);a.send(c,0,c.length,43439,"255.255.255.255",function(){b&&a.close()})},e=this;(function(a){var b=[],e=this,f=require("os"),k=require("dgram");if(f&&f.networkInterfaces){var n=
  k.createSocket("udp4");n.on("listening",function(){n.setBroadcast(!0);var c=f.networkInterfaces(),g=[],h;for(h in c)for(var k=c[h],l=0;l<k.length;l++)"IPv4"==k[l].family&&0==k[l].internal&&g.push(k[l].address);var u=g.length;if(u)for(c=0;c<g.length;c++)d.call(e,n.address().port,g[c],function(c,d){u--;!c&&d&&b.push(d);u||a&&a(null,b)});else a&&a(null,b)});n.on("message",function(a,b){c.call(e,b,a)});n.bind(null)}else d.call(e,null,null,function(c,d){!c&&d&&b.push(d);a&&a(null,b)})}).call(this,function(a,
  c){if(!a&&c){for(a=0;a<c.length;a++)b.call(e,c[a]);setTimeout(function(){for(var a=0;a<c.length;a++)c[a].close();e._udpSockets=null},3E3)}})},discoverCCUsWithTimeout:function(a,c){var d=this,b=[],e=function(a){if(a){for(var c=0;c<b.length;c++)if(b[c].uuid==a.uuid)return;b.push(a)}};setTimeout(function(){d.removeDiscoveryCallback(e);c&&c(b)},1E3*a);this.discoverCCUs(e)},removeDiscoveryCallback:function(a){if(this._discoveryCallbacks){for(var c=-1,d=0;d<this._discoveryCallbacks.length;d++)if(this._discoveryCallbacks[d]===
  a){c=d;break}-1!=c&&this._discoveryCallbacks.splice(c,1)}},_onDiscover:function(a,c){if(a.name&&0<=a.name.indexOf("HomeMatic Central")){var d="";if(a.uuid){d=a.uuid.replace("upnp-BasicDevice-","");var b=d.split("-");1<b.length&&(d=b[1])}var e=new xnm.aio.hm.MHMCCU(a.ip,"",80,8181,d);this._discoveryCallbacks&&this._discoveryCallbacks.forEach(function(a){a&&a(e,c)})}},getDeviceListWithTimeout:function(a,c,d){if(a=this.resolveGateway(a)){var b=d,e=setTimeout(function(){b&&b(Error("get device list timeout"));
  b=null},1E3*c);a.getDeviceList(function(a,c){clearTimeout(e);b&&b(a,c)})}else d&&d(Error("gateway json format invalid"))},getDeviceCommandList:function(a,c){c=[];"HM-ES-PMSw1-Pl"==a.type?(c.push({id:window.XC_Text.on,cmd:"1:SWITCH:on"}),c.push({id:window.XC_Text.off,cmd:"1:SWITCH:off"})):"FHT80b"!=a.subtype&&(c.push({id:window.XC_Text.on,cmd:"on"}),c.push({id:window.XC_Text.off,cmd:"off"}));return c},getCCUServiceMessages:function(a,c){this.resolveGateway(a).getServiceMessage(function(a,b){c&&c(a,
  b)})}};"undefined"!=typeof module&&module&&module.exports&&(module.exports=new xnm.aio.hm.Handler);
  