Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netio switch ignores configured login credentials #14245

Closed
derandiunddasbo opened this issue May 2, 2018 · 3 comments
Closed

netio switch ignores configured login credentials #14245

derandiunddasbo opened this issue May 2, 2018 · 3 comments

Comments

@derandiunddasbo
Copy link

Home Assistant release with the issue: 0.68.1

Last working Home Assistant release (if known): n/A

Operating environment (Hass.io/Docker/Windows/etc.): Docker @ Synology

Component/platform: https://www.home-assistant.io/components/switch.netio/

Description of problem:
The netio switch component ignores the username / password setting in the configuration file and always tries to connect with the credentials admin / admin.

If the admin user doesn't exist or uses another password, the login fails.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

switch:
  - platform: netio
    host: 192.168.4.2
    username: steuerung
    password: ***
    outlets:
      1: DSN1
      2: DSN2
      3: Router
      4: Box

Traceback (if applicable):

2018-05-02 17:38:37 INFO (MainThread) [homeassistant.components.switch] Setting up switch.netio
2018-05-02 17:38:38 DEBUG (SyncWorker_4) [pynetio] 192.168.4.2: received '100 HELLO EE95CABC - KSHELL V1.4\r\n'
2018-05-02 17:38:38 DEBUG (SyncWorker_4) [pynetio] 192.168.4.2: sending 'login admin admin\r\n'
2018-05-02 17:38:38 DEBUG (SyncWorker_4) [pynetio] 192.168.4.2: received '503 INVALID LOGIN\r\n'
2018-05-02 17:38:38 WARNING (SyncWorker_4) [pynetio] command error: '503 INVALID LOGIN\r\n'
2018-05-02 17:38:38 DEBUG (SyncWorker_4) [pynetio] 192.168.4.2: sending 'port list\r\n'
2018-05-02 17:38:38 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: timestamp=1525275518.0890868, level=WARNING, message=command error: '503 INVALID LOGIN\r\n', exception=, source=components/switch/netio.py>
2018-05-02 17:38:38 DEBUG (SyncWorker_4) [pynetio] 192.168.4.2: received '505 FORBIDDEN\r\n'
2018-05-02 17:38:38 WARNING (SyncWorker_4) [pynetio] command error: '505 FORBIDDEN\r\n'
2018-05-02 17:38:38 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: timestamp=1525275518.09867, level=WARNING, message=command error: '505 FORBIDDEN\r\n', exception=, source=components/switch/netio.py>
2018-05-02 17:38:38 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform netio
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/switch/netio.py", line 64, in setup_platform
    dev = Netio(host, port, username, password)
  File "/usr/local/lib/python3.6/site-packages/pynetio.py", line 31, in __init__
    self.connect()
  File "/usr/local/lib/python3.6/site-packages/pynetio.py", line 40, in connect
    self.update()
  File "/usr/local/lib/python3.6/site-packages/pynetio.py", line 48, in update
    self.states = [bool(int(x)) for x in self.get('port list') or '0000']
  File "/usr/local/lib/python3.6/site-packages/pynetio.py", line 48, in <listcomp>
    self.states = [bool(int(x)) for x in self.get('port list') or '0000']
ValueError: invalid literal for int() with base 10: 'F'

Additional information:

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@balloobbot
Copy link

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

@derandiunddasbo
Copy link
Author

The behavior is still the same in HA 0.77.1, i.e. the component still ignores the username/password setting from the config:

2018-09-13 13:45:10 INFO (MainThread) [homeassistant.components.light] Setting up light.knx
2018-09-13 13:45:11 DEBUG (SyncWorker_8) [pynetio] 192.168.4.50: received '100 HELLO 64968CD0 - KSHELL V1.4\r\n'
2018-09-13 13:45:11 DEBUG (SyncWorker_8) [pynetio] 192.168.4.50: sending 'login admin admin\r\n'
2018-09-13 13:45:11 DEBUG (SyncWorker_8) [pynetio] 192.168.4.50: received '250 OK\r\n'
2018-09-13 13:45:11 DEBUG (SyncWorker_8) [pynetio] 192.168.4.50: sending 'port list\r\n'
2018-09-13 13:45:11 DEBUG (SyncWorker_8) [pynetio] 192.168.4.50: received '250 1111\r\n'
2018-09-13 13:45:11 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
    await entity.async_update_ha_state()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 235, in async_update_ha_state
    state = self.state
  File "/usr/src/app/homeassistant/helpers/entity.py", line 425, in state
    return STATE_ON if self.is_on else STATE_OFF
  File "/usr/src/app/homeassistant/components/switch/netio.py", line 162, in is_on
    return self.netio.states[self.outlet - 1]

Is this component still under active development?

@J4nsen J4nsen mentioned this issue Oct 13, 2018
6 tasks
@home-assistant home-assistant locked and limited conversation to collaborators Dec 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants