Compare commits

...

91 Commits
v0.4 ... master

Author SHA1 Message Date
Philipp Wo 035d9e832e new commandref syntax - help is now working on fhem page 2023-12-16 17:03:24 +01:00
Philipp Wo e3c6c6819f „98_TadoAPI.pm“ ändern
added ZoneIDs to readings - some code cleanup
2023-02-13 14:33:29 +00:00
Philipp Wo 16ff369335 „README.md“ ändern
Credits Format edited
2021-10-28 12:10:36 +00:00
Philipp Wo 3d9e067dd8 „README.md“ ändern 2021-02-23 19:02:31 +00:00
Philipp Wo 1195179491 added childLock readings 2021-02-23 19:35:47 +01:00
Philipp Wo c2269cfe7a prevent error when no token 2020-12-28 23:22:08 +01:00
Philipp Wo 8bfba91e2e „README.md“ ändern
FHEM forum thread-link added
2020-12-22 17:58:43 +00:00
Philipp Wo ce9ec91cb4 updated fhem commands 2020-12-22 11:58:34 +00:00
Philipp Wo 408f68ece3 „README.md“ ändern
wrong wget URL - fixed
2020-12-22 11:33:01 +00:00
Philipp Wo 1ff546c028 Installation in Doku beschrieben 2020-11-11 09:36:06 +00:00
Philipp Wo 079b9ea763 Installation in Doku beschrieben
Step by Step Anleitung für die Installation des Moduls
2020-11-11 09:33:15 +00:00
Philipp Wo f292cce75c „98_TadoAPI.pm“ ändern
no code changes - added header information (new repo url)
2020-10-20 10:28:33 +00:00
Philipp Wo 96ba239bb8 moved repo to new subdomain 2020-10-15 15:57:41 +00:00
Philipp Wo 3f102bd1a2 Merge commit '0d129f3f648abf9a37d14df92802b214b5c264db' 2020-04-25 11:04:35 +02:00
Philipp Wo 0d129f3f64 error message on token-file error instead of fhem crash (die, croak) 2020-04-25 10:57:42 +02:00
Philipp Wo 99ff30c13a errorhandling croak instead of die 2020-04-25 10:38:05 +02:00
Philipp Wo cb245489be critic -4 done, protos removed 2020-04-22 02:12:01 +02:00
Philipp Wo bfb50d1ac5 Subroutine prototypes removed 2020-04-22 00:40:51 +02:00
Philipp Wo 3e04c8ac51 added foreach -> for 2020-04-21 15:09:51 +02:00
Philipp Wo 9f5f1d131d removing prototypes started 2020-04-20 16:13:19 +02:00
Philipp Wo 8154b435d5 whitespace at the end of lines removed 2020-04-20 00:36:32 +02:00
Philipp Wo d9bfbd0038 perlcritic -3; file handling now pbp 2020-04-20 00:17:52 +02:00
Philipp Wo ae011426b0 perlcritic -3 started 2020-04-19 23:44:16 +02:00
Philipp Wo 053df6d7ea perlcritic -4 done 2020-04-19 22:28:47 +02:00
Philipp Wo fe156e2b03 Merge branch 'master' of https://home.wolfmajer.at/wolfgit/Public/FHEM-Tado 2020-04-19 21:47:36 +02:00
Philipp Wo fd70c8b5a4 perl::critic -5 done 2020-04-19 21:46:53 +02:00
Philipp Wo 4008f12aff „README.md“ ändern 2020-02-08 01:23:55 +00:00
Philipp Wo 5291cf1fb5 „README.md“ ändern 2020-02-08 01:22:32 +00:00
Philipp Wo ba14eee4b1 added zone lock functionality for tablet-ui thermostat 2020-02-08 02:12:34 +01:00
Philipp Wo 66a5c525a9 added TabletUI Infos & added helper fn for thermostat widget 2020-02-06 08:39:50 +01:00
Philipp Wo 8c545c3bfe added duration for setAllOverlays; doku updated 2020-02-06 06:04:57 +01:00
Philipp Wo 2992a11988 added duration for setAllOverlays; doku updated 2020-02-06 05:47:50 +01:00
Philipp Wo 9d668bd8d0 renamed setting "off" to "remove" 2019-12-27 09:56:19 +01:00
Philipp Wo 8cbcfc0aea Merge commit '7f47a5e8fa1b3917db3f365e788d447c2fb58451' 2019-12-24 03:47:22 +01:00
Philipp Wo 10c6ca180a added version 2019-12-24 03:46:47 +01:00
Philipp Wo 085af3d5a8 added update function for overlay, code cleaned 2019-12-14 16:29:46 +01:00
Philipp Wo 7f47a5e8fa „README.md“ ändern 2019-12-11 12:50:34 +00:00
Philipp Wo 8709224651 „README.md“ ändern 2019-12-11 12:50:00 +00:00
Philipp Wo a020f7ea0f commandref updated 2019-12-11 13:37:41 +01:00
Philipp Wo 4102cadc6c reduced API-querys in UpdateFn up to 50% 2019-12-11 11:12:46 +01:00
Philipp Wo e2a3946e3e reading distance from home added
set Attr showPosData to 1
2019-12-10 23:49:02 +01:00
Philipp Wo 91dc626e4c all events with same timestamp
performance improvement?
2019-12-10 18:07:41 +01:00
Philipp Wo 505de090f2 no event when readingsBulkUpdate 2019-12-10 17:41:08 +01:00
Philipp Wo 03fef4a2cc code cleanup 2019-12-10 16:38:33 +01:00
Philipp Wo fe13d672e7 reduced redundant api querys 2019-12-10 16:20:57 +01:00
Philipp Wo 1f82ad7824 improved reading updates 2019-12-10 15:28:32 +01:00
Philipp Wo df555d473b reverted to normal token load 2019-12-10 13:21:10 +01:00
Philipp Wo 2d32913bef update function with blocking call; shoud fix fhem timeouts 2019-12-10 11:03:12 +01:00
Philipp Wo 470c4e135a code cleanup
removed unused sub´s
2019-12-10 10:14:23 +01:00
Philipp Wo 4b7a09ff0b changed api status check
maybe a blocking problem could be solved
2019-12-10 09:31:43 +01:00
Philipp Wo 00596dd93a Merge remote-tracking branch 'origin/master' 2019-12-09 21:32:48 +01:00
Philipp Wo 4c36477bc6 Merge remote-tracking branch 'origin/master' 2019-12-09 21:32:43 +01:00
Philipp Wo 721465cd87 Merge remote-tracking branch 'origin/master' 2019-12-09 21:32:29 +01:00
Philipp Wo f2e88a911f fixed set reading 2019-12-09 21:32:20 +01:00
Philipp Wo 422db04e88 fixed set reading 2019-12-09 21:27:58 +01:00
Philipp Wo 1e9a31b5f4 Merge remote-tracking branch 'origin/master' 2019-12-09 21:19:20 +01:00
Philipp Wo 2bd257970f Geolocation Status added to Readings
thx to Andreas Krause <Andreas@die4krauses.net>
2019-12-09 21:18:39 +01:00
Philipp Wo f36f13bb4b Geolocation Status added to Readings
thx to Andreas Krause <Andreas@die4krauses.net>
2019-12-09 21:15:44 +01:00
Philipp Wo 61c33fc956 reading for desired temp extended
OFF reading now supported
2019-12-09 08:27:04 +01:00
Philipp Wo bd2979ed09 temperature round to one digit 2019-12-06 16:55:56 +01:00
Philipp Wo 4fa3c57d35 fixed error in zoneoverlay without duration 2019-12-04 10:31:40 +01:00
Philipp Wo 9f3291cb78 „README.md“ ändern 2019-11-25 21:05:14 +00:00
Philipp Wo 37291b0358 timer overlay support added 2019-11-25 22:02:47 +01:00
Philipp Wo 841eebaa69 block access to the api if no password set 2019-11-23 20:22:41 +01:00
Philipp Wo 773da536ca removed unused code 2019-11-23 13:22:13 +01:00
Philipp Wo 0051426f7f set update intervall per attr 2019-11-23 12:47:42 +01:00
Philipp Wo 5094dda70b changed encoding of pm file; commandref created 2019-11-23 11:49:06 +01:00
Philipp Wo 7d4444ce58 all zoneIDs dynamic, reduced code 2019-11-22 21:57:40 +01:00
Philipp Wo a90835fae2 support for multiple mobile IDs 2019-11-22 21:02:03 +01:00
Philipp Wo d7d6fc4000 updateFn optimized 2019-11-22 20:23:01 +01:00
Philipp Wo c802b3f655 all subs use now correct zoneID 2019-11-22 16:35:48 +01:00
Philipp Wo f862149027 attribute list updated 2019-11-22 15:45:11 +01:00
Philipp Wo 3765697993 Merge remote-tracking branch 'origin/master' 2019-11-22 15:43:35 +01:00
Philipp Wo b765c1e6f0 Merge remote-tracking branch 'origin/master' 2019-11-22 15:43:29 +01:00
Philipp Wo 22cc4e0225 Merge remote-tracking branch 'origin/master' 2019-11-22 15:43:12 +01:00
Philipp Wo 92d87f156d fixed zone query (query id of zone) 2019-11-22 15:43:06 +01:00
Philipp Wo 392a2e99af fixed zone query (query id of zone) 2019-11-22 15:21:01 +01:00
Philipp Wo afcd5246e7 Merge remote-tracking branch 'origin/master' 2019-11-22 12:39:49 +01:00
Philipp Wo 99eec06300 fixed errors in token getter
no return value in tokenrenew and tokenrefresh
2019-11-22 12:39:40 +01:00
Philipp Wo c7cf608943 fixed errors in token getter
no return value in tokenrenew and tokenrefresh
2019-11-22 12:31:55 +01:00
Philipp Wo 65fe7cf1ed updated SVG 2019-11-22 11:03:48 +01:00
Philipp Wo eccef22e50 „README.md“ ändern 2019-11-22 10:03:26 +00:00
Philipp Wo 0b76200446 „README.md“ ändern 2019-11-22 09:50:00 +00:00
Philipp Wo 4f17514cb2 „README.md“ ändern 2019-11-22 09:45:16 +00:00
Philipp Wo 8d68de475a „README.md“ ändern 2019-11-22 09:44:53 +00:00
Philipp Wo 00aa706d83 „README.md“ ändern 2019-11-22 09:38:30 +00:00
Philipp Wo 92dcdb4e77 „README.md“ ändern 2019-11-22 09:37:39 +00:00
Philipp Wo 3ee7801402 Merge remote-tracking branch 'origin/master' 2019-11-22 10:14:12 +01:00
Philipp Wo 92cd323578 incremental timeout for updatefn 2019-11-22 10:13:31 +01:00
Philipp Wo 779115c080 incremental timeout for updatefn 2019-11-22 09:44:00 +01:00
Philipp Wo 08c32cf0dc increased timeouts + verbose level support 2019-11-22 02:56:10 +01:00
5 changed files with 2034 additions and 1501 deletions

