Skip to content

Commit

Permalink
Change thermostat mode functionality added
Browse files Browse the repository at this point in the history
  • Loading branch information
Homemade-Disaster committed Apr 17, 2022
1 parent 8d0f3e4 commit 0514dc4
Show file tree
Hide file tree
Showing 14 changed files with 415 additions and 208 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ Mittels der Netatmo-Energy API werden die aktuellen Einstellungen abgeholt bzw.
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->
### 1.3.0 (2022-04-17)
* (ioKlausi) Change thermostat mode functionality added to thermostat card

### 1.2.5 (2022-04-16)
* (ioKlausi) Dropdown menu to change heating plan added to the thermostat card in the admin page

Expand Down
43 changes: 34 additions & 9 deletions admin/tab_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,23 @@ <h6 class="translate">${message.msgtxt}</h6>
let DeviceName_ID = valve.ModuleName_ID;

let schedules = valve.schedule_programs;
let sub_menus = '';
let sub_menus_schedules = '';
if (schedules) {
for (let schedule of schedules) {
sub_menus = sub_menus + `<li><a href="#!" class="black-text text-darken-3 start-api-request" data-api-request="${schedule.request}"><i class="material-icons icon-orange">room_service</i>${schedule.name}</a></li>`;
sub_menus_schedules = sub_menus_schedules + `<li><a href="#!" class="black-text text-darken-3 start-api-request" data-api-request="${schedule.request}"><i class="material-icons icon-orange">room_service</i>${schedule.name}</a></li>`;
}
}

let thermmodes = valve.thermmode_programs;
let sub_menus_thermmodes = '';
if (thermmodes) {
for (let thermmode of thermmodes) {
sub_menus_thermmodes = sub_menus_thermmodes + `<li><a href="#!" class="black-text text-darken-3 start-api-request" data-api-request="${thermmode.request}"><i class="material-icons icon-green">room_service</i>${thermmode.name}</a></li>`;
}
}

let plan_active = valve.active_schedule;
let thermmode_active = valve.active_thermmode;

let temp_act = valve.therm_measured_temperature;
let temp_set = valve.therm_setpoint_temperature;
Expand Down Expand Up @@ -558,25 +567,41 @@ <h6 class="translate">${message.msgtxt}</h6>
<i class="material-icons icon-green" style="font-size: 18px;float: left">refresh</i>
<div class="translate"> Refreshed: </div>
<div style="float: left"> ${act_date_text}</div>
${sub_menus != '' ? `
<div style="margin-left: auto;">
${sub_menus_thermmodes != '' ? `
<div style="margin-left: auto; float: left;">
<!-- Dropdown Trigger -->
${sub_menus_thermmodes != undefined && sub_menus_thermmodes!= null ? `
<a href="#" class="dropdown-trigger grey-text text-darken-4 tooltipped" title="${thermmode_active}" data-target="dropdown_thermmode_${mod_id_internal}">
<i class="material-icons icon-green">ac_unit</i>
</a>
` : ``}
</div>
<!-- Dropdown Structure -->
<ul id="dropdown_thermmode_${mod_id_internal}" class="dropdown-content">
${sub_menus_thermmodes}
</ul>
` : ''}
${sub_menus_schedules != '' ? `
<div style="margin-left: auto; float: left;">
<!-- Dropdown Trigger -->
${plan_active != undefined && plan_active!= null ? `
<a href="#" class="dropdown-trigger grey-text text-darken-4 tooltipped" title="${plan_active}" data-target="dropdown_${mod_id_internal}">
<a href="#" class="dropdown-trigger grey-text text-darken-4 tooltipped" title="${plan_active}" data-target="dropdown_schedule_${mod_id_internal}">
<i class="material-icons icon-orange">timelapse</i>
</a>
` : `
<a href="#" class="dropdown-trigger grey-text text-darken-4" data-target="dropdown_${mod_id_internal}">
<a href="#" class="dropdown-trigger grey-text text-darken-4" data-target="dropdown_schedule_${mod_id_internal}">
<i class="material-icons">more_vert</i>
</a>
`}
</div>
<!-- Dropdown Structure -->
<ul id="dropdown_${mod_id_internal}" class="dropdown-content">
${sub_menus}
<ul id="dropdown_schedule_${mod_id_internal}" class="dropdown-content">
${sub_menus_schedules}
</ul>
` : ''}
` : ''}
</div>
</div>
</div>
Expand Down
72 changes: 72 additions & 0 deletions admin/words.js
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,42 @@ const _systemDictionary = {
"pl": "„ochrona przed mrozem”",
"zh-cn": "“防冻罩”"
},
"switchhomeschedule away from home": {
"en": "Away from home",
"de": "Nicht zu Hause",
"ru": "Вдали от дома",
"pt": "Longe de casa",
"nl": "Weg van huis",
"fr": "Loin de la maison",
"it": "Lontano da casa",
"es": "Lejos de casa",
"pl": "Daleko od domu",
"zh-cn": "离开家"
},
"switchhomeschedule schedule": {
"en": "Time schedule",
"de": "Zeitplan",
"ru": "График",
"pt": "Horário",
"nl": "Tijdschema",
"fr": "Horaire",
"it": "Orario",
"es": "Horario",
"pl": "Harmonogram czasowy",
"zh-cn": "时间表"
},
"switchhomeschedule frost guard": {
"en": "Frost guard",
"de": "Frostwächter",
"ru": "Морозный страж",
"pt": "Guarda-gelo",
"nl": "Vorstbewaker",
"fr": "Garde de gel",
"it": "Protezione antigelo",
"es": "Guardia de escarcha",
"pl": "Strażnik mrozu",
"zh-cn": "霜卫士"
},
"Refresh whole structure:": {
"en": "Refresh whole structure:",
"de": "Gesamte Struktur aktualisieren:",
Expand Down Expand Up @@ -2128,6 +2164,42 @@ const _systemDictionary = {
"es": "plano real:",
"pl": "Aktualny plan:",
"zh-cn": "实际计划:"
},
"Can not get active heating plan!": {
"en": "Can not get active heating plan!",
"de": "Aktiver Heizplan kann nicht abgerufen werden!",
"ru": "Не могу получить активный план отопления!",
"pt": "Não é possível obter o plano de aquecimento ativo!",
"nl": "Kan geen actief verwarmingsplan krijgen!",
"fr": "Impossible d'activer le plan de chauffage !",
"it": "Impossibile ottenere un piano di riscaldamento attivo!",
"es": "¡No se puede activar el plan de calefacción!",
"pl": "Nie można uzyskać aktywnego planu ogrzewania!",
"zh-cn": "无法获得主动供暖计划!"
},
"Can not get active mode!": {
"en": "Can not get active mode!",
"de": "Kann den aktiven Modus nicht erhalten!",
"ru": "Не могу получить активный режим!",
"pt": "Não é possível obter o modo ativo!",
"nl": "Kan de actieve modus niet krijgen!",
"fr": "Impossible d'obtenir le mode actif !",
"it": "Impossibile ottenere la modalità attiva!",
"es": "¡No se puede obtener el modo activo!",
"pl": "Nie można uzyskać aktywnego trybu!",
"zh-cn": "无法进入活动模式!"
},
"Can not get active thermostat mode!": {
"en": "Can not get active thermostat mode!",
"de": "Der aktive Thermostatmodus kann nicht aufgerufen werden!",
"ru": "Не удается получить активный режим термостата!",
"pt": "Não é possível obter o modo de termostato ativo!",
"nl": "Kan geen actieve thermostaatmodus krijgen!",
"fr": "Impossible d'activer le mode thermostat !",
"it": "Impossibile ottenere la modalità termostato attiva!",
"es": "¡No se puede activar el modo de termostato!",
"pl": "Nie można uzyskać aktywnego trybu termostatu!",
"zh-cn": "无法获得主动恒温器模式!"
}
};

