@bean
Wenn du es direkt wieder ohne Buttons haben möchtest kannst du den Teil suchen (relativ weit oben):
on({id: [].concat(config.mrIcon1ScreensaverEntity.ScreensaverEntity).concat(config.mrIcon2ScreensaverEntity.ScreensaverEntity), change: "ne"}, async function (obj) {
if (obj.id.substring(0,4) == 'mqtt') {
let Button = obj.id.split('.');
if (getState(NSPanel_Path + 'Relay.' + Button[Button.length - 1].substring(5,6)).val != obj.state.val) {
await setStateAsync(NSPanel_Path + 'Relay.' + Button[Button.length - 1].substring(5,6), obj.state.val == 'ON' ? true : false);
}
}
});
und gegen den Teil ersetzen:
async function SubscribeMRIcons () {
if (config.mrIcon1ScreensaverEntity.ScreensaverEntity != null) {
on({id: config.mrIcon1ScreensaverEntity.ScreensaverEntity, change: "ne"}, async function (obj) {
if (obj.id.substring(0,4) == 'mqtt') {
let Button = obj.id.split('.');
if (getState(NSPanel_Path + 'Relay.' + Button[Button.length - 1].substring(5,6)).val != obj.state.val) {
await setStateAsync(NSPanel_Path + 'Relay.' + Button[Button.length - 1].substring(5,6), obj.state.val == 'ON' ? true : false);
}
}
});
}
if (config.mrIcon2ScreensaverEntity.ScreensaverEntity != null) {
on({id: config.mrIcon2ScreensaverEntity.ScreensaverEntity, change: "ne"}, async function (obj) {
if (obj.id.substring(0,4) == 'mqtt') {
let Button = obj.id.split('.');
if (getState(NSPanel_Path + 'Relay.' + Button[Button.length - 1].substring(5,6)).val != obj.state.val) {
await setStateAsync(NSPanel_Path + 'Relay.' + Button[Button.length - 1].substring(5,6), obj.state.val == 'ON' ? true : false);
}
}
});
}
}
SubscribeMRIcons();
dann sollte auch "null" wieder möglich sein.
LG