Track if HA is accessed from http or https

Hello,

I have on my dashboard a few iframe cards that as we know, they might or might not display the content of the pages depending if the dashboard is accessed via http or https.

In such case we get this error:
image

Is there any sensor (or template) to be used as a condition that tracks if HA is accessed via http or https (duckdns with nginx).

Thank you very much
Kind Regards