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

Devices display "Disconnected" #24

Closed
ACrazyConcept opened this issue Apr 24, 2020 · 8 comments
Closed

Devices display "Disconnected" #24

ACrazyConcept opened this issue Apr 24, 2020 · 8 comments

Comments

@ACrazyConcept
Copy link

When they are in fact connected to the router. So wondering if I have to change some setting somewhere?

@elad-bar
Copy link
Owner

can you please post the log?

@ACrazyConcept
Copy link
Author

Sure.

I checked the settings as well:
image

I have some mobile devices which I can kindof understand would be considered disconnected while not in use.

But also a Windows 10 client and several Raspberry Pi's running HA, pi-hole and deCONZ. They are all displayed as Disconnected.

I removed a lot of the repeating entries and my device names from the log:

020-04-25 10:00:20 DEBUG (MainThread) [custom_components.edgeos.clients.web_socket] Starting to handle next message
2020-04-25 10:00:20 DEBUG (MainThread) [custom_components.edgeos.managers.data_manager] Running parser of export
2020-04-25 10:00:20 DEBUG (MainThread) [custom_components.edgeos.managers.data_manager] Handle export data
020-04-25 10:00:20 DEBUG (MainThread) [custom_components.edgeos.clients.web_socket] Starting to handle next message
2020-04-25 10:01:07 DEBUG (MainThread) [custom_components.edgeos.clients.web_socket] Parse message skipped (Empty)

Hope it was not too much...