Expand Down
2 changes: 1 addition & 1 deletion docs/de/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Auf der Admin-Tab können sie alle Thermostate, Bridges und Ventile ihrer netatm

<img src="https://github.com/Homemade-Disaster/ioBroker.netatmo-energy/raw/master/docs/img/admintab_de.png" alt="admintab" width="70%"/>

Auf jeder Karte werden Statussysmbole angezeigt, welche den aktuellen Zustand des Thermostats, der Ventile und des Steckers darstellt.
Auf jeder Karte werden Statussysmbole angezeigt, welche den aktuellen Zustand des Thermostats, der Ventile und des Steckers darstellt. Auf der zweiten Seite des Thermostats finden sie diverse API Requests um den Thermostat-Mode bzw. den Heizplan einzustellen.

## Widget
Widget für VIS um ein komplettes Thermostat anzuzeigen. Sie müssen nur den "SetTemp" - Datenpunkt eintragen. Alle anderen Informationen werden dynamisch aus der "rooms"-Struktur ermittelt.
Expand Down
2 changes: 1 addition & 1 deletion docs/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ On the Admin-Tab you can see all thermostates, plugs and valves from your netatm

<img src="https://github.com/Homemade-Disaster/ioBroker.netatmo-energy/raw/master/docs/img/admintab_en.png" alt="admintab" width="70%"/>

On each card you can find status icons, which show you the actual state of each thermostat, valve and plug.
On each card you can find status icons, which show you the actual state of each thermostat, valve and plug. On the second page of the thermostat you can find major API requests to change the thermostat mode and the schedule mode.

## Widget
Widget for VIS to show a complete valve. You have only to define the "SetTemp" - datapoint. The widget will get all other fields dynamically out of the "rooms"-structure.
Expand Down
Binary file modified docs/img/admintab_therm_2nd_de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/admintab_therm_2nd_en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/admintab_therm_dropdown_thermmode_de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/admintab_therm_dropdown_thermmode_en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"common": {
"name": "netatmo-energy",
"version": "1.2.5",
"version": "1.3.0",
"news": {
"1.3.0": {
"en": "Change thermostat mode functionality added to thermostat card",
"de": "Funktion zum Ändern des Thermostatmodus zur Thermostatkarte hinzugefügt",
"ru": "В карточку термостата добавлена функция изменения режима термостата.",
"pt": "Alterar a funcionalidade do modo termostato adicionada ao cartão do termostato",
"nl": "Functie van thermostaatmodus wijzigen toegevoegd aan thermostaatkaart",
"fr": "Modifier la fonctionnalité du mode thermostat ajoutée à la carte du thermostat",
"it": "Funzionalità Modifica modalità termostato aggiunta alla scheda termostato",
"es": "Cambiar la funcionalidad del modo de termostato agregada a la tarjeta del termostato",
"pl": "Funkcja zmiany trybu termostatu dodana do karty termostatu",
"zh-cn": "更改恒温器模式功能添加到恒温器卡"
},
"1.2.5": {
"en": "switchhomeschedule added to cards",
"de": "switchhomeschedule zu Karten hinzugefügt",
Expand Down
1 change: 1 addition & 0 deletions lib/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const _glob = {
'List_scale': '{"30min": "30 Minits", "1hour": "one hour", "3hours": "Three hours", "1day": "One day", "1week": "One Week"}',
'List_type_mm': '{"boileron": "Boiler on", "boileroff": "Boiler off", "sum_boiler_on": "Sum of Boiler on", "sum_boiler_off": "Sum of Boiler off"}',
'List_type_rm': '{"temperature": "Temperature"}',
'List_thermmode': '{"away": "switchhomeschedule away from home", "hg": "switchhomeschedule frost guard", "schedule": "switchhomeschedule schedule"}',

//notifications
'NotificationEmail': 'email',
Expand Down
Loading

0 comments on commit 0514dc4

Please sign in to comment.