Lua scripting kaku

Moderator: leecollings

Post Reply
riegman
Posts: 3
Joined: Thursday 21 January 2016 21:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Lua scripting kaku

Post by riegman »

Hi,

I try to call a script for my kaku devices.

The log is written but the script won't run.

Can someone help me with this newbie question?

Thanks in advance.

Greetings,
Robin

Code: Select all

-- script name : script_device_kaku.lua

local sensor = 'Lamp1'

commandArray = {}

if (devicechanged[sensor] == 'On') then
os.execute ("sudo ~/wiringPi/examples/lights/kaku A 1 on")
print ('Aan!!!')
else
os.execute ("sudo ~/wiringPi/examples/lights/kaku A 1 off")
print ('Uit!!!!!!!')
end

return commandArray
SweetPants

Re: Lua scripting kaku

Post by SweetPants »

I think your problem is the 'sudo'. It needs a password i think
riegman
Posts: 3
Joined: Thursday 21 January 2016 21:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Lua scripting kaku

Post by riegman »

Isn't that only needed when I use su?
jannl
Posts: 673
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: Lua scripting kaku

Post by jannl »

That depends on the sudo settings. When you issue the command commandline, does it work?
riegman
Posts: 3
Joined: Thursday 21 January 2016 21:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Lua scripting kaku

Post by riegman »

When I run it on command line it works and no password is asked.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest