cgarwood / homeassistant-fullykiosk

Fully Kiosk Browser integration for Home Assistant
Apache License 2.0
153 stars 27 forks source link

Unable to add to HomeAssistant #95

Closed labzilla closed 2 years ago

labzilla commented 2 years ago

I'm receiving an error when attempting to add FullyKiosk to HomeAssistant. I'm on the latest version of HomeAssistant Core 2022.5.0 (running in a Docker container, using the host network). The error on the configuration page is "Unexpected error."

The tablet is an Android 10 tablet, running FullyKiosk 1.47.2-play.

Checking the HomeAssistant log files, I see this:

Logger: custom_components.fullykiosk.config_flow
Source: custom_components/fullykiosk/config_flow.py:50 
Integration: Fully Kiosk Browser ([documentation](https://github.com/cgarwood/homeassistant-fullykiosk), [issues](https://github.com/cgarwood/homeassistant-fullykiosk/issues)) 
First occurred: 3:50:06 PM (2 occurrences) 
Last logged: 3:55:17 PM

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/fullykiosk/config_flow.py", line 80, in async_step_user
    info = await validate_input(self.hass, user_input)
  File "/config/custom_components/fullykiosk/config_flow.py", line 50, in validate_input
    deviceInfo = await fully.getDeviceInfo()
  File "/usr/local/lib/python3.9/site-packages/fullykiosk/__init__.py", line 29, in getDeviceInfo
    result = await self.sendCommand("deviceInfo")
  File "/usr/local/lib/python3.9/site-packages/fullykiosk/__init__.py", line 21, in sendCommand
    data = await self._rh.get(
  File "/usr/local/lib/python3.9/site-packages/fullykiosk/__init__.py", line 129, in get
    data = await response.json(content_type="text/html")
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1103, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: application/json', url=URL('http://10.0.1.246:2323/?cmd=deviceInfo&password=REMOVED-PASSWORD&type=json')
labzilla commented 2 years ago

When I paste the URL mentioned in the log file (last line) I receive the following (sanitized, but the values that I removed are correct)

{"deviceName":"bedroomkiosk","packageName":"de.ozerov.fully","batteryLevel":52,"isPlugged":true,"SSID":"<unknown ssid>","BSSID":"####removed####","Mac":"####removed####","ip4":"10.0.1.246","ip6":"####removed####","hostname4":"10.0.1.246","hostname6":"####removed####","wifiSignalLevel":9,"isMobileDataEnabled":false,"screenOrientation":90,"screenBrightness":37,"screenLocked":true,"screenOn":false,"batteryTemperature":25,"plugged":true,"keyguardLocked":true,"locale":"en_US","serial":"unknown","build":"TB-X306F_S100152_210205_BMP","androidVersion":"10","webviewUA":"Mozilla/5.0 (Linux; Android 10; Lenovo TB-X306F Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.88 Safari/537.36","motionDetectorStatus":2,"isDeviceAdmin":true,"isDeviceOwner":false,"internalStorageFreeSpace":21280280576,"internalStorageTotalSpace":24654241792,"ramUsedMemory":1110396928,"ramFreeMemory":795754496,"ramTotalMemory":1906151424,"appUsedMemory":8270744,"appFreeMemory":260164712,"appTotalMemory":268435456,"timestamp":1651698332693,"scopedStorage":false,"displayHeightPixels":800,"displayWidthPixels":1280,"isMenuOpen":false,"topFragmentTag":"","isInDaydream":false,"isRooted":false,"isLicensed":true,"isInScreensaver":false,"kioskLocked":false,"isInForcedSleep":false,"maintenanceMode":false,"kioskMode":false,"startUrl":"http://homeassistant.removed.com:8123/kiosk-2/dash","currentTabIndex":0,"deviceID":"####removed####","appVersionCode":1057,"appVersionName":"1.47.2-play","androidSdk":29,"deviceModel":"Lenovo TB-X306F","deviceManufacturer":"LENOVO","foregroundApp":"de.ozerov.fully","currentPage":"http://homeassistant.removed.com:8123/kiosk-2/dash","lastAppStart":"4/4/22 6:26:18 PM","sensorInfo":[{"type":5,"name":"LIGHT","vendor":"ltr578_l","version":1,"accuracy":-1,"values":[34],"lastValuesTime":1651698132064,"lastAccuracyTime":-1},{"type":8,"name":"PROXIMITY","vendor":"ltr578_p","version":1,"accuracy":-1},{"type":29,"name":"STATIONARY_DETECT","vendor":"MTK","version":1,"accuracy":-1}]}

labzilla commented 2 years ago

This might be an issue with the version of FullyKiosk that downloads through HACS. I manually installed the plugin by uploading into the custom_components folder, and it is now working.