I have a "Broadlink RM3 mini" which controls my mini receiver. In Domoticz I have created buttons for things such as turn on/off, volume up/down, set input to MD, CD, Aux and so on. These button work by triggering a DZVents script. Everything works fine as long as I push the buttons inside domoticz. However if I push the same buttons in dashticz they do now work.
The script I is stored in a folder on the pi in /home/pi/scripts/anlaeg.sh:
Code: Select all
#!/bin/bash
/usr/bin/python /home/pi/BlackBeanControl/BlackBeanControl.py -c $1 &
Code: Select all
return {
on = {
devices = {
'Anlæg*'
}
},
execute = function(domoticz, device)
domoticz.log('Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
if device.state == 'On' then
if (string.find(device.name,'on')) then
os.execute('/usr/bin/python /home/pi/BlackBeanControl/BlackBeanControl.py onoff')
print('Switched Anlæg on or off')
elseif (string.find(device.name,'CD')) then
os.execute('/home/pi/scripts/anlaeg.sh cd')
print('Switched Anlæg to CD')
elseif (string.find(device.name,'LP')) then
os.execute('/home/pi/scripts/anlaeg.sh aux')
print('Switched Anlæg to LP')
elseif (string.find(device.name,'Stream')) then
os.execute('/home/pi/scripts/anlaeg.sh md')
print('Switched Anlæg to Stream/radio')
elseif (string.find(device.name,'op')) then
os.execute('/home/pi/scripts/anlaeg.sh volup2')
print('Anlæg volume op')
elseif (string.find(device.name,'ned')) then
os.execute('/home/pi/scripts/anlaeg.sh voldown2')
print('Anlæg volume down')
end
end
end
}
Any tips would be appreciated