File diff suppressed because it is too large Load Diff

130
README.md
View File

@ -1,18 +1,40 @@
# FHEM-Tado
FHEM Modul für [tado](https://www.tado.com/at/) Heizungssteuerung.
Bin unter philipp@wolfmajer.at erreichbar.
Für Fragen / Anliegen bin ich im FHEM-Forum (https://forum.fhem.de/index.php/topic,116764) oder unter philipp@wolfmajer.at erreichbar.
## Was wird unterstützt?
* Übersicht aller Tado Zonen
* Temperatur & Luftfeuchtigkeit
* Batteriestatus
* akruelle Heizleistung
* aktuelle Heizleistung
* Wunschtemperatur
* Overlays
* setzen einer gewünschten Temperatur pro Raum (set setZoneOverlay ``<zonenID>`` ``<Wunschtemperatur>``)
* setzen der Geotracking Einstellung für ein Mobiles Gerät
* ...
* Overlays (static & timer)
* ChildLock Status (nur Reading)
## Installation
1. Wechsle mit der Console (SSH) in dein FHEM Installationsverzeichnis (Pfad ggf. anpassen):
`cd /opt/fhem/FHEM/`
2. Lade die aktuellste Modulversion auf dein FHEM herunter:
`wget https://git.wolfmajer.at/Public/FHEM-Tado/raw/branch/master/98_TadoAPI.pm`
3. Zur Sicherheit noch die Berechtigungen anpassen:
`sudo chown fhem:dialout 98_TadoAPI.pm`
`sudo chmod 644 98_TadoAPI.pm`
5. FHEM neu starten.
`sudo systemctl restart fhem.service`
6. Fertig, weiter geht´s in FHEM mit der Definition
## Definition & Funktion
@ -22,22 +44,64 @@ In FHEM wird das Modul folgendermaßen definiert:
Das Passwort muss mit dem `set <name> <password>` Befehl (z.B. set myTado password 12345) gesetzt werden.
Standardmäßig aktualisiert das Modul alle 5 Minuten die Werte *tado mode; Zone 1 Temperatur; Geolocation für die angegebene mobID und den API-Status*. (siehe Bild Modulübersicht)
Standardmäßig aktualisiert das Modul alle 5 Minuten die folgenden Werte:
* Zonen Temperatur
* Zonen Luftfeuchtigkeit
* aktuelle Wunschtemperatur einer Zone
* Geolocation aller eingerichteten Smartphones
* API-Status (siehe Bild Modulübersicht)
* Batteriestatus aller Tado Geräte
* Overlays (manuell eingestellte Wunschtemperatur die den Intelligenten Zeitplan überschreibt)
* Timed Overlays (manuell eingestellte Wunschtemperatur, die den Intelligenten Zeitplan für die angegebene Zeitdauer (Sec) überschreibt)
Sämtliche externen Aufrufe sind *nonblocking* ausgeführt.
<img src="https://home.wolfmajer.at/wolfgit/Public/FHEM-Tado/raw/branch/master/doc/Modul1.PNG" width="500" />
### Overlay für Zone setzen
`set <name> setZoneOverlay <zonenID> <Wunschtemperatur> [Dauer des Overlay in Sekunden]`
## OAuth2 Token Authentifizierung
**INFO:** unterstützte Werte der Wunschtemperatur: `remove=delete overlay; 0=heating power off; 1<=desired temperature (overlay)`
Alle Anfragen an das API sind über *oauth2* realisiert.
Zuerst wird ein Token (mit Username und Passwort) von tado angefordert der ca. 10 Minuten gültig ist. Alle folgenden Aufrufe werden nur mehr über den Token realisiert. Das Modul prüft den Token auf Gültigkeit und erneuert ihn bevor er abläuft.
<img src="https://git.wolfmajer.at/Public/FHEM-Tado/raw/branch/master/doc/so.PNG" width="500" />
Pfad des Token ist im Modul fix eingestellt `/fhem-root/FHEM/FhemUtils/TadoAPI_token_<fhem-devicename>`
#### Info für Overlay mit Timer
Kann entweder mit wie oben beschrieben oder, für Widgets von Tablet UI interessant, mit `set <name> timedZoneOverlay <zonenID> <Dauer des Overlay in Sekunden> <Wunschtemperatur>` gesetzt werden.
Bei einem Timer Overlay erscheint in den tado Readings ein neuer Wert `Zone<ID>Lock`. Zusätzlich ist in den Internals noch ein Helper mit der Info welche Zone gesperrt ist. Das kann man in FHEM dann in eigenen Scripts weiterverarbeiten. (z.B. Anwesenheitserkennung soll Overlay nicht überschreiben wenn Timer...)
### Overlay für alle Zonen setzen
`set <name> setAllOverlays <Wunschtemperatur> [Dauer des Overlay in Sekunden]`
**INFO:** unterstützte Werte der Wunschtemperatur: `remove=delete overlay; 0=heating power off; 1<=desired temperature (overlay)`
### Tado Geräte anzeigen (z.B. Battery State)
`get <name> getZoneDevices`
<img src="https://git.wolfmajer.at/Public/FHEM-Tado/raw/branch/master/doc/gzd.PNG" width="500" />
## Verwendung
## Screenshots
### Modulübersicht
<img src="https://git.wolfmajer.at/Public/FHEM-Tado/raw/branch/master/doc/Modul1.PNG" width="500" />
## Verwendung in FHEM
### FHEM Tablet-UI
Im Tablet UI lassen sich alle Readings des tado FHEM Modul anzeigen:
<img src="https://git.wolfmajer.at/Public/FHEM-Tado/raw/branch/master/doc/tablet-ui-readings.PNG" width="500" />
Auch lassen sich im Tablet UI mit einem Thermostat Widget alle Zonen steuern:
<img src="https://git.wolfmajer.at/Public/FHEM-Tado/raw/branch/master/doc/tablet-ui-thermostat.PNG" width="500" />
Code Snippet für einen Thermostat Widget:
```
<div data-type="thermostat" data-height="250" data-width="285" data-temp="Temperatur_Heizung" data-min="15" data-max="24" data-device="mytd" data-set="timedZoneOverlay 1 7200" data-get="DesiredTemp_Heizung"></div>
```
### Tado mit Anwesenheit verknüpfen
In Kombination mit dem Presence (bzw. Residents) Modul kann man *tado* automatisch zwischen HOME und AWAY umschalten lassen und die Temperatur mittels FHEM absenken lassen.
Beispiel dafür:
@ -46,12 +110,12 @@ Beispiel dafür:
+*00:03:00 {
if (Value("Bewohner") eq "absent" && ReadingsVal("mytd","OverlayType_<zonenName>",0) ne "MANUAL")
{
fhem("set mytd setZoneOverlay <zonenID> 18.6; set mytd setGeo <Mobile ID> on");
fhem("set mytd setZoneOverlay <zonenID> 16; set mytd setGeo <Mobile ID> on");
Log 3, "TadoAPI: Keiner mehr zu Hause - Overlay und Geolocation wird aktiviert.";
}elsif (Value("Bewohner") eq "home" && ReadingsVal("mytd","OverlayType_Heizung",0) eq "MANUAL")
{
# jemand zu hause
fhem("set mytd setZoneOverlay <zonenID> off; set mytd setGeo <Mobile ID> off");
fhem("set mytd setZoneOverlay <zonenID> remove; set mytd setGeo <Mobile ID> off");
Log 3, "TadoAPI: Bewohner anwesend - Overlay wird deaktiviert.";
}
}
@ -60,7 +124,7 @@ if (Value("Bewohner") eq "absent" && ReadingsVal("mytd","OverlayType_<zonenName>
GPlot-Beispiel:
<img src="https://home.wolfmajer.at/wolfgit/Public/FHEM-Tado/raw/branch/master/doc/Modul2-SVG.PNG" width="500" />
<img src="https://git.wolfmajer.at/Public/FHEM-Tado/raw/branch/master/doc/Modul2-SVG.PNG" width="500" />
```
# Created by FHEM/98_SVG.pm, 2019-10-20 03:52:15
@ -69,7 +133,7 @@ set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title '<TL>'
set title 'Schafzimmer <TL> <L1>'
set ytics
set y2tics
set grid ytics
@ -78,21 +142,31 @@ set y2label "Heizleistung"
set yrange [18:26]
set y2range [0:100]
#Log_tadoAPI 4:mytd.Temperatur\x3a::
#Log_tadoAPI 4:mytd.Geolocation\x3a::$fld[3]*=30
#Log_tadoAPI 4:mytd.Luftfeuchtigkeit\x3a::
#Log_tadoAPI 4:mytd.Heizleistung\x3a::
#Log_tadoAPI 4:mytd.Temperatur_Schlafzimmer\x3a::
#Log_tadoAPI 4:mytd.OverlayType_Schlafzimmer\x3a:1:$fld[3]&&$fld[3]=~"MANUAL"?20:0
#Log_tadoAPI 4:mytd.Luftfeuchtigkeit_Schlafzimmer\x3a::
#Log_tadoAPI 4:mytd.Heizleistung_Schlafzimmer\x3a::
#Log_tadoAPI 4:mytd.DesiredTemp_Schlafzimmer\x3a::
plot "<IN>" using 1:2 axes x1y1 title 'Temperatur' ls l1fill lw 1 with lines,\
"<IN>" using 1:2 axes x1y2 title 'Geo' ls l0fill_stripe lw 1 with histeps,\
"<IN>" using 1:2 axes x1y2 title 'Abwesenheit' ls l0fill_stripe lw 0.5 with histeps,\
"<IN>" using 1:2 axes x1y2 title 'Feuchte' ls l2 lw 1 with lines,\
"<IN>" using 1:2 axes x1y2 title 'Heizleistung' ls l5 lw 1.5 with lines
"<IN>" using 1:2 axes x1y2 title 'Heizleistung' ls l5dot lw 1.5 with lines,\
"<IN>" using 1:2 axes x1y1 title 'Desired' ls l5 lw 0.5 with lines
```
## Screenshots
## Technische Information
### OAuth2 Token Authentifizierung
### Tado Geräte anzeigen (z.B. Batteriestatus)
<img src="https://home.wolfmajer.at/wolfgit/Public/FHEM-Tado/raw/branch/master/doc/gzd.PNG" width="500" />
Alle Anfragen an das API sind über *oauth2* realisiert.
Zuerst wird ein Token (mit Username und Passwort) von tado angefordert der ca. 10 Minuten gültig ist. Alle folgenden Aufrufe werden nur mehr über den Token realisiert. Das Modul prüft den Token auf Gültigkeit und erneuert ihn bevor er abläuft.
### Temperatur einer Zone manuell festlegen
<img src="https://home.wolfmajer.at/wolfgit/Public/FHEM-Tado/raw/branch/master/doc/so.PNG" width="500" />
Pfad des Token ist im Modul fix eingestellt `/fhem-root/FHEM/FhemUtils/TadoAPI_token_<fhem-devicename>`
## Credits
Thx to:
[https://shkspr.mobi/blog/2019/02/tado-api-guide-updated-for-2019/](http://)
[http://blog.scphillips.com/posts/2017/01/the-tado-api-v2/](http://)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 29 KiB

BIN
doc/tablet-ui-readings.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB