hass-browser_mod icon indicating copy to clipboard operation
hass-browser_mod copied to clipboard

Key error

Open mobiledude opened this issue 2 years ago • 4 comments

My Home Assistant version: Home Assistant 2023.7.2 Frontend-versie: 20230705.1 - latest

browsermod version: 2.3.0

What I am doing: just running integration, error created on reboot

What I expected to happen: no error

What happened instead: below error created

Minimal steps to reproduce: just a reboot

# The least amount of code or steps possible to reproduce my error

# Put your code/steps here

Error messages from the browser console:

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/browser_mod/browser.py:65
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 06:10:12 (13 occurrences)
Last logged: 06:10:24

[23425406746128] Error handling message: Unknown error (unknown_error) J from x.x.x.x.x.x (Mozilla/5.0 (iPhone; CPU iPhone OS 16_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Home Assistant/2023.4 (io.robbie.HomeAssistant; build:2023.460; iOS 16.5.1) Mobile/HomeAssistant, like Safari)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/browser_mod/connection.py", line 61, in handle_connect
    dev = getBrowser(hass, browserID)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/browser_mod/browser.py", line 198, in getBrowser
    browsers[browserID] = BrowserModBrowser(hass, browserID)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/browser_mod/browser.py", line 42, in __init__
    self.update_entities(hass)
  File "/config/custom_components/browser_mod/browser.py", line 71, in update_entities
    _assert_browser_sensor("sensor", "path", "Browser path", icon="mdi:web")
  File "/config/custom_components/browser_mod/browser.py", line 65, in _assert_browser_sensor
    adder = hass.data[DOMAIN][DATA_ADDERS][type]
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'sensor'


By replacing the space in the checkboxes ([ ]) with an X below, I indicate that I:

  • [x] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).

  • [x] Have made sure I am using the latest version of the plugin.

  • [x] Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.

  • [x] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

mobiledude avatar Jul 19 '23 05:07 mobiledude

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 15 '23 07:10 stale[bot]

Please check, having the same issue(s) The IP that is mentioned is the laptop from my employer which is quite well shielded, could it be that it prevents certain things to run?

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/browser_mod/browser.py:65
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 15:19:51 (5 occurrences)
Last logged: 15:19:57

[140348186546752] Error handling message: Unknown error (unknown_error) admin from 192.x.x.x (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/browser_mod/connection.py", line 143, in handle_update
    dev = getBrowser(hass, browserID)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/browser_mod/browser.py", line 198, in getBrowser
    browsers[browserID] = BrowserModBrowser(hass, browserID)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/browser_mod/browser.py", line 42, in __init__
    self.update_entities(hass)
  File "/config/custom_components/browser_mod/browser.py", line 71, in update_entities
    _assert_browser_sensor("sensor", "path", "Browser path", icon="mdi:web")
  File "/config/custom_components/browser_mod/browser.py", line 65, in _assert_browser_sensor
    adder = hass.data[DOMAIN][DATA_ADDERS][type]
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'sensor'

vingerha avatar Nov 07 '23 16:11 vingerha

Revoking my suspicion as I now have another error from a local laptop...binary_sensor instead of sensor

2023-11-08 07:24:12.744 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140050756098368] Error handling message: Unknown error (unknown_error) admin from 192.x.y.z (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/browser_mod/connection.py", line 143, in handle_update
    dev = getBrowser(hass, browserID)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/browser_mod/browser.py", line 198, in getBrowser
    browsers[browserID] = BrowserModBrowser(hass, browserID)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/browser_mod/browser.py", line 42, in __init__
    self.update_entities(hass)
  File "/config/custom_components/browser_mod/browser.py", line 79, in update_entities
    _assert_browser_sensor(
  File "/config/custom_components/browser_mod/browser.py", line 65, in _assert_browser_sensor
    adder = hass.data[DOMAIN][DATA_ADDERS][type]
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'binary_sensor'

vingerha avatar Nov 08 '23 06:11 vingerha

Also been getting this error for some time when restarting HA, and have my dashboard open in at least one browser during the restart

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/browser_mod/browser.py:65
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 22:24:58 (1 occurrences)
Last logged: 22:24:58

[139816480475328] Error handling message: Unknown error (unknown_error) Tablet from 192.168.1.177 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/browser_mod/connection.py", line 143, in handle_update
    dev = getBrowser(hass, browserID)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/browser_mod/browser.py", line 198, in getBrowser
    browsers[browserID] = BrowserModBrowser(hass, browserID)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/browser_mod/browser.py", line 42, in __init__
    self.update_entities(hass)
  File "/config/custom_components/browser_mod/browser.py", line 71, in update_entities
    _assert_browser_sensor("sensor", "path", "Browser path", icon="mdi:web")
  File "/config/custom_components/browser_mod/browser.py", line 65, in _assert_browser_sensor
    adder = hass.data[DOMAIN][DATA_ADDERS][type]
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'sensor'

Looks like an old issue: https://github.com/thomasloven/hass-browser_mod/issues/106

Scoff123 avatar Feb 09 '24 22:02 Scoff123