dale3h / python-lovelace

Lovelace UI module and migration tool for Python
MIT License
30 stars 6 forks source link

Empty ui-lovelace.yaml #9

Closed brianhanifin closed 5 years ago

brianhanifin commented 5 years ago

With the switch over to Lovelace coming up it is time for me to make the move. I am running Home Assistant in Docker. I ran python3 lovelace_migrate.py -p https://[EXTERNAL_URL]/api --debug where [EXTERNAL_URL] is my domain. I have also tried using my local IP e.g. python3 lovelace_migrate.py -p http://10.0.0.56:8123/api

Here is the resulting ui-lovelace.yaml in its entirety. :(

# This file was automatically generated by lovelace_migrate.py
# https://github.com/dale3h/python-lovelace

title: Home

Here is the output of the --debug command.

DEBUG:__main__:Reading input from URL: https://[EXTERNAL_URL]/api
Enter password:
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): [EXTERNAL_URL]
DEBUG:urllib3.connectionpool:https://[EXTERNAL_URL]:443 "GET /api/states HTTP/1.1" 200 4
INFO:__main__:Lovelace UI successfully written to: ui-lovelace.yaml

When I try to visit http://10.0.0.56:8123/api in my browser I get a 404 error. So, I'm not sure what my configuration issue is. But here is my Home Assistant Config.

petrfaitl commented 5 years ago

Same issue here. Solution is to curl the /api/states locally and then run the script against the file.

curl https://myhass.duckdns.org:8123/api/states -o "lovelace.txt"
python3 lovelace_migrate.py lovelace.txt

Works perfectly.

brianhanifin commented 5 years ago

Just an update. I moved forward creating a lovelace UI from scratch.