Is it possible to change URL for iframe from input select widget

Looking to have a the url of an iframe change depending on the selection on an input select widget, but unsure how to about it, or even if it is possible.

Can you assign variables or payloads to input selections? Can the url of an iframe be variable?

1 Like

Same question here. I’d like to have an iframe that shows where I parked.
I currently have the full URL in {{ input_txt.parked_location }}.

I have made a small custom widget that sets the url of an iframe to the state of an entity.
The widget definition looks like this:

frame:
  widget_type: myframe
  entity:  sensor.iframe_url
  frame_style: "background: transparent none;"

And the iframe updates its source whenever the state of the entity changes. If this is what you are looking for, I can upload the widget to github.

Sounds like just the ticket. Thank you!

Ok, the widget is here: https://github.com/tjntomas/HADashboard-widgets/tree/master/custom_widgets
You would need to copy the folder basemyframe and the file myframe.yaml to your custom_widgets folder. You don’t need any of the other files.

Your conf folder would then look like this:

conf
   custom_widgets
     basemyframe
       basemyframe.js
       basemyframe.html
       basemyframe.css
     myframe.yaml
1 Like

still don’t get it. If I got it right I need a template sensor named iframe_url which should hold the complete url. Fine so far. But then I’m stuck about how to get this into a lovelace web card.
Any idea?