2020-04-25 10:02:46 INFO (SyncWorker_2) [homeassistant.loader] Loaded edgeos from custom_components.edgeos,
2020-04-25 10:02:47 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for edgeos which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.,
2020-04-25 10:02:50 DEBUG (MainThread) [custom_components.edgeos] Starting async_setup_entry of edgeos,
2020-04-25 10:03:34 DEBUG (MainThread) [custom_components.edgeos.managers.home_assistant] Initializing EdgeOS @2020-04-25 08:03:34.426683+00:00,
2020-04-25 10:03:35 DEBUG (MainThread) [custom_components.edgeos.clients.web_login] Sleeping 1 to make sure the session id is in the filesystem,
2020-04-25 10:03:36 DEBUG (MainThread) [custom_components.edgeos.managers.data_manager] Initializing API,
2020-04-25 10:03:36 DEBUG (MainThread) [custom_components.edgeos.managers.data_manager] Requesting initial data,
2020-04-25 10:03:36 DEBUG (MainThread) [custom_components.edgeos.models.base_entity] Starting async_setup_entry binary_sensor,
2020-04-25 10:03:36 DEBUG (MainThread) [custom_components.edgeos.models.base_entity] Starting async_setup_entry sensor,
2020-04-25 10:03:36 DEBUG (MainThread) [custom_components.edgeos.models.base_entity] Starting async_setup_entry device_tracker,
2020-04-25 10:03:37 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Status of https://10.0.0.1/api/edge/heartbeat.json?t=1587801816: 200,
2020-04-25 10:03:37 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Heartbeat response: {'SESSION': True, 'PING': True},
2020-04-25 10:03:37 DEBUG (MainThread) [custom_components.edgeos.managers.data_manager] Getting devices by API,
2020-04-25 10:03:38 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Status of https://10.0.0.1/api/edge/get.json: 200,
2020-04-25 10:03:38 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Status of https://10.0.0.1/api/edge/data.json?data=sys_info: 200,
2020-04-25 10:03:38 DEBUG (MainThread) [custom_components.edgeos.managers.data_manager] Getting unknown devices by API,
2020-04-25 10:03:38 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Status of https://10.0.0.1/api/edge/data.json?data=dhcp_leases: 200,
2020-04-25 10:03:38 DEBUG (MainThread) [custom_components.edgeos.managers.home_assistant] Post initial login action,
2020-04-25 10:03:38 INFO (MainThread) [custom_components.edgeos.managers.home_assistant] Handling ConfigEntry change: {'entry_id': 'f4ae62455f0c4a7fac09b65ca489ffe7', 'version': 1, 'domain': 'edgeos', 'title': 'EdgeOS', 'data': {'host': '10.0.0.1', 'name': 'EdgeOS', 'password': [redacted], 'unit': 'MBytes', 'username': [redacted]}, 'options': {'monitored_devices': [[redacted]], 'monitored_interfaces': ['eth0', 'eth1', 'eth2', 'eth3', 'eth4', 'switch0', 'lo'], 'track_devices': [], 'update_interval': 55}, 'system_options': {'disable_new_entities': False}, 'source': 'user', 'connection_class': 'local_poll', 'unique_id': None},
2020-04-25 10:03:38 DEBUG (MainThread) [custom_components.edgeos.managers.home_assistant] discover_all started,
2020-04-25 10:03:38 INFO (MainThread) [custom_components.edgeos.managers.device_manager] EdgeOS device created: {'identifiers': {('EdgeOS', 'Ubiquiti ER-X-SFP ubnt')}, 'name': 'Ubiquiti ER-X-SFP ubnt', 'manufacturer': 'Ubiquiti', 'model': 'ER-X-SFP', 'sw_version': 'EdgeRouter.ER-e50.v2.0.8-hotfix.1.5278088.200305.1641'},
2020-04-25 10:03:38 DEBUG (MainThread) [custom_components.edgeos.managers.data_manager] Initializing WS using session: 7c1fd2e06edc42568d144aeb7e46ebf6,
2020-04-25 10:03:38 DEBUG (MainThread) [custom_components.edgeos.clients.web_socket] Initializing WS connection,
2020-04-25 10:03:38 INFO (MainThread) [custom_components.edgeos.clients.web_socket] Connection attempt #1,
2020-04-25 10:03:38 DEBUG (MainThread) [custom_components.edgeos.managers.home_assistant] Update API: 2020-04-25 10:03:38.680883,
2020-04-25 10:03:38 DEBUG (MainThread) [custom_components.edgeos.managers.data_manager] Getting devices by API,
2020-04-25 10:03:38 INFO (MainThread) [custom_components.edgeos.clients.web_socket] Starting to listen connected,
2020-04-25 10:03:38 DEBUG (MainThread) [custom_components.edgeos.clients.web_socket] Subscription data to be sent: 164,
2020-04-25 10:03:38 INFO (MainThread) [custom_components.edgeos.clients.web_socket] Subscribed to WS payloads,
...
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Interface eth0 restored | binary_sensor.edgeos_interface_eth0,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Interface eth1 restored | binary_sensor.edgeos_interface_eth1,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Interface eth2 restored | binary_sensor.edgeos_interface_eth2,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Interface eth3 restored | binary_sensor.edgeos_interface_eth3,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Interface eth4 restored | binary_sensor.edgeos_interface_eth4,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device [redacted] restored | binary_sensor.edgeos_device_[redacted],
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device ...
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS System Status restored | binary_sensor.edgeos_system_status,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Unknown Devices restored | sensor.edgeos_unknown_devices,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS System Uptime restored | sensor.edgeos_system_uptime,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Interface eth0,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Interface eth1,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Interface eth2,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Interface eth3,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Interface eth4,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device [redacted],
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Device
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS System Status,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.sensor] Added new EdgeOS Unknown Devices,
2020-04-25 10:03:39 INFO (MainThread) [custom_components.edgeos.sensor] Added new EdgeOS System Uptime,
2020-04-25 10:03:39 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Status of https://10.0.0.1/api/edge/get.json: 200,
2020-04-25 10:03:40 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Status of https://10.0.0.1/api/edge/data.json?data=sys_info: 200,
2020-04-25 10:03:40 DEBUG (MainThread) [custom_components.edgeos.managers.data_manager] Getting unknown devices by API,
2020-04-25 10:03:40 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Interface switch0 restored | binary_sensor.edgeos_interface_switch0,
2020-04-25 10:03:40 INFO (MainThread) [custom_components.edgeos.managers.entity_manager] Entity EdgeOS Interface lo restored | binary_sensor.edgeos_interface_lo,
2020-04-25 10:03:40 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Interface switch0,
2020-04-25 10:03:40 INFO (MainThread) [custom_components.edgeos.binary_sensor] Added new EdgeOS Interface lo,
2020-04-25 10:03:40 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Status of https://10.0.0.1/api/edge/data.json?data=dhcp_leases: 200,


