Hello again,
I want to see in the GIU, if anyone phoned. So I have a bash that returns 0 if nobody phoned or anything greater 0 if the phone is used.
I try this:
{
"id": "phone-signal",
"class": "DummyPresenceSensor",
"name": "Telefonie aktiv",
"autoReset": false
},
{
"id": "phone-detect",
"name": "Telefonie",
"class": "ShellSensor",
"attributeName": "phonedetect",
"attributeType": "number",
"attributeUnit": "",
"command": "bash /usr/local/pimatic-app/phonedetect.sh",
"interval": 60000
}
to switch the DummyPresenceSensor I use these two rules
{
"id": "telefonieanzeige-ein",
"name": "Telefonieanzeige ein",
"rule": "if $phone-detect.phonedetect > 0 then set presence of phone-signal present",
"active": true,
"logging": true
},
{
"id": "telefonieanzeige-aus",
"name": "Telefonieanzeige aus",
"rule": "if $phone-detect.phonedetect = 0 then set presence of phone-signal absent",
"active": true,
"logging": true
}
but the value of $phone-detect.phonedetect was null and in the logfile is this result:
Unhandled rejection Error: Command failed:
at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Process.ChildProcess._handle.onexit (child_process.js:802:5)
What is wrong?