Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Create Blueprints #822

Open
tropicthedev opened this issue Jul 8, 2024 · 16 comments
Open

Unable to Create Blueprints #822

tropicthedev opened this issue Jul 8, 2024 · 16 comments

Comments

@tropicthedev
Copy link

Hi, I just installed the dashboard and I am loving it but there is an issue when trying to use blueprints. When I paste the yaml config and press the installation button nothing happens and there is actually an error that occurs in the home assistant logs

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/config/custom_components/dwains_dashboard/init.py", line 252, in ws_handle_install_blueprint
filecontent = yaml.safe_load(json.loads(msg["yamlCode"]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/yaml/init.py", line 125, in safe_load
return load(stream, SafeLoader)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/yaml/init.py", line 79, in load
loader = Loader(stream)
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/yaml/loader.py", line 34, in init
Reader.init(self, stream)
File "/usr/local/lib/python3.12/site-packages/yaml/reader.py", line 85, in init
self.determine_encoding()
File "/usr/local/lib/python3.12/site-packages/yaml/reader.py", line 124, in determine_encoding
self.update_raw()
File "/usr/local/lib/python3.12/site-packages/yaml/reader.py", line 178, in update_raw
data = self.stream.read(size)
^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'read'

Love the dashboard otherwise and keep up the good work

@roroid
Copy link

roroid commented Jul 12, 2024

same here

@mokerhamer
Copy link

mokerhamer commented Jul 22, 2024

Same here, first time user using latest version 3.7.1.

image
image

@mokerhamer
Copy link

mokerhamer commented Jul 23, 2024

Got it working:

Changed in custom_components/dwains_dashboard/init.py Line 251 and 252

From:
#filecontent = json.loads(msg["yamlCode"])
filecontent = yaml.safe_load(json.loads(msg["yamlCode"]))

To:
filecontents = json.loads(msg["yamlCode"])
filecontent = yaml.safe_load(json.dumps(filecontents))

@Bosty01
Copy link

Bosty01 commented Jul 26, 2024

Got it working:

Changed in custom_components/dwains_dashboard/init.py Line 251 and 252

From: #filecontent = json.loads(msg["yamlCode"]) filecontent = yaml.safe_load(json.loads(msg["yamlCode"]))

To: filecontents = json.loads(msg["yamlCode"]) filecontent = yaml.safe_load(json.dumps(filecontents))

No joy for me. Still not installing.

@mokerhamer
Copy link

Got it working:
Changed in custom_components/dwains_dashboard/init.py Line 251 and 252
From: #filecontent = json.loads(msg["yamlCode"]) filecontent = yaml.safe_load(json.loads(msg["yamlCode"]))
To: filecontents = json.loads(msg["yamlCode"]) filecontent = yaml.safe_load(json.dumps(filecontents))

No joy for me. Still not installing.

dit you restart home assistant?
image

@Bosty01
Copy link

Bosty01 commented Jul 26, 2024

Got it working:
Changed in custom_components/dwains_dashboard/init.py Line 251 and 252
From: #filecontent = json.loads(msg["yamlCode"]) filecontent = yaml.safe_load(json.loads(msg["yamlCode"]))
To: filecontents = json.loads(msg["yamlCode"]) filecontent = yaml.safe_load(json.dumps(filecontents))

No joy for me. Still not installing.

dit you restart home assistant? !

That was it. 99% of my issues would go away if I remembered to restart after making changes. Thanks for finding this.

@mokerhamer
Copy link

Got it working:
Changed in custom_components/dwains_dashboard/init.py Line 251 and 252
From: #filecontent = json.loads(msg["yamlCode"]) filecontent = yaml.safe_load(json.loads(msg["yamlCode"]))
To: filecontents = json.loads(msg["yamlCode"]) filecontent = yaml.safe_load(json.dumps(filecontents))

No joy for me. Still not installing.

dit you restart home assistant? !

That was it. 99% of my issues would go away if I remembered to restart after making changes. Thanks for finding this.

cheers buddy, glad to help

@mokerhamer
Copy link

same here

check solution few posts up.

@Stephonomon
Copy link

Works.

@owens-ben
Copy link

BOOM

Got it working:

Changed in custom_components/dwains_dashboard/init.py Line 251 and 252

From: #filecontent = json.loads(msg["yamlCode"]) filecontent = yaml.safe_load(json.loads(msg["yamlCode"]))

To: filecontents = json.loads(msg["yamlCode"]) filecontent = yaml.safe_load(json.dumps(filecontents))

This works! Gotta restart HA too.

@spike631
Copy link

spike631 commented Nov 2, 2024

nogo on HA v 2024.10.4, restarted HA, cleared cache. Any other suggestions?

@ben19840425
Copy link

ben19840425 commented Nov 5, 2024

same here. blueprint can be installed. new page is not working. always pointing to the home page.

@somehuman60
Copy link

somehuman60 commented Nov 11, 2024

nogo on HA v 2024.10.4, restarted HA, cleared cache. Any other suggestions?

same here. update: used fix here:

(#833)

now can install blueprint, but click on it lead to the homepage

@jorenchr
Copy link

jorenchr commented Dec 2, 2024

nogo on HA v 2024.10.4, restarted HA, cleared cache. Any other suggestions?

same here. update: used fix here:

(#833)

now can install blueprint, but click on it lead to the homepage

Idem. Blueprint installations work but always going to homepage when blueprint page is created.
Any solutions by now?

@dwainscheeren
Copy link
Owner

Reboot HA after creating the more page.

@wtf97996
Copy link

wtf97996 commented Dec 7, 2024

Got it working:

Changed in custom_components/dwains_dashboard/init.py Line 251 and 252

From: #filecontent = json.loads(msg["yamlCode"]) filecontent = yaml.safe_load(json.loads(msg["yamlCode"]))

To: filecontents = json.loads(msg["yamlCode"]) filecontent = yaml.safe_load(json.dumps(filecontents))

Great Job!

thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests