Ok, so I now have my system up and running and all is smooth and working, so the next step…customizing What I am trying to do is add a custom card to my UI. I downloaded the “power-distribution-card” and got it working. For this I used to the UI to add a resource to Lovelace:
url: /local/power-distribution-card.js
type: module
And then added a manual card to the UI with following code to get it to display:
type: 'custom:power-distribution-card'
entities:
- solar:
entity: sensor.solar_pv_power
- grid:
entity: sensor.solar_grid_power
invert_value: true
- home:
entity: sensor.solar_power_consumption
invert_value: true
- battery: sensor.solar_storage_power
center:
type: glance
entities:
- sun.sun
So far so good…it works and shows up the way I want, HOWEVER…
It only works when I use my external url to access my server. When I use my internal url, or also when I use my iOS app, it doesn’t work. It tells me “custom element doesn’t exist”.
I have similar problems when trying to use the file editor or terminal addons. They both give me a 401: Unauthorized error.
My guess is that it has to do with the setup of encryption and NGINX. That basically all works, I can connect securely, got my 443 port fowarded to 443 and encrypted connection works. Below are my relevant configs:
configuration.yaml:
homeassistant:
external_url: https://xxx.duckdns.org
internal_url: http://192.168.76.9:8123
NGINX config:
domain: xxxx.duckdns.org
certfile: fullchain.pem
keyfile: privkey.pem
hsts: max-age=31536000; includeSubDomains
cloudflare: false
customize:
active: false
default: nginx_proxy_default*.conf
servers: nginx_proxy/*.conf
DuckDNS Config:
lets_encrypt:
accept_terms: true
certfile: fullchain.pem
keyfile: privkey.pem
token: xxxxx
domains:
- xxxx.duckdns.org
aliases: []
seconds: 300
I have read some posts about having to set up proxies to internal dockers…but…that is where I am not comfortable with yet, so anyone who could point me in the right direction to solve this?
Thanks in advance