Rectangle { id: mainLights1 width: 80 height: 80 radius: 40 color: "transparent" border.color: "yellow" border.width: mini1.pressed ? 4 : 2 MouseArea { id: mini1 anchors.fill: parent onClicked: { var xhttp = new XMLHttpRequest() xhttp.onreadystatechange = function() { if (xhttp.readyState === 4 && xhttp.status === 200) { led.opacity = 1.0 timer.start() vibrate.start() mainLights1.radius = 40 mainLights1.border.color = "green" <-- ON, color is green console.log("Main light1" + " " + xhttp.responseText) } else mainLights1.radius = 20 } xhttp.open("POST", "http://192.168.0.230/cm?cmnd=cmnd/mini1/power toggle") xhttp.send() } } Label { text: "<b>PATIO</b>" ; anchors.centerIn: parent; color: "white"; font.pixelSize: Theme.fontSizeTiny } }