Problems with pushover and rules
Hello,
i got a problem when i use the "rules" script designer with pushover. Everything is up-to date.
Adapter "javascript" : 5.7.0 , installed 5.7.0 Controller "js-controller": 4.0.23 , installed 4.0.23 Adapter "pushover" : 3.0.2 , installed 3.0.2
The script works if i use "e-mail" and send to the pushover account. But not if i use the "block/rule" pushover directly. It gives the following error:
| 19:37:20.830 | info | javascript.0 (1169) Stop script script.js.Kueche.Kueche_Kuehlschrank_Temperatur_rules_js_pushover |
|---|---|---|
| 19:37:20.858 | info | javascript.0 (1169) Start javascript script.js.Kueche.Kueche_Kuehlschrank_Temperatur_rules_js_pushover |
| 19:37:20.864 | error | javascript.0 (1169) script.js.Kueche.Kueche_Kuehlschrank_Temperatur_rules_js_pushover compile failed: at script.js.Kueche.Kueche_Kuehlschrank_Temperatur_rules_js_pushover:79 |
There is no line 79
--------script start --------- let cond0 = false;
on({id: "hmip.0.devices.3014xxxxxEDBE98B9781.channels.1.actualTemperature", change: "ne"}, async function (obj) { _sendToFrontEnd(16605xxx22111, {val: obj.state.val, ack: obj.state.ack, valOld: obj.oldState && obj.oldState.val, ackOld: obj.oldState && obj.oldState.ack}); const subCondVar1660583917424 = obj.state.val; const subCond1660583917424 = subCondVar1660583917424 >= 6; const _cond = (subCond1660583917424);
_sendToFrontEnd(16605xxx17424, {result: subCond1660583x3x7424, value: subCondVar16605xx17424, compareWith: 6});
if (cond0 === false && _cond) {
cond0 = true;
// Pushover Hello %s
const subActionVar16xxx84713423 = "Hello %s".replace(/%s/g, obj.state.val).replace(/%id/g, obj.id).replace(/%name/g, obj.common && obj.common.name).replace(/%old/g, obj.oldState.val);
_sendToFrontEnd(166058xxx3423, {text: subActionVar166xx84713423});`;
sendTo("pushover.0", "send", {
message: subActionVar166058x3x3x3423,
title: "ioBroker".replace(/%s/g, obj.state.val).replace(/%id/g, obj.id).replace(/%name/g, obj.common && obj.common.name).replace(/%old/g, obj.oldState.val),
sound: "magic",
priority: -1
});
} else if (cond0 === true && !_cond) {
cond0 = false;
}
}); /const demo = { "triggers": [ { "id": "TriggerState", "acceptedBy": "triggers", "_id": 1660583922111, "tagCard": "on change", "oid": "hmip.0.devices.3014F711A0000EDBE98B9781.channels.1.actualTemperature", "oidRole": "value.temperature", "oidType": "number", "oidUnit": "°C", "oidWrite": false, "oidRead": true } ], "conditions": [ [ { "id": "ConditionState", "acceptedBy": "conditions", "_id": 1660583917424, "tagCard": ">=", "oid": "", "value": "6", "useTrigger": true } ] ], "justCheck": false, "actions": { "then": [ { "id": "ActionPushover", "acceptedBy": "actions", "_id": 1660584713423, "instance": "pushover.0", "text": "Hello %s", "title": "ioBroker", "sound": "magic", "priority": -1 } ], "else": [] } };/
//{"triggers":[{"id":"TriggerState","acceptedBy":"triggers","_id":1660583922111,"tagCard":"on change","oid":"hmip.0.devices.3014F711A0000EDBE98B9781.channels.1.actualTemperature","oidRole":"value.temperature","oidType":"number","oidUnit":"°C","oidWrite":false,"oidRead":true}],"conditions":[[{"id":"ConditionState","acceptedBy":"conditions","_id":1660583917424,"tagCard":">=","oid":"","value":"6","useTrigger":true}]],"justCheck":false,"actions":{"then":[{"id":"ActionPushover","acceptedBy":"actions","_id":1660584713423,"instance":"pushover.0","text":"Hello %s","title":"ioBroker","sound":"magic","priority":-1}],"else":[]}} --------script end ---------
most likely the ` in line 7 is the reason 8and line 79 is because most likely you have global scripts that are prepended. I will have a look
Same problem here. `let cond0 = false;
on({id: "zigbee.0.00158d0008ab3a82.temperature", change: "ne"}, async function (obj) { _sendToFrontEnd(1665724678070, {val: obj.state.val, ack: obj.state.ack, valOld: obj.oldState && obj.oldState.val, ackOld: obj.oldState && obj.oldState.ack}); const subCondVar1665724734367 = obj.state.val; const subCond1665724734367 = subCondVar1665724734367 >= -18; const _cond = (subCond1665724734367);
_sendToFrontEnd(1665724734367, {result: subCond1665724734367, value: subCondVar1665724734367, compareWith: -18});
if (cond0 === false && _cond) {
cond0 = true;
// Pushover Hello
const subActionVar1665727500241 = "Hello".replace(/%s/g, obj.state.val).replace(/%id/g, obj.id).replace(/%name/g, obj.common && obj.common.name).replace(/%old/g, obj.oldState.val);
_sendToFrontEnd(1665727500241, {text: subActionVar1665727500241});`;
sendTo("pushover.0", "send", {
message: subActionVar1665727500241,
title: "ioBroker".replace(/%s/g, obj.state.val).replace(/%id/g, obj.id).replace(/%name/g, obj.common && obj.common.name).replace(/%old/g, obj.oldState.val),
sound: "magic",
priority: -1
});
} else if (cond0 === true && !_cond) {
cond0 = false;
}
}); /const demo = { "triggers": [ { "id": "TriggerState", "acceptedBy": "triggers", "_id": 1665724678070, "tagCard": "on change", "oid": "zigbee.0.00158d0008ab3a82.temperature", "oidRole": "value.temperature", "oidType": "number", "oidUnit": "°C", "oidWrite": false, "oidRead": true } ], "conditions": [ [ { "id": "ConditionState", "acceptedBy": "conditions", "_id": 1665724734367, "tagCard": ">=", "oid": "", "value": "-18", "useTrigger": true } ] ], "justCheck": false, "actions": { "then": [ { "id": "ActionPushover", "acceptedBy": "actions", "_id": 1665727500241, "instance": "pushover.0", "text": "Hello", "title": "ioBroker", "sound": "magic", "priority": -1 } ], "else": [] } };/
//{"triggers":[{"id":"TriggerState","acceptedBy":"triggers","_id":1665724678070,"tagCard":"on change","oid":"zigbee.0.00158d0008ab3a82.temperature","oidRole":"value.temperature","oidType":"number","oidUnit":"°C","oidWrite":false,"oidRead":true}],"conditions":[[{"id":"ConditionState","acceptedBy":"conditions","_id":1665724734367,"tagCard":">=","oid":"","value":"-18","useTrigger":true}]],"justCheck":false,"actions":{"then":[{"id":"ActionPushover","acceptedBy":"actions","_id":1665727500241,"instance":"pushover.0","text":"Hello","title":"ioBroker","sound":"magic","priority":-1}],"else":[]}}`
Nothing happening? :(
You have no idea how many things are indeed happening ... maybe not on this particluar issue, yes.
You have no idea how many things are indeed happening ... maybe not on this particluar issue, yes.
Sorry, did not mean to sound rude. You just see two open issues. ;)
I also not meaned this particular adapter but many more ... But it's known and will come as soon as someone finds time, sorry
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions. Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.
Nothing changed. Bug still there,
`
let cond0 = false;
schedule("0 * * * *", async function (obj) { _sendToFrontEnd(1683917106323, {trigger: true});
const _cond = true;
if (_cond) {
// Pushover Hello
const subActionVar1683917100707 = "Hello";
_sendToFrontEnd(1683917100707, {text: subActionVar1683917100707});`;
sendTo("pushover.0", "send", {
message: subActionVar1683917100707,
title: "ioBroker",
sound: "magic",
priority: -1
});
} else {
}
}); /*const demo = { "triggers": [ { "id": "TriggerScheduleBlock", "acceptedBy": "triggers", "_id": 1683917106323, "tagCard": "cron", "cron": "0 * * * " } ], "conditions": [ [] ], "justCheck": false, "actions": { "then": [ { "id": "ActionPushover", "acceptedBy": "actions", "_id": 1683917100707, "instance": "pushover.0", "text": "Hello", "title": "ioBroker", "sound": "magic", "priority": -1 } ], "else": [] } };/
//{"triggers":[{"id":"TriggerScheduleBlock","acceptedBy":"triggers","_id":1683917106323,"tagCard":"cron","cron":"0 * * * *"}],"conditions":[[]],"justCheck":false,"actions":{"then":[{"id":"ActionPushover","acceptedBy":"actions","_id":1683917100707,"instance":"pushover.0","text":"Hello","title":"ioBroker","sound":"magic","priority":-1}],"else":[]}} `
| 20:45:12.976 | info | javascript.0 (1619) Stop script script.js.Kueche.Skript_1 |
|---|---|---|
| 20:45:16.175 | info | javascript.0 (1619) Start javascript script.js.Kueche.Skript_1 |
| 20:45:16.199 | error | javascript.0 (1619) script.js.Kueche.Skript_1 compile failed: at script.js.Kueche.Skript_1:61 |
Yes, also in pushover v. 3.0.3 the bug is still there. Is a solution in sight ?
It was fixed in [email protected]