Skip to content

Commit

Permalink
chore: release v0.6.0-alpha.1
Browse files Browse the repository at this point in the history
* (HGlab01) Start supporting Tado° X
  • Loading branch information
HGlab01 committed Oct 18, 2024
1 parent 405fe50 commit 2aa3626
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 2,563 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG_OLD.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Older changes
## 0.5.4 (2024-04-18)
* (HGlab01) Add attribute 'runningOfflineSchedule'
* (HGlab01) Bump axios to 1.6.8

## 0.5.3 (2024-01-29)
* (HGlab01) Improve axios handling
* (HGlab01) Bump axios to 1.6.7
Expand Down
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Tado° (https://www.tado.com) is the expert in smart heating and energy manageme
**This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.

## TADO° X
Basic support for Tado X available.
If your setup is not working, please raise a [ticket](https://github.com/DrozmotiX/ioBroker.tado/issues/new?assignees=HGlab01&labels=enhancement&projects=&template=Enhancement.md&title=). You will need to support some debugging session and interact with the adapter developer.
Basic support for Tado° X available.
If your setup is not working, please raise a [ticket](https://github.com/DrozmotiX/ioBroker.tado/issues/new?assignees=HGlab01&labels=enhancement&projects=&template=Enhancement.md&title=). You will need to support some debugging session and interact with the adapter developer to improve Tado° X features.

## Things you can steer on Tado° V3+, V3, V2
| State | Description |
Expand All @@ -33,13 +33,13 @@ If your setup is not working, please raise a [ticket](https://github.com/Drozmot
| tado.[x].[yyyyyy].Rooms.[z].openWindowDetection.openWindowDetectionEnabled | Enable/Disable open window detection on thermostat |
| tado.[x].[yyyyyy].Rooms.[z].openWindowDetection.timeoutInSeconds | Timeout how long thermostats are turned off when an open window is detected |
| tado.[x].[yyyyyy].Rooms.[z].activateOpenWindow | Switch thermostats off when an open window is detected (only works if the thermostat detects an open window) |
| tado.[x].[yyyyyy].Home.state.presence | Set HOME, AWAY or AUTO mode |
| tado.[x].[yyyyyy].Home.masterswitch | Turn all devices on/off |
| tado.[x].[yyyyyy].Rooms.[z].setting.mode | AC mode (only AC devices) |
| tado.[x].[yyyyyy].Rooms.[z].setting.fanspeed | Fanspeed (only AC devices with V3 and older versions) |
| tado.[x].[yyyyyy].Rooms.[z].setting.fanLebel | Fanlebel (only AC devices with V3+ version) |
| tado.[x].[yyyyyy].Rooms.[z].setting.verticalSwing | Vertical swing (only AC devices with V3+ version) |
| tado.[x].[yyyyyy].Rooms.[z].setting.horizontalSwing | Horizontal swing (only AC devices with V3 and olderversions) |
| tado.[x].[yyyyyy].Home.state.presence | Set HOME, AWAY or AUTO mode |
| tado.[x].[yyyyyy].Home.masterswitch | Turn all devices on/off |
| tado.[x].[yyyyyy].meterReadings | JSON-Object with {"date":"YYYY-MM-DD","reading": 1234} can be used to upload meter-readings to Energy IQ |

## Things you can steer on Tado° X
Expand All @@ -53,6 +53,8 @@ If your setup is not working, please raise a [ticket](https://github.com/Drozmot
| tado.[x].[yyyyyy].Rooms.resumeScheduleHome | Back to automatic mode for all rooms |
| tado.[x].[yyyyyy].Rooms.allOff | Switch all rooms of |
| tado.[x].[yyyyyy].Rooms.boost | Switch all rooms to boost mode |
| tado.[x].[yyyyyy].Home.state.presence | Set HOME, AWAY or AUTO mode |
| tado.[x].[yyyyyy].meterReadings | JSON-Object with {"date":"YYYY-MM-DD","reading": 1234} can be used to upload meter-readings to Energy IQ |

## Requires
* Node.js 18 or higher
Expand All @@ -63,8 +65,8 @@ If your setup is not working, please raise a [ticket](https://github.com/Drozmot
Placeholder for the next version (at the beginning of the line):
### __WORK IN PROGRESS__
-->
### __WORK IN PROGRESS__
* (HGlab01) Start supportin TadoX
### 0.6.0-alpha.1 (2024-10-18)
* (HGlab01) Start supporting Tado° X

### 0.5.9 (2024-10-16)
* (HGlab01) Improve axios promise handling
Expand All @@ -85,10 +87,6 @@ If your setup is not working, please raise a [ticket](https://github.com/Drozmot
### 0.5.5 (2024-06-25)
* (HGlab01) Bump axios to 1.7.2

### 0.5.4 (2024-04-18)
* (HGlab01) Add attribute 'runningOfflineSchedule'
* (HGlab01) Bump axios to 1.6.8

## License
MIT License

Expand Down
30 changes: 15 additions & 15 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
{
"common": {
"name": "tado",
"version": "0.6.0-alpha.0",
"version": "0.6.0-alpha.1",
"news": {
"0.6.0-alpha.1": {
"en": "Start supporting Tado° X",
"de": "Starthilfe Tado° X",
"ru": "Начало поддержки Tado° x",
"pt": "Iniciar suporte Tadoo X",
"nl": "Ondersteuning starten Tado° X",
"fr": "Commencer à soutenir Tado° X",
"it": "Avviare il supporto Tado X",
"es": "Comienzo de apoyo Tado° X",
"pl": "Zacznij wspierać Tado ° X",
"uk": "Старт підтримки Тадо ° X",
"zh-cn": "开始支持 塔多°X"
},
"0.5.9": {
"en": "Improve axios promise handling",
"de": "Axios Versprechen",
Expand Down Expand Up @@ -80,19 +93,6 @@
"pl": "Zmiana obsługiwanego atrybutu \"light\"\nDodaj połączenie atrybutu '\nDodaj atrybut 'supportsFlowTemperatureOptimization'\nAksykony bumpy do 1.7.7\nOdczyty mierników EnergyIQ mogą być wysłane",
"uk": "Зміна атрибуту \"light\"\nДодати атрибут 'connection Р\nДодати атрибут 'supportsFlowTemperatureOptimization Р\nБампер аксіос до 1.7.7\nЗавантажувати енергозберігання можна",
"zh-cn": "支持更改属性“ 光”\n添加属性“ 连接 '\n添加属性支持FlowTemperature Optimization '\n横轴改为1.7.7\nEnergyIQ 仪表读取可以上传"
},
"0.5.7-alpha.1": {
"en": "Change of attribute \"light\" supported\nAdd attribute 'connection'\nAdd attribute 'supportsFlowTemperatureOptimization'\nBump axios to 1.7.7\nEnergyIQ meter-readings can be uploaded",
"de": "Änderung des Attributs \"light\" unterstützt\nAttribut hinzufügen 'connection '\nAttribut hinzufügen 'supportsFlowTemperaturOptimization '\nBump axios bis 1.7.7\nEnergyIQ Messgeräte können hochgeladen werden",
"ru": "Изменение атрибута \"свет\" поддерживается\nДобавить атрибут \"\nДобавить атрибут \"supportsFlowTemperatureOptimization \"\nBump axios to 1.7.7\nЭнергоIQ можно загрузить",
"pt": "Mudança de atributo \"light\" suportada\nAdicionar atributo 'conexão '\nAdicionar atributo 'supportsFlowTemperatureOptimization '\nBump axios para 1.7.7\nAs leituras de medidores EnergyIQ podem ser carregadas",
"nl": "Wijziging van attribuut \"licht\" ondersteund\nAttribuut 'connectie' toevoegen '\nToevoegen attribuut 'ondersteuntFlowTemperatuurOptimisatie '\nBump axios naar 1.7.7\nEnergyIQ-meters kunnen worden geüpload",
"fr": "Changement d'attribut \"lumière\" pris en charge\nAjouter l'attribut 'connection' '\nAjouter l'attribut 'supportsFlowTemperatureOptimisation '\nAxios bouffés à 1.7.7\nLes lecteurs EnergyIQ peuvent être téléchargés",
"it": "Modifica dell'attributo \"light\" supportato\nAggiungi attributo 'collegamento '\nAggiungi attributo 'supportiFlowTemperatureOptimization '\nAssio di bump a 1.7.7\nEnergyIQ può essere caricato",
"es": "Cambio de atributo \"light\" soportado\nAgregar atributo 'conexión '\nAgregar atributo 'apoyosFlowTemperatureOptimization '\nBump axios a 1.7.7\nLas lecturas de medidores de EnergyIQ se pueden cargar",
"pl": "Zmiana obsługiwanego atrybutu \"light\"\nDodaj połączenie atrybutu '\nDodaj atrybut 'supportsFlowTemperatureOptimization'\nAksykony bumpy do 1.7.7\nOdczyty mierników EnergyIQ mogą być wysłane",
"uk": "Зміна атрибуту \"light\"\nДодати атрибут 'connection Р\nДодати атрибут 'supportsFlowTemperatureOptimization Р\nБампер аксіос до 1.7.7\nЗавантажувати енергозберігання можна",
"zh-cn": "支持更改属性“ 光”\n添加属性“ 连接 '\n添加属性支持FlowTemperature Optimization '\n横轴改为1.7.7\nEnergyIQ 仪表读取可以上传"
}
},
"titleLang": {
Expand Down Expand Up @@ -205,4 +205,4 @@
"native": {}
}
]
}
}
35 changes: 20 additions & 15 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const { version } = require('./package.json');

// @ts-ignore
let axiosInstance = axios.create({
timeout: 20000, //20000
timeout: 5000, //20000
baseURL: `${tado_url}/`,
httpsAgent: new https.Agent({ keepAlive: true }),
referer: tado_app_url,
Expand Down Expand Up @@ -226,10 +226,11 @@ class Tado extends utils.Adapter {
const beforeStatename = idSplitted[idSplitted.length - 2];
this.log.debug(`Attribute '${id}' changed. '${statename}' will be checked.`);

this.log.debug(id + ' changed');
if (this.isTadoX) {
await this.onStateChangeTadoX(id, state, homeId, zoneId, deviceId, statename, beforeStatename);
return;
if (statename != 'meterReadings' && statename != 'presence') {
if (this.isTadoX) {
await this.onStateChangeTadoX(id, state, homeId, zoneId, deviceId, statename, beforeStatename);
return;
}
}

if (statename == 'meterReadings') {
Expand Down Expand Up @@ -283,7 +284,7 @@ class Tado extends utils.Adapter {
this.log.debug(`Masterswitch changed in home '${homeId}' to value '${set_masterswitch}'`);
await this.setMasterSwitch(set_masterswitch);
await this.sleep(1000);
this.setStateAsync(`${homeId}.Home.masterswitch`, '', true);
await this.setState(`${homeId}.Home.masterswitch`, '', true);
} else if (statename == 'activateOpenWindow') {
this.log.debug(`Activate Open Window for room '${zoneId}' in home '${homeId}'`);
await this.setActivateOpenWindow(homeId, zoneId);
Expand Down Expand Up @@ -392,7 +393,7 @@ class Tado extends utils.Adapter {
case ('durationInSeconds'):
set_mode = 'TIMER';
this.log.debug(`DurationInSecond changed for room '${zoneId}' in home '${homeId}' to '${set_durationInSeconds}'`);
this.setStateAsync(`${homeId}.Rooms.${zoneId}.overlay.termination.typeSkillBasedApp`, set_mode, true);
await this.setState(`${homeId}.Rooms.${zoneId}.overlay.termination.typeSkillBasedApp`, set_mode, true);
await this.setZoneOverlay(homeId, zoneId, set_power, set_temp, set_mode, set_durationInSeconds, set_type, set_acMode, set_fanLevel, set_horizontalSwing, set_verticalSwing, set_fanSpeed, set_swing, set_light);
break;

Expand Down Expand Up @@ -436,9 +437,9 @@ class Tado extends utils.Adapter {
this.log.debug(`TypeSkillBasedApp changed for room '${zoneId}' in home '${homeId}' to '${set_mode}'`);
await this.setZoneOverlay(homeId, zoneId, set_power, set_temp, set_mode, set_durationInSeconds, set_type, set_acMode, set_fanLevel, set_horizontalSwing, set_verticalSwing, set_fanSpeed, set_swing, set_light);
if (set_mode == 'MANUAL') {
this.setStateAsync(`${homeId}.Rooms.${zoneId}.overlay.termination.expiry`, null, true);
this.setStateAsync(`${homeId}.Rooms.${zoneId}.overlay.termination.durationInSeconds`, null, true);
this.setStateAsync(`${homeId}.Rooms.${zoneId}.overlay.termination.remainingTimeInSeconds`, null, true);
await this.setState(`${homeId}.Rooms.${zoneId}.overlay.termination.expiry`, null, true);
await this.setState(`${homeId}.Rooms.${zoneId}.overlay.termination.durationInSeconds`, null, true);
await this.setState(`${homeId}.Rooms.${zoneId}.overlay.termination.remainingTimeInSeconds`, null, true);
}
break;

Expand Down Expand Up @@ -496,12 +497,16 @@ class Tado extends utils.Adapter {
*/
async setManualControlTadoX(homeId, roomId, power, temperature, terminationMode, boostMode, durationInSeconds) {
//{`"setting`":{`"power`":`"ON`",`"isBoost`":false,`"temperature`":{`"value`":18.5,`"valueRaw`":18.52,`"precision`":0.1}},`"termination`":{`"type`":`"NEXT_TIME_BLOCK`"}}
if (power != 'ON' && power != 'OFF') throw new Error(`Power has value ${power} but should have the value 'ON' or 'OFF'.`);
if (terminationMode != 'NEXT_TIME_BLOCK' && terminationMode != 'MANUAL' && terminationMode != 'TIMER') throw new Error(`TerminationMode has value ${terminationMode} but should have 'NEXT_TIMEBLOCK' or 'MANUAL' or 'TIMER'.`);
temperature = Math.round(temperature * 10) / 10;

let payload = {};
payload.termination = {};
payload.termination.type = terminationMode;
payload.setting = {};
payload.setting.power = power;
payload.setting.isBoost = boostMode;
payload.setting.isBoost = toBoolean(boostMode);

if (power == 'OFF') payload.setting.temperature = null;
else {
Expand Down Expand Up @@ -1251,7 +1256,7 @@ class Tado extends utils.Adapter {
}
else this.isTadoX = false;
if (this.home_data == null) throw new Error('home_date is null');
this.home_data.masterswitch = '';
if (!this.isTadoX) this.home_data.masterswitch = '';
this.DoWriteJsonRespons(HomeId, 'Stage_02_HomeData', this.home_data);
jsonExplorer.traverseJson(this.home_data, `${HomeId}.Home`, true, true, 0);
}
Expand Down Expand Up @@ -1453,10 +1458,10 @@ class Tado extends utils.Adapter {
const settingType = await this.getStateAsync(homeId + '.Rooms.' + zoneId + '.setting.type');
if (settingType && settingType.val == 'HEATING') {
if (masterswitch == 'ON') {
this.setStateAsync(overlayClearZonePath, true);
await this.setState(overlayClearZonePath, true);
} else {
this.setStateAsync(powerPath, 'OFF');
this.setStateAsync(typeSkillBasedAppPath, 'MANUAL');
await this.setState(powerPath, 'OFF');
await this.setState(typeSkillBasedAppPath, 'MANUAL');
}
await this.sleep(600);
}
Expand Down
Loading

0 comments on commit 2aa3626

Please sign in to comment.