I know I can use templates but Iâm trying to see if I can manage to have things working without having to create custom entities to reach a goal, so that others whom read my config donât go âtoo crazyâ (GitHub - SeLLeRoNe/HA-Config: Home Assistant Configuration If interested)
Well that was where this all started and a requirement for what I was looking for.
Browser-mod?? Yet another custom-card⌠pass⌠that was the main reason I didnât want to use the decluttering card!! I already had to retire a card I was using due to a card becoming unsupported so I am sensitive to adding more! But Romrider is very active and I do use other cards of his so low risk. Same with Thomas.
Well I could but for no real benefit really. I could also rename the firmware and status sensor from coffee_maker to sonoff1_2914 but the benefit would outweigh the gain/painâŚ
Well appreciated anyway⌠You guys are both outstanding.
Same⌠I do try to avoid creating more sensors which is one of the benefits of this template card⌠attributes become more accessible without having to create sensors from them.
No no no, I just wanted to tell that I tried to simulate with no understanding about physical meaning.
May I ask you - which entities are finally required?
Is there a way to access the url from the card? I am trying to pass in url parameters to set the entity for a scheduler card. For example, to display a scheduler card for the living room thermostat, I would use url https://my-hass-domain/schedule-entity?e=climate.living_room.
It seems like I cannot access window.location.href from the config-template-card. But maybe I am missing something.
Also it seems like it would be very useful if passing url defined variables into config-template-card could be included as a feature/turned on in config. I am interested in working on this myself if I can, but I thought Iâd share the idea in case anymore more talented liked the idea and could easily implement it.
On the mobile app, it works perfectly at the beginning, showing the Grafana dashboard, and switching the theme when the sunâs state is changed. But it wasnât working on the web browser.
So I tried to refresh the cache of the browser, but it didnât make it work. So I tried to edit the code again, and I saw that the code was reformatted that way :
I tried to reformat like original, but it didnât help. On the mobile app it was still working, but then I disabled my WiFi to connect through 4G network and web access through Nabu Casa, and then it started failing, and I could not get it to work again even on WiFi. I always get the same message
I tried with the stock iframe card, and it works when connected to my local network, not from web access. Thatâs expected, the URL is parsed from browser side, so if the phone/PC/tablet or whatever is not connected to the same private network than the Grafana server, it wonât work.
However, I canât figure why the original code first worked on the mobile app while on LAN, but not on the Chrome browser on the same phone or on the PC connected to the same network.
When using stock iframe card, it works on all machines in the LAN.
No ; please, forget the local/web access issue, this is understood, Iâll need to add SSL/TLS and forward my Grafana server port on my router for a DynDNS access to be able to use a https://something.dyndns_provider.com:XXXX/⌠url externally.
And why it started to fail ONLY when I tried to access this page from the browser on my PC using only LAN access ?
It had direct access to the 192.168.1.29 address from my Raspberry Pi 4 with Raspbian Buster, that runs Home Assistant Container in Docker, with also all my other Docker containers (zwave-js2mqtt, MQTT, HASS Configurator, influxDB, Chronograf, Telegraf, Grafana and Portainer). This PC is able to open Grafana dashboard live from the server, so it should not be an URL access issue.
This is correct, it is always reformatted in my setup.
Check this custom card without config-template-card. Probably some issues with that custom card. Do not use it myself, cannot reproduce.
Are you sure you should use this hui-iframe-card??? Cannot even find it.
Check these urls without config-template-card.
Also google about X-Frame header
I tried replacing the hui-iframe-card with a standard iframe card but still inside the custom config card, and it worked too. I thought the standard iframe wouldnât work with the custom config and URL template.
Now it works perfectly.
I could confirm that when using my first code with hui-iframe-card in lovelace in my browser, it works till I refresh the browserâs cache ; then it fails saying the hui-iframe-card doesnât exist.
I have an automation which updates the value of input_text:last_added_file with the local path of a surveillance station recording. That automation works fine, as far as I can see, because in the developer templating tab, I can check the value of {{states.input_text.last_added_file.state}} and it correctly resolves to /media/recording/Front Porch/20210525PM/Front Porch-20210525-145001-1621975801.mp4
What Iâd like to do is have that automation feed a card in my frontend, so I can always access and play the most recent motion-detection recording, and it seems like this should work:
You are trying to use a format which may be used for the âconfiguration.yamlâ file, for the âTemplatesâ window - but this will not work in "config-template-card".
Check the docs, especially code examples - you should use smth like this:
states['input_text.last_added_file'].state
BTW, even in the âconfiguration.yamlâ file etc you should not use that "states.input_text.last_added_file.state":