Displaying a Web Page

Well thanks to a reply posted to a related question in another part of the forum, I've now been able to achieve what I want. I'll share the solution in case it's a help to others.

The answer is a simple driver (below), and then to create a virtual switch, assign that driver to it, and use an "attribute" tile to display the web frame.

Here's the driver as I have it - your frame call goes in the "sendEvent" line where marked.

preferences {
}
metadata {
definition (name: "weatherFrame", namespace: "srp", author: "srp") {
capability "Switch"
attribute "myFrame", "text"
}
}
def on() {
sendEvent(name: "switch", value: "on")
sendEvent(name: "myFrame", value: "your iframe" )
}
def off() {
sendEvent(name: "switch", value: "off")
}
def installed() {
on()
}

2 Likes