dmulcahey / zha-network-visualization-card

Lovelace custom element for visualizing the ZHA Zigbee network
36 stars 20 forks source link

cannot make this work #9

Open libussa opened 4 years ago

libussa commented 4 years ago

hey, sorry if this seems basic, but I'm just starting with HS... Running Docker, the js file is in /config/www On top of the lovelace config I added:

resources:
  - url: /local/zha-network-visualization-card.js
    type: js

I then created a new view, with a card defined like this:

type: 'custom:zha-network-visualization-card'

The card says

Custom element doesn't exist: zha-network-visualization-card.
type: 'custom:zha-network-visualization-card'

And in the logs I have

2019-12-10 01:07:55 ERROR (MainThread) [frontend.js.latest.201911196] http://192.168.1.3:8123/local/zha-network-visualization-card.js:1:1 Uncaught SyntaxError: Cannot use import statement outside a module
2019-12-10 01:15:48 ERROR (MainThread) [frontend.js.latest.201911196] http://192.168.1.3:8123/local/zha-network-visualization-card.js:1:0 SyntaxError: import declarations may only appear at top level of a module

Thanks for the help!

dmulcahey commented 4 years ago

Type is module not js In your resources declaration

libussa commented 4 years ago

Thanks for the prompt response @dmulcahey ! I now get a white rectangle, progress!

I loaded https://github.com/zha-ng/zha-map and it looks like it get loaded at startup

2019-12-10 02:10:44 INFO (SyncWorker_4) [homeassistant.loader] Loaded zha_map from custom_components.zha_map

However, in logs I now get:

2019-12-10 02:11:16 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140055236978128] Received invalid command: zha_map/devices
dmulcahey commented 4 years ago

That’s odd. You’re sure you have the newest version and that there are no errors in the logs?

libussa commented 4 years ago

This is the log from startup https://gist.githubusercontent.com/libussa/23fad788e0567d08b87fb75d21620efc/raw/604e6c0ae1d1f24ee51e4730cefc3b2f54fada8e/ha.log

both zha_map and this are from fresh clones of the master branch

meremortals70 commented 4 years ago

I cannot make this work with the new integrations setup in HA.

Added through HACS.

Shows as added in Configuration>>Lovelace Dashboards>>Resources

/hacsfiles/zha-network-card/zha-network-card.js JavaScript Module

However cannot add a card

Any thoughts please?