Core: Tile Platform not functional, TypeError: Object of type UUID is not JSON serializable

Created on 5 Nov 2019  路  4Comments  路  Source: home-assistant/core

Home Assistant release with the issue:

0.101.2

Last working Home Assistant release (if known):
Tested on 0.101.0 and 0.101.2, neither worked.

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

Hass.io on RPI 3B+

Integration:

https://www.home-assistant.io/integrations/tile/

Description of problem:

Bought a Tile Mate 2020, everything works perfectly in the Tile Android app, but integrating with Home Assistant results in an exception: Failed to serialize to JSON: /config/.myusername_gmail_com.tile.conf. Yet, the file /config/.myusername_gmail_com.tile.conf does not even exist when I check with ls -la.

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

device_tracker:
  - platform: nmap_tracker
    hosts: 192.xxx.xxx.xxx
  - platform: bluetooth_tracker
  - platform: tile
    username: [email protected]
    password: mypassword

Traceback (if applicable):

Failed to serialize to JSON: /config/.myusername_gmail_com.tile.conf
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 58, in save_json
    json_data = json.dumps(data, sort_keys=True, indent=4, cls=encoder)
  File "/usr/local/lib/python3.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "/usr/local/lib/python3.7/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/usr/local/lib/python3.7/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/local/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/local/lib/python3.7/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/usr/local/lib/python3.7/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type UUID is not JSON serializable

I believe this one is relevant too:

Error setting up platform legacy
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 58, in save_json
    json_data = json.dumps(data, sort_keys=True, indent=4, cls=encoder)
  File "/usr/local/lib/python3.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "/usr/local/lib/python3.7/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/usr/local/lib/python3.7/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/local/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/local/lib/python3.7/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/usr/local/lib/python3.7/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type UUID is not JSON serializable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py", line 69, in async_setup_legacy
    hass, self.config, tracker.async_see, discovery_info
  File "/usr/src/homeassistant/homeassistant/components/tile/device_tracker.py", line 67, in async_setup_scanner
    await hass.async_add_job(save_json, config_file, config_data)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 70, in save_json
    raise SerializationError(error)
homeassistant.util.json.SerializationError: Object of type UUID is not JSON serializable

Additional information:
None

tile

Most helpful comment

28570 wasn't included in 0.101.3 (take a look at the release notes) 鈥撀爄t should go out in 0.102.0.

All 4 comments

Hey there @bachya, mind taking a look at this issue as its been labeled with a integration (tile) you are listed as a codeowner for? Thanks!

Thanks for the heads up! A fix will be submitted shortly.

With 0.101.3 the problem still exists

Sat Nov 09 2019 19:47:11 GMT+0100 (Mitteleurop盲ische Normalzeit)
Failed to serialize to JSON: /config/.TILE_USERNAME.tile.conf
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 58, in save_json
    json_data = json.dumps(data, sort_keys=True, indent=4, cls=encoder)
  File "/usr/local/lib/python3.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "/usr/local/lib/python3.7/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/usr/local/lib/python3.7/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/local/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/local/lib/python3.7/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/usr/local/lib/python3.7/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type UUID is not JSON serializable

is there any additional need to change or update?

For my opinion the name of the file is in the wrong format for standardization of this files it shut be .integrationname.username.conf

28570 wasn't included in 0.101.3 (take a look at the release notes) 鈥撀爄t should go out in 0.102.0.

Was this page helpful?
0 / 5 - 0 ratings