Can a generated dzVents script be executed in a scene?

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
rizzah
Posts: 75
Joined: Monday 17 October 2016 16:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Groningen
Contact:

Can a generated dzVents script be executed in a scene?

Post by rizzah »

HI,

I made a small dzVents script in an attempt to control my Hue light through a bash script and my Onkyo receiver through the Onkyo device which is added to Domoticz through the hardware/devices.

So i tried this:

Code: Select all

return {
    active = true,  
    on = {
    },

    execute = function(domoticz)

            if (domoticz.scenes('Film kijken').state == 'On') then
                os.execute('/home/pi/domoticz/scripts/hue-scripts/film-kijken.sh')
                domoticz.devices('Onkyo - Main Power').switchOn()
                domoticz.devices('Onkyo - Main Source').updateCustomSensor(NVIDIA)
                domoticz.devices('Onkyo - Main Volumer').updateCustomSensor(50)
                domoticz.log('----------------------------------------------')
                domoticz.log('-----------------IT RUNS RUNS ----------------')
                domoticz.log('----------------------------------------------')
            end
        end
}
When i enable the scene i see this in the logging:
2017-11-27 11:41:03.363 User: admin initiated a scene/group command
2017-11-27 11:41:03.365 Activating Scene/Group: [Film kijken]
2017-11-27 11:41:03.584 Executing script: /home/pi/domoticz/scripts/dzVents/generated_scripts/Film_Kijken.lua
2017-11-27 11:41:03.592 Error: Error executing script command (/home/pi/domoticz/scripts/dzVents/generated_scripts/Film_Kijken.lua). returned: 32256

Maybe im doing this all wrong, so any help or suggestions are welcome :-)

regards,
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Can a generated dzVents script be executed in a scene?

Post by dannybloe »

It should have triggers defined in the on-section. Your on-section is empty. Guess that's the problem.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
rizzah
Posts: 75
Joined: Monday 17 October 2016 16:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Groningen
Contact:

Re: Can a generated dzVents script be executed in a scene?

Post by rizzah »

Alright, i did that, but the error remains. I have made a simplified script (for some reason it does execute certain things) so i thought i would bring it down to the bare minimal.

Code: Select all

return {
    active = true,  
    on = {
        scenes = {
            'Xbox spelen'
        }
    },
    execute = function(domoticz, scene)

            if (domoticz.scenes('Xbox spelen').state == 'On') then
                    domoticz.log('Receiver, XBOX ONE en TV aangezet.')
            end
     end
}
I read in some other posts that the error could be system rights connected. But all the executables i use are executable for everyone.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest