Hi,
I’m trying to modify an existing custom panel so that when a certain part of the script within the page is called, an additional service call is made. I have tried to make the edit myself, but it doesn’t work - so I’m guessing that I’m missing something.
checkOpenSensors(call){
this.hass.callService('script', 'check_open_doors_and_windows', call);
if (this.opencount == 0) return false; //check to see how many open sensors there are, if none arm alarm
for (var sensor in this.allsensors){ //check to see if the open sensor is one to ignore, if so arm alarm
//is it open?
if (['on', 'open', 'true', 'detected', 'unlocked'].indexOf(this.allsensors[sensor].state.toLowerCase()) > -1){ //yes
//is it in the override list?
if (this.ovverideSensors == null || this.overrideSensors.indexOf(this.allsensors[sensor]) == -1){ //No: return so display message
this.attemptedArm = true; //display the warning message and shake
var pageContent = this.$.content;
pageContent.classList.add('shake');
return true;
}
}
}
}
The bit I’ve added in is:
this.hass.callService('script', 'check_open_doors_and_windows', call);
Any help appreciated!