Can't get a easy dzVents Script working  [Solved]

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

Moderator: leecollings

Post Reply
Extremo
Posts: 9
Joined: Monday 02 April 2018 12:34
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11605
Location: Switzerland
Contact:

Can't get a easy dzVents Script working

Post by Extremo »

Hi Guys

I just played a bit around with dzVents to be warned, when one of my smokedetectors triggers - but I can't get it working:

Code: Select all

-- Check if a SmokeDetector has been triggered.

return {
	active = true,
	on = { "FM *" },                                -- 

	execute = function(domoticz, SmokeDetector)
 
    if SmokeDetector.state == "On" then
        domoticz.notify("FIRE ALARM: " .. SmokeDetector.name)
    end -- if SmokeDetector On

	end -- function
}
The name of my Smoke Detectos are starts always with "FM LocationName". They are set as active devices and set to smokedetector, also I changed the dzVents settings to log all and I get this output:

Code: Select all

2020-02-01 12:11:47.372 (RFLink) Light/Switch (FM Erdgeschoss)
2020-02-01 12:11:47.417 Status: dzVents: Debug: Dumping domoticz data to /home/pi/domoticz/scripts/dzVents/domoticzData.lua
2020-02-01 12:11:47.452 Status: dzVents: Debug: Processing device-adapter for FM Erdgeschoss: Smoke Detector device adapter
2020-02-01 12:11:47.452 Status: dzVents: Debug: Processing device-adapter for FM Erdgeschoss: Switch device adapter
2020-02-01 12:11:47.452 Status: dzVents: Debug: dzVents version: 2.5.5
2020-02-01 12:11:47.452 Status: dzVents: Debug: Event triggers:
2020-02-01 12:11:47.453 Status: dzVents: Debug: - Device: FM Erdgeschoss
2020-02-01 12:12:00.517 Status: dzVents: Debug: Dumping domoticz data to /home/pi/domoticz/scripts/dzVents/domoticzData.lua
2020-02-01 12:12:00.552 Status: dzVents: Debug: Event triggers:
2020-02-01 12:12:00.552 Status: dzVents: Debug: - Timer
Does someone have a idea, what I did wrong?
User avatar
boum
Posts: 135
Joined: Friday 18 January 2019 11:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: France
Contact:

Re: Can't get a easy dzVents Script working  [Solved]

Post by boum »

First thing is to change:

Code: Select all

on = { "FM *" },
To:

Code: Select all

on = { devices = { "FM *" } },
Documentation is here  https://www.domoticz.com/wiki/DzVents:_ ... 8837.2B.29

then there may be some other issues with the script. Add some domoticz.log messages to check values of the things you test.

HTH
Extremo
Posts: 9
Joined: Monday 02 April 2018 12:34
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11605
Location: Switzerland
Contact:

Re: Can't get a easy dzVents Script working

Post by Extremo »

Can I get a "shame" "shame" "shame" for me? It works now, thanks for pointing me on that dumb mistake!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests