ExecuteShellCommand Callback always nil (Solved)
Posted: Sunday 16 May 2021 17:14
if I enter the command:
pi@domoticz1:~ $ hcitool name <mac_address_of_my_phone>
it will give me the Bluetooth name of my phone (if within reach)
If I try in a script:
The callback is always nil and shellCommandResponses is never triggered.
the log:
dzVents Version: 3.1.8
What am I doing wrong here?
pi@domoticz1:~ $ hcitool name <mac_address_of_my_phone>
it will give me the Bluetooth name of my phone (if within reach)
If I try in a script:
Code: Select all
return {
on = {
timer = {
'every minute',
},
shellCommandResponses = {
scriptVar,
},
},
logging = {
level = domoticz.LOG_DEBUG,
marker = 'Ben ik thuis',
},
execute = function(domoticz, item)
domoticz.log('Timer event was triggered by ' .. item.trigger, domoticz.LOG_INFO)
if item.isTimer then
domoticz.log('Item is Timer')
domoticz.executeShellCommand(
{
command = 'hcitool name xx:xx:xx:xx:xx:xx',
callback = scriptVar,
timeout = 20,
})
elseif item.isShellCommandResponse then
domoticz.log('Response from shell command')
end
domoticz.utils.dumpTable(item)
end
}
the log:
- Spoiler: show
dzVents Version: 3.1.8
What am I doing wrong here?