Open Zeus110577 opened 6 years ago
another change:
The newstate is not right with 0 and 1 for on and off in powertstate.
0: Toggle (Standby) 1: deepstandby 2: restart 3: gui restart
change from: if (id === adapter.namespace + '.VuPlus.STANDBY') { getResponse('NONE', deviceId, PATH_POWERSTATE + '?newstate=' + (state.val ? 1 : 0), function (error, command, deviceId, xml) {
to getResponse('NONE', deviceId, PATH_POWERSTATE + '?newstate=0', function (error, command, deviceId, xml) {
Hallo
nur ne kurze Info. Leider hatte ich das Problem das beim ändern vom Standby, egal ob true oder false gesendet wurde, der Receiver eingeschaltet hat. Sprich ich hab das Script angepasst das es den Standby selbst prüft auf Änderung:
ganz oben Variable angelegt:
var old_STANDBY_value = false;
code geändert: ... if (id === adapter.namespace + '.VuPlus.STANDBY') { if (old_STANDBY_value !== state.val) { getResponse('NONE', deviceId, PATH_POWERSTATE + '?newstate=' + (state.val ? 1 : 0), function (error, command, deviceId, xml) { if (!error) { adapter.setState('VuPlus.STANDBY', state.val, true); } else { adapter.setState('VuPlus.STANDBY', {val: state.val, ack: true, q: 0x42}); } }); } ...
und bei abfrage locale variable gesetzt:
... case 'GETSTANDBY': if (!xml.e2powerstate) { adapter.log.error('No e2powerstate found'); return; } bool = parseBool(xml.e2powerstate.e2instandby); adapter.log.debug('Box Standy: ' + bool); old_STANDBY_value = bool; adapter.setState('VuPlus.STANDBY', bool, true); adapter.setState('VuPlus.ON', !bool, true) //setState(boxId + 1, parseBool(xml.e2powerstate.e2instandby));<---><------>// true|false break; ...