This is a driver code. So you'll need to manually install it, then create a virtual device using the code. In the preferences, add this URL, then save
https://www.banyule.vic.gov.au/ocapi/Public/myarea/wasteservices
A good bit of stuff is hard coded, so if it works, it will need some changes before it'll be ready for actual use. After setup, hit the button and you should get some log entries from the driver. Screenshot and post those here.
Code
/*
* Http GET Switch
*
* Calls URIs with HTTP GET for switch on or off
*
*/
metadata {
definition(name: "Http GET Switch", namespace: "community", author: "Community", importUrl: "https://raw.githubusercontent.com/hubitat/HubitatPublic/master/examples/drivers/httpGetSwitch.groovy") {
capability "Actuator"
attribute "response", "STRING"
command "runGet"
}
}
preferences {
section("URIs") {
input "onURI", "text", title: "On URI", required: false
input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
}
}
def logsOff() {
log.warn "debug logging disabled..."
device.updateSetting("logEnable", [value: "false", type: "bool"])
}
def updated() {
log.info "updated..."
log.warn "debug logging is: ${logEnable == true}"
if (logEnable) runIn(1800, logsOff)
}
def parse(String description) {
log.debug(description)
}
def runGet() {
def params = [uri: settings.onURI,
query: ["geolocationid": "1fb7fa97-33e2-48e4-aff2-d2cfd9ec30e6", "ocsvclang": "en-AU"],
headers: [
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9",
"Cache-Control": "max-age=0",
"Connection": "keep-alive",
"Host": "www.banyule.vic.gov.au",
"sec-ch-ua": """Chromium";v="112", "Google Chrome";v="112", "Not:A-Brand";v="99""",
"sec-ch-ua-mobile": "?1",
"sec-ch-ua-platform": """Android""",
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "none",
"Sec-Fetch-User": "?1",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Mobile Safari/537.36"]]
log.debug "Sending GET request to ${params}"
httpGet(params) { resp ->
log.debug resp
log.debug resp.data
//def json = resp.data.parseJson()
//def binDay = json.responseContent.findAll { it.contains("Bin day") }.collect { it.replace('\n', '').trim() }.join(", ")
//def fogo = json.responseContent.findAll { it.contains("FOGO") }.collect { it.replace('\n', '').trim() }.join(", ")
//def recycling = json.responseContent.findAll { it.contains("Recycling") }.collect { it.replace('\n', '').trim() }.join(", ")
//def rubbish = json.responseContent.findAll { it.contains("Rubbish") }.collect { it.replace('\n', '').trim() }.join(", ")
//def response = [binDay, fogo, recycling, rubbish].join("; ")
//log.debug "Response: ${response}"
//device.updateAttribute("response", response)
}
}