2020-04-25 10:04:09 DEBUG (SyncWorker_2) [custom_components.edgeos.clients.web_socket] Keep alive data to be sent: {CLIENT_PING},
2020-04-25 10:04:09 DEBUG (SyncWorker_2) [custom_components.edgeos.clients.web_socket] Keep alive message sent @2020-04-25 08:04:09.004325+00:00,

2020-04-25 10:04:34 DEBUG (MainThread) [custom_components.edgeos.managers.home_assistant] Update API: 2020-04-25 10:04:34.007972,
2020-04-25 10:04:34 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Status of https://10.0.0.1/api/edge/heartbeat.json?t=1587801874: 200,
2020-04-25 10:04:34 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Heartbeat response: {'SESSION': True, 'PING': True},
2020-04-25 10:04:34 DEBUG (MainThread) [custom_components.edgeos.managers.data_manager] Getting devices by API,

2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.clients.web_socket] Parse message skipped (Empty),

2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Status of https://10.0.0.1/api/edge/get.json: 200,
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Status of https://10.0.0.1/api/edge/data.json?data=sys_info: 200,
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.managers.data_manager] Getting unknown devices by API,
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.clients.web_api] Status of https://10.0.0.1/api/edge/data.json?data=dhcp_leases: 200,
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.managers.home_assistant] discover_all started,
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.binary_sensor] EdgeOS Interface eth0 updated from False to True,
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.binary_sensor] EdgeOS Interface eth1 updated from False to True,
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.binary_sensor] EdgeOS Interface eth2 updated from False to True,
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.binary_sensor] EdgeOS Interface eth3 updated from False to True,
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.binary_sensor] EdgeOS Interface eth4 updated from False to True,
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.binary_sensor] EdgeOS Device [redacted] updated from False to True,
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.binary_sensor] EdgeOS Device 
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.binary_sensor] EdgeOS Device 
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.binary_sensor] EdgeOS Device 
2020-04-25 10:04:35 DEBUG (MainThread) [custom_components.edgeos.sensor] EdgeOS System Uptime updated from 37532 to 37586,

@elad-bar
Copy link
Owner

Seems that the component doesn't get events or not handling them correctly,
to check whether the issue is router or component related.

Role out router not publishing information about device:

  1. Login to the EdgeOS router with Developer Tools opened
  2. Refresh the UI once you are logged in
  3. In Network tab of Developer Tools look for resource stats, click on it
  4. Go to messages and filter messages that match to Export
  5. In messages you should have message begins with { "Export": {, click on it
  6. Do you find the IP of the device you are expecting to?

Role out component is not handling those events:
Configure HA logger to debug log level according to the following configuration

logger:
  logs:
    custom_components.edgeos: warning
    custom_components.edgeos.clients.web_socket: debug

Go to Developers -> Service and run service edgeos.log_events with data:

enabled: True

Then run

wait 2 minutes save the log to file

Run edgeos.save_debug_data service

Upload log file and result 2nd service as an attachements.

Developer Tool (Highlighted Tab and filters):
image

@ACrazyConcept
Copy link
Author

Seems that the component doesn't get events or not handling them correctly,
to check whether the issue is router or component related.

Role out router not publishing information about device:

  1. Login to the EdgeOS router with Developer Tools opened
  2. Refresh the UI once you are logged in
  3. In Network tab of Developer Tools look for resource stats, click on it
  4. Go to messages and filter messages that match to Export
  5. In messages you should have message begins with { "Export": {, click on it
  6. Do you find the IP of the device you are expecting to?

No I only see some of the IPs. All those that display as Connected I see. And only a couple of the ones that are Disconnected.
I am missing all the hassbian IPs for example.
image

@ACrazyConcept
Copy link
Author

ACrazyConcept commented Apr 25, 2020

Just tried to open a browser on my Windows 10 machine and then it changed to Connected.
Maybe it only becomes Connected if a client connect to the internet?

Edit: Yeah. Tried a 'apt update' on one of the Pi's. It changed to Connected right then.

@elad-bar
Copy link
Owner

Only once there is communication (tx is greater than 0), will check if there is a way to consider rx as well

@elad-bar
Copy link
Owner

updated, please try

@ACrazyConcept
Copy link
Author

It helped for a couple of clients, like the windows 10 and pi-hole. But the hassbian Pi's are still Disconnected.
I guess if they do not really communicate with the internet but only locally it might not be possible to detect? I don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants