python-fritzhome icon indicating copy to clipboard operation
python-fritzhome copied to clipboard

How to ... (control thermostats)

Open Geranni opened this issue 4 years ago • 2 comments

Hello hthiery,

I really like the idea of the project and would like to use it for control of my FRITZ DECT 301 thermostats. As I didn't find any documentation of how to put your code into practice, I cloned the repository and searched line for line through the code for hints on how it works and how to apply it. After 4 hours of work I was finally able to switch my DECT 200 on and off using CLI. Another hour later I still don't have any idea how I can set temperatures on my thermostats... Can you please give a hint, how to use your code to achieve this? Also it would be great if you could add some documentation to make the application of your great project a little bit more user friendly.

Thank you very much!

Geranni avatar Dec 10 '21 09:12 Geranni

Thank you for your feedback. Unfortunatly there is no support for setting the temp with the CLI.

For setting the temperature of a thermostate take a look at: https://github.com/hthiery/python-fritzhome/blob/master/pyfritzhome/devicetypes/fritzhomedevicethermostat.py#L93 and https://github.com/hthiery/python-fritzhome/blob/master/pyfritzhome/devicetypes/fritzhomedevicethermostat.py#L117

I hope that helps a little bit. For your idea about adding documentation please feel free to make a PR ;-)

hthiery avatar Dec 22 '21 13:12 hthiery

A little late late, but i also needed some time to get it running:

My steps:

  • cd ~
  • clone repo into "python-fritzhome"
  • create python venv and activate it, cd ~ againg
  • make the python-fritzhome module available:) pip3 install -e python-fritzhome
  • go to cli file: cd python-fritzhome/pyfritzhome
  • list all devices and get the ain for your thermostat
  • python cli.py -f fritz.box -u smarthome -p smarthome23 list
  • python cli.py -f fritz.box -u smarthome -p smarthome thermostat set_target_temperature "xxxxx yyyyyy" 17

hope it still helps :)

Hendrick42 avatar Mar 27 '22 09:03 Hendrick42