Package: pytadolog
pytadologis a Python module which extends thepython-tadopackage so that data can be logged from the Tado web API to a local CSV
file.InstallationNote about PyTadoThis package requires python-tado to query the TADO web API, however
development of the main package appears to have stalled. There are a
number of forks available on PyPI with different APIs and varying
aliases (python-tadoac,python-tado (PyPI),pytado). This package was
developed withpython-tadov0.2.9 cloned directly from GitHub, it
has been tested to be compatible withcommit 00a9ab1.Therefore, before installing pytadolog you must first install the
correct version of pytado. This can be achieved using the package
managerpipas below:pipinstallgit+https://git@github.com/chrism0dwk/PyTado.git@00a9ab12569e84a5537c2a0517c3a6b5cbb9d535pip can then be used to installpytadolog.pipinstallpytadologUsagepytadologincludes a helpful console script and can easily be
invoked with:>>>tadologCommandline arguments can also be provided to customisepytadolog.
These can be explored using:>>>tadolog-husage:__main__.py[-h][-oOUTDIR][--update-periodUPDATE_PERIOD][--last-dayLAST_DAY][-m]optionalarguments:-h,--helpshowthishelpmessageandexit-oOUTDIR,--outdirOUTDIRpathtooutputdirectory--update-periodUPDATE_PERIODtimeinsecondsbetweenupdates--last-dayLAST_DAYlastdayofweekas3letterstring--disable-multiprocusesingleprocessforwebqueryandcsvsaving-d,--debuglogdebuggingstatementstofile-v,--verboseloginfostatementstofileCSV conversionThis package includes a handy script to convert created CSV files to
Excel files. Conversion requiresopenpyxlto be installed. The
script can be invoked from the console using:>>>csv2excelpath/to/csvAgain, console arguments can be passed to the script to customise
execution:>>>csv2excel-husage:csv2excel[-h][-oOUTPATH][--dropna]inputpositionalarguments:inputpathtocsvtoconvertoptionalarguments:-h,--helpshowthishelpmessageandexit-oOUTPATH,--outpathOUTPATHpathtooutputxlsx--dropnadropNaNvaluesinxlsxOther methods for launching pytadologThe package can be invoked using themain()method of the package:>>>python-mpytadologAlternativelytheclasscanbeimportedintoPythonandstartedexplicitly:```pythonfrompytadologimportTadoLoggerwithTadoLogger()astl:tl.start()# Starts logging to CSVUsing the context manager ensures that scheduled events are cleaned up
when the process is terminated. This can be handled explicitly by
calling theclose()method:frompytadologimportTadoLoggertl=TadoLogger()try:tl.start()# Starts logging to CSVexceptKeyboardInterrupt:tl.close()# Cancels scheduled eventsOutputpytadologcreates a CSV file containing weather data for the
registered home and set temperature, heating power, measured temperature
and relative humidity of each zone in the home. This is structured using
apandasMultiIndex. The CSV is updated at theupdate_periodwhich defaults to 30s as this is the fastest Tado queries connected
devices. By default the CSVs will be stored in home/Documents/TadoLogsThe CSV will be structured like this:ZoneWe
atherWe
atherWe
atherLivin
groomLivin
groomLivin
groomLivin
groomLivin
groomHallHallHallHallHallVar
iableOu
tside
Temp
(°C)Solar
Int.
(%)We
atherTemp
(°C)R.H.
(%)Set
Temp
(°C)He
ating
Power
(%)Open
W
indowTemp
(°C)R.H.
(%)Set
Temp
(°C)He
ating
Power
(%)Open
W
indow2021-
02-20
19:
03:3013.330.0NI
GHT_C
LOUDY23.8845.020.00.0FALSE18.5658.413.00.0FALSE2021-
02-20
19:
04:0013.330.0NI
GHT_C
LOUDY23.8845.020.00.0FALSE18.5658.413.00.0FALSE2021-
02-20
19:
04:3013.330.0NI
GHT_C
LOUDY23.8845.020.00.0FALSE18.5658.413.00.0FALSEpytadologwill also generate a logfile to track progress. This is
stored in a logs/ subdirectory in the output directory, i.e.
home/Documents/TadoLogs/logs by default.Tado credentialspytadologuseskeyringto store the Tado log in credentials
securely using the operating system’s default keyring service.From thekeyringREADME:These recommended keyring backends are supported:macOSKeychainFreedesktopSecret Servicesupports many DE including GNOME
(requiressecretstorage)KDE4 & KDE5KWallet(requiresdbus)Windows Credential LockerOther keyring implementations are available throughThird-Party
Backends.ContributingPull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.[Black](https://black.readthedocs.io/) is used to format all Python files.A GitHub action is set-up to automatically build and publish tagged releases
to the [PyPI](https://pypi.org/project/pytadolog/) repository. All pushes to
the master branch are built and published to the [TestPyPI](https://test.pypi.org/project/pytadolog/)
repository.LicenseMIT