Home Assistant is an advanced solution for house automation (a.k.a. “smart home”). If you want a very simple client for your Home Assistant installation which reads some values and outputs them in a formatted way, this is for you. Basically this is how it works:
- Checkout the project to your computer (or just copy
main.pyandconfig-template.ini) from here. - Copy
config-template.initoconfig.iniand edit it so it contains your Home Assistant login data, the requests you want the script to make and the formatted output containing the values. - Install the dependencies, e.g. by executing
pip3 install -r requirements.txt(possibly inside a venv). - Call
main.pywith at least Python 3.2 installed (possibly inside the same venv).
Example
When using the formatted output from config-template.ini, this is what the script could print (given Home Assistant has the configured devices and parameters):
Temperature: 23.5 °C
Humidity: 47 %
Notes regarding the output configured in config.ini
- If you want multiline output, you have to indent the second to the last line by 4 spaces each.
- You can include Python snippets inside the curly braces if you want (example in
config-template.ini).
Code
The code is available here.