Open mamugit opened 3 months ago
Try without .py
Just hmip --list-devices
.
And you have to run the auth script before.
thank you but in my installation there is no hmip; there is only hmip_cli script and hmip_cli.py script; the .py doesn't work, the hmip_cli gives the error above.
I tried version 1.0.0 and it gives some output but also containing '\u2013' in position 60 error; 1.0.9 seems to work either but 1.1.10 has the same failure as 1.1.1
i invite you to beta test version 2 :) pip install homematicip==1.1.0.post1.dev44
Just use hmip
.
thank you! I installed python 3.12.3 and tested your beta version on my raspberry pi but unfortunately with no success:
HomematicIP-Rest-Api: 1.1.0.post1.dev44 Python: 3.12.3 (main, Jun 8 2024, 10:16:28) [GCC 12.2.0]
./hmip auth
=============================
Generating an auth token to access the HomematicIP Cloud.
Please enter the access point id []:xxx
Please enter the client/devicename (leave blank to use default): xxx
Please enter the PIN (leave Blank if there is none):
Please enter the PIN (leave Blank if there is none): xxx
Requesting connection to the HomematicIP Cloud...
Please press the blue button on the access point...
on 0: Exception in thread Thread-2 (run):
Traceback (most recent call last):
File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
self.run()
on 0: File "/usr/local/lib/python3.12/threading.py", line 1010, in run
self._target(*self._args, self._kwargs)
on 0: File "/home/mm/.local/lib/python3.12/site-packages/alive_progress/core/progress.py", line 140, in run
alive_repr(next(spinner_player), spinner_suffix)
on 0: File "/home/mm/.local/lib/python3.12/site-packages/alive_progress/core/progress.py", line 165, in alive_repr
run.last_len = print_cells(fragments, term.cols(), term, run.last_len)
on 0: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
on 0: File "/home/mm/.local/lib/python3.12/site-packages/alive_progress/utils/cells.py", line 109, in print_cells
term.write(join_cells(fragment))
on 0: File "/usr/local/lib/python3.12/encodings/iso8859_15.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
on 0: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
on 0: UnicodeEncodeError: 'charmap' codec can't encode characters in position 1-14: character maps to
=============================
/usr/local/bin/python3.12 --version Python 3.12.3
Thats progress bar when waiting for the button to be pressed. Give it another try please. I also added encoding utf-8 to open and read config file. pip install homematicip==1.1.0.post1.dev46
great, thank you! many thanks for your support! ... it's now working; auth file is created.
.... but ./hmip list devices does not find the auth file .... the auth file was generated and put to: ~/.homematicip-rest-api/config.json
seems to find the auth file if I go directly into the directory of the auth file, and start command from there, but it fails:
Devices:
(xxxxxxxxxxxxxx) - HOME_CONTROL_ACCESS_POINT - HOME_CONTROL_ACCESS_POINT
[0] - ACCESS_CONTROLLER_CHANNEL -
I am sorry. I have no idea. Something seems to be strange with encoding. Looks like click (lib for the cli) is trying to write to stdout, what doesn't work. According to click's docs they do their very best to handle unicode very well. https://click.palletsprojects.com/en/8.1.x/unicode-support/
At the point where your error happened, the config file is read correct and you got the state of your homematicIP installation.
btw: I guess i fixed the path to config file problem pip3 install homematicip==1.1.0.post1.dev47
path problem with dev47 is not solved; still the same behaviour; it only works if I directly go to ~/.homematicip-rest-api/
And if you run hmip auth again?
thanks yes it works now; new auth file resolved it!
I was able to resolve the encoding-error '\u2013' above.
The HmIP-eTRV-C-2 has the default name "Heizkörperthermostat - kompakt" which was also in the Label of the Device, as I did not change names in my HomematicIP setup. The problem is that the dash "-" in the name is not a normal dash but the wider \u2013 dash; this comes from the factory naming of eQ3 / ELV device. I changed the label naming in my HMIP setup and now I can run hmip list devices successfully
there seems to be an encoding problem in the hmip script which is not capable of handeling all possible lable names
Hello,
I was running the cli script to list devices of my installation but the command fails with the following error message:
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2013' in position 60: ordinal not in range(256) Traceback (most recent call last): File "/home/mm/.local/lib/python3.9/site-packages/homematicip/cli/hmip_cli.py", line 54, in main if not run(config, home, logger, parsed_args): File "/home/mm/.local/lib/python3.9/site-packages/homematicip/cli/hmip_cli.py", line 135, in run print("{} {}".format(d.id, str(d))) UnicodeEncodeError: 'latin-1' codec can't encode character '\u2013' in position 60: ordinal not in range(256)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/mm/.local/bin/./hmip_cli", line 8, in
sys.exit(main())
File "/home/mm/.local/lib/python3.9/site-packages/homematicip/cli/hmip_cli.py", line 69, in main
if parsed_args.log_level:
AttributeError: 'Namespace' object has no attribute 'log_level'
I have installed it on Debian 11 bulleseye on a 64bit x86 machine using Python 3.9.2 on a raspberry pi 5 with 64 bit Raspbian Bookworm with Python 3.11.2 python3 hmip_cli.py is not running at all; no output with --list-devices. Generation auf Auth token worked well on Raspberry Pi as well as on my x86 machine. hmip_cli.py --dump-devices is working on x86 machine. I'm wondering why --list-devices fails ??? Any idea ?
after installation I got a the following script to run hmip_cli:
cat hmip_cli
!/usr/bin/python3
-- coding: utf-8 --
import re import sys from homematicip.cli.hmip_cli import main if name == 'main': sys.argv[0] = re.sub(r'(-script.pyw|.exe)?$', '', sys.argv[0]) sys.exit(main())
here is the version I'm using: pip3 show homematicip Name: homematicip Version: 1.1.1