php help very simple for expert

Hi,

Sure thing – see FUNCTION HERE and PHP code below.

What I want to do is:

  1. When button is clicked, it also automatically closes the extra window opened on click and reloads page (to update status color etc. of button)

    Website BUTTON7/BUTTON ie. SETUP and YON/YOFF looks like this[see attached image]:

  2. //Function returns true value if device is ON

function getShellyStatus($url,$falseReturn,$trueReturn) {

$deviceJsonstatus = file_get_contents($url);

if( strpos($deviceJsonstatus,””ison””:true””) )