robmarkcole / HASS-data-detective

Explore and analyse your Home Assistant data
https://data.home-assistant.io/
MIT License
184 stars 36 forks source link

Error using Windows: expected str, bytes or os.PathLike object, not HassDatabase #156

Open ZZDDD opened 1 year ago

ZZDDD commented 1 year ago

When using windows, the following line of code: db_url = detective.db_from_hass_config('//10.20.10.106/config/') throws the error message:

The output is:

YAML tag !include_dir_merge_named is not supported Successfully connected to database sqlite://///10.20.10.106/config/home-assistant_v2.db There are 100 entities with data

The error is:

File c:\Users\ZZDDD\anaconda3\envs\ha2\lib\site-packages\detective\core.py:18, in db_from_hass_config(path, kwargs) 15 if path is None: 16 path = config.find_hass_config() ---> 18 url = config.db_url_from_hass_config(path) 19 return HassDatabase(url, kwargs)

File c:\Users\ZZDDD\anaconda3\envs\ha2\lib\site-packages\detective\config.py:139, in db_url_from_hass_config(path) 137 """Find the recorder database url from a HASS config dir.""" 138 global _CONFIGURATION_PATH --> 139 _CONFIGURATION_PATH = Path(path).resolve() 140 config = load_hass_config(path) 141 default_path = os.path.join(path, "home-assistant_v2.db")

File c:\Users\ZZDDD\anaconda3\envs\ha2\lib\pathlib.py:960, in Path.new(cls, *args, **kwargs) 958 if cls is Path: 959 cls = WindowsPath if os.name == 'nt' else PosixPath --> 960 self = cls._from_parts(args) ... 579 if isinstance(a, str): 580 # Force-cast str subclasses to str (issue #21127) 581 parts.append(str(a))

TypeError: expected str, bytes or os.PathLike object, not HassDatabase

robmarkcole commented 1 year ago

//10.20.10.106/config/ does not look correct