Page 1 of 1
Can't get dzVents test to work according to log
Posted: Saturday 08 October 2016 11:57
by p0puptoast
I have the files and folders in the correct place as instructed, and have renamed the switch in test.lua to 'Switch family room' but no entry appears in my log when I switch the switch on and off.
I downloaded a zip off the github page to get dzVents.
I am checking the log through the web interface. README.md suggests "Assuming of course that you have configured the notify options in Domoticz. Otherwise you can change the lines with domoticz.notify to domoticz.email(<your address>)" but presumably that's not the syntax for email procedure: OK I found correct syntax from QUICKREF.md but no evidence that the event even fired. (And I have set up e-mail for Domoticz and tested it.)
My only doubt is about the location for script_time_main.lua, script_device_main.lua, dzVents_settings.lua which I have in domoticz/scripts/lua. Have I misunderstood the layout tree in README.md?
My test.lua is below.
Thanks.
Dave
Code: Select all
GNU nano 2.2.6 File: /mnt/files/debian/opt/domoticz/scripts/lua/dzVents/scripts/test.lua Modified
return {
active = true,
on = {
'Switch family room'
},
execute = function(domoticz, switch)
if (switch.state == 'On') then
domoticz.email('Hey!', 'I am on!', '[email protected]')
else
domoticz.email('Hey!', 'I am off!', '[email protected]')
end
end
}
Re: Can't get dzVents test to work according to log
Posted: Saturday 08 October 2016 15:09
by p0puptoast
I should have said I'm running Domoticz v3.5700 running on Arm Debian 7. I compiled Domoticz myself.
Re: Can't get dzVents test to work according to log
Posted: Tuesday 11 October 2016 2:14
by JustME125
Hi Dave,
Not an expert here but I looked at your description above and I have the script_time_main.lua, script_device_main.lua and the settings file in the same location as you have so those should be good.
What bothers me is that there is not a single log entry which leads me to believe that your scripts are not executed at all! Do you have the scripts in the correct folder? They should be in domoticz/scripts/lua/scripts.
Whenever a script runs with whatever error in it, you at least see something in your log file. It looks like the image from my log (attached)
Verstuurd vanaf mijn HTC One_M8 met Tapatalk
Re: Can't get dzVents test to work according to log
Posted: Tuesday 18 October 2016 8:09
by dannybloe
p0puptoast wrote:I have the files and folders in the correct place as instructed, and have renamed the switch in test.lua to 'Switch family room' but no entry appears in my log when I switch the switch on and off.
I downloaded a zip off the github page to get dzVents.
I am checking the log through the web interface. README.md suggests "Assuming of course that you have configured the notify options in Domoticz. Otherwise you can change the lines with domoticz.notify to domoticz.email(<your address>)" but presumably that's not the syntax for email procedure: OK I found correct syntax from QUICKREF.md but no evidence that the event even fired. (And I have set up e-mail for Domoticz and tested it.)
My only doubt is about the location for script_time_main.lua, script_device_main.lua, dzVents_settings.lua which I have in domoticz/scripts/lua. Have I misunderstood the layout tree in README.md?
My test.lua is below.
Thanks.
Dave
Code: Select all
GNU nano 2.2.6 File: /mnt/files/debian/opt/domoticz/scripts/lua/dzVents/scripts/test.lua Modified
return {
active = true,
on = {
'Switch family room'
},
execute = function(domoticz, switch)
if (switch.state == 'On') then
domoticz.email('Hey!', 'I am on!', '[email protected]')
else
domoticz.email('Hey!', 'I am off!', '[email protected]')
end
end
}
Hi Dave,
I totally missed this post. Did you manage to get dzVents working or did you give up on it?
Let me know. Likely I can help
Danny
Re: Can't get dzVents test to work according to log
Posted: Saturday 15 July 2017 18:57
by Derik
dear....
Strange part...
Try the simplest: hey i am on...
With the inline editor
Looks great only when i save the script, it is not working.
Looking with ftp to the file is see the saved lua, only it is root.
And i make it into domoticz:

- ScreenShot128.jpg (47.17 KiB) Viewed 1296 times
When i do:
Code: Select all
sudo chown -R linaro.linaro /home/linaro/domoticz
Is linaro the user...
Only every-time i change the and save.....................
Give me a lot work
Is there a solution, for this strange problem?
Thanks.
Edit:
And when i get the good linaor user i switch and i see no log with this script:
Code: Select all
return {
active = true,
on = {
devices = {
'Kamer: Lampjes, D1'
}
},
execute = function(domoticz, mySwitch)
if (mySwitch.state == 'On') then
domoticz.log('Hey!', 'I am on!')
end
end
}
Re: Can't get dzVents test to work according to log
Posted: Sunday 16 July 2017 7:53
by dannybloe
Remove the comma in the log command as the second param is the log level. It should be a number and now it is a string (I'm on!). Or replace the comma with ..
Did you put the comma there or is it from an example? In that case I have to fix the examples.
Re: Can't get dzVents test to work according to log
Posted: Sunday 16 July 2017 10:57
by Derik
dear thanks for the support.
I am a noop... so please, i do not understand what u mean.....
I use the example and your youtube ..
Please give me a good example so i do have i good start...
Only the other part i more bad..
every time a i change i have the root user...
Re: Can't get dzVents test to work according to log
Posted: Sunday 16 July 2017 16:04
by dannybloe
I meant this:
Code: Select all
return {
active = true,
on = {
devices = {
'Kamer: Lampjes, D1'
}
},
execute = function(domoticz, mySwitch)
if (mySwitch.state == 'On') then
domoticz.log('Hey! I am on!')
end
end
}
If english is too hard, drop me a private message in dutch if this doesn't work for you.
Cheers,
Danny