Can't get dzVents test to work according to log

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

Moderator: leecollings

Post Reply
p0puptoast
Posts: 7
Joined: Saturday 08 October 2016 11:37
Target OS: Linux
Domoticz version:
Contact:

Can't get dzVents test to work according to log

Post 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
    }
p0puptoast
Posts: 7
Joined: Saturday 08 October 2016 11:37
Target OS: Linux
Domoticz version:
Contact:

Re: Can't get dzVents test to work according to log

Post by p0puptoast »

I should have said I'm running Domoticz v3.5700 running on Arm Debian 7. I compiled Domoticz myself.
JustME125
Posts: 31
Joined: Monday 27 April 2015 16:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.4547
Location: The Netherlands
Contact:

Re: Can't get dzVents test to work according to log

Post 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)Image

Verstuurd vanaf mijn HTC One_M8 met Tapatalk
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Can't get dzVents test to work according to log

Post 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
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Can't get dzVents test to work according to log

Post 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
ScreenShot128.jpg (47.17 KiB) Viewed 1246 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
}
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Can't get dzVents test to work according to log

Post 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.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Can't get dzVents test to work according to log

Post 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...
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Can't get dzVents test to work according to log

Post 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
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest