Home Assistant Custom Card#

mkdir -p /opt/homeassistant/config/www/
vi /opt/homeassistant/config/www/content-card-example.js

https://developers.home-assistant.io/docs/frontend/custom-ui/registering-resources/

  • Settings > Dashboards > three dots > Resources

  • /local/content-card-example.js

  • type: js mod

Navigate to Dashboard > three dots > Raw configuration editor:

views:
  - title: my dashboard
    cards:
      - type: custom:content-card-example

Refresh#

Go to https://ha.dortn.de/local/content-card-example.js directly and hit refresh - twice in my case - until you see the updated code.

Background: I did not implement setConfig, because my card should be static. Then I got the error i.setConfig is not a function. After adding the setConfig function, the error persisted.