kbr / fritzconnection

Python-Tool to communicate with the AVM Fritz!Box by the TR-064 protocol and the AHA-HTTP-Interface
MIT License
304 stars 59 forks source link

Problem with fritzhomeauto (fritzconnection v1.3.4 & FRITZ!OS 07.20) #71

Closed Sc0rc3d closed 3 years ago

Sc0rc3d commented 3 years ago

Hello,

I wanted to query the values for the Smart-Home components on my FRITZ!box in the console. Unfortunately it does not work and I receive the following message:

root@PiSRV:~# fritzhomeauto -p Password_to_my_fritzbox (by the way, why no username?)

fritzconnection v1.3.4 FRITZ!Box 6590 Cable at http://169.254.1.1 FRITZ!OS: 7.20

FritzHomeautomation: Status of registered home-automation devices:

Device Name AIN Power[W] t[°C] switch Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/fritzconnection/core/soaper.py", line 123, in raise_fritzconnection_error root = etree.fromstring(response.content) File "/usr/lib/python3.7/xml/etree/ElementTree.py", line 1315, in XML parser.feed(text) xml.etree.ElementTree.ParseError: mismatched tag: line 1, column 156

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/fritzhomeauto", line 8, in sys.exit(main()) File "/usr/local/lib/python3.7/dist-packages/fritzconnection/cli/fritzhomeauto.py", line 80, in main report_status(fh, arguments) File "/usr/local/lib/python3.7/dist-packages/fritzconnection/cli/fritzhomeauto.py", line 51, in report_status report_compact(fh) File "/usr/local/lib/python3.7/dist-packages/fritzconnection/cli/fritzhomeauto.py", line 34, in report_compact for di in fh.device_informations(): File "/usr/local/lib/python3.7/dist-packages/fritzconnection/lib/fritzhomeauto.py", line 65, in device_informations info = self.get_device_information_by_index(n) File "/usr/local/lib/python3.7/dist-packages/fritzconnection/lib/fritzhomeauto.py", line 48, in get_device_information_by_index return self._action('GetGenericDeviceInfos', NewIndex=index) File "/usr/local/lib/python3.7/dist-packages/fritzconnection/lib/fritzhomeauto.py", line 30, in _action return self.fc.call_action(SERVICE, actionname, arguments=arguments) File "/usr/local/lib/python3.7/dist-packages/fritzconnection/core/fritzconnection.py", line 220, in call_action return self.soaper.execute(service, action_name, arguments) File "/usr/local/lib/python3.7/dist-packages/fritzconnection/core/soaper.py", line 233, in execute return handle_response(response) File "/usr/local/lib/python3.7/dist-packages/fritzconnection/core/soaper.py", line 218, in handle_response raise_fritzconnection_error(response) File "/usr/local/lib/python3.7/dist-packages/fritzconnection/core/soaper.py", line 133, in raise_fritzconnection_error raise FritzConnectionException(msg) fritzconnection.core.exceptions.FritzConnectionException: Unable to perform operation. 401 Unauthorized (ERR_NONE)401 UnauthorizedERR_NONEWebserver Sun, 27 Sep 2020 12:01:03 GMT

Am I doing something wrong or is it a mistake that might be caused by the new FRITZ!OS 07.20?

bulkw4r3 commented 3 years ago

works for me under 7.20@7590 You ask "why no username"? Did you try something like this: fritzhomeauto -i 'ipaddress' -u 'user' -p 'password'

i get:

fritzconnection v1.3.4 FRITZ!Box 7590 at http://192.168.1.1 FRITZ!OS: 7.20

FritzHomeautomation: Status of registered home-automation devices:

Sc0rc3d commented 3 years ago

@bulkw4r3 You sneaky little bastard. ;-)

i tryed without the ''.

The funny thing is, with "fritzstatus" for example it works without the '' and I get the correct output.

root@PiSRV:~# fritzstatus -p Password_to_my_fritzbox

fritzconnection v1.3.4 FRITZ!Box 6590 Cable at http://169.254.1.1 FRITZ!OS: 7.20

FritzStatus:

is linked           : True
is connected        : True
external ip (v4)    : x.x.x.x
external ip (v6)    : 2a02:xxxxxx
uptime              : 93:39:56
bytes send          : 2628619721
bytes received      : 181744948234
max. bit rate       : ('97.1 MBit/s', '968.4 MBit/s')

Now also works for me. Thanks bulkw4r3.

/close

bulkw4r3 commented 3 years ago

funny - fritzstatus needs not really a password, it works with 1234