In the one direction, i.e. change the system mode on the Zigbee device, it works and my number item is 0, 1 or 2. However, if I change the number item, nothing appears on the Zigbee device.
const item = items[itemSystemMode]
switch (item.state) {
case 'heat':
case 'auto':
item.sendCommand('off')
break
case 1:
case 2:
case 3:
item.sendCommand(0)
break
}
Thanks for the tips, I have now installed it as follows. Otherwise it didn’t work. The quotation marks in the numbers were necessary, for whatever reason
var mapThermostatHeat = {
off: 'heat',
auto: 'heat',
0: '1',
2: '0',
3: '0'
};
var mapThermostatOff = {
heat: 'off',
auto: 'off',
1: '0',
2: '0',
3: '0'};
var item = items[itemSystemMode];
if (activeProfile == 'Aus') {
const commandOff = mapThermostatOff[item.state];
if (commandOff) {
item.sendCommand(commandOff)
}
if (log == 'ON') console.info('No active profile, check ' + rootRoom + '_Heating_WindowSuspension');
} else if (activeProfile != 'Aus') {
const commandHeat = mapThermostatHeat[item.state];
if (commandHeat) {
item.sendCommand(commandHeat)
}