DZvents timer wont tirgger

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

Moderator: leecollings

Post Reply
markjgabb
Posts: 142
Joined: Tuesday 24 January 2017 23:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Australia
Contact:

DZvents timer wont tirgger

Post by markjgabb »

hey all
i have the below dzvents script in my domoticz v2020.2 Stable
but it never fires?
you can see i have logging in there to dump out to the logs every time its triggered but i never see it in the logs page of domoticz

Code: Select all

return {
	on = {
	--	devices = {['Lounge Temperature'] =  {'between 06:00 and 08:00'}}
	--	devices = {78}
		timer =
        {
            'every minute'
        }
	},
	
	data = 
    {
           temperatures = {history = true, maxItems = 10 },
    },

	execute = function(dz, item, device)
	    dz.log('heater script kicked it', dz.LOG_INFO)
	    local temp = dz.devices(78) --loungeroom temprature sensor
	    dz.data.temperatures.add(temp.temperature)
	    local heater = dz.devices('Heater') -- Reverse Cycle Heating Mode
	    local cooling = dz.devices('Cooling') -- Reverse Cycle Coling Mode
	    local average = dz.data.temperatures.avg() -- Average of Temprate Sensor in Loungeroom
        local Season = 'Cooling' -- Variable for if system should be in heating or cooling mode
        local setpoint = dz.devices(144) -- Lounge Thermostate
	--	dz.log('Device ' .. device.name .. ' was changed', dz.LOG_INFO)
		
		dz.log('Temp: ' .. temp.temperature, dz.LOG_INFO)
		dz.log('Average Temp: ' .. average, dz.LOG_INFO)
        dz.log('current setting is ' .. Season, dz.LOG_INFO)
        if (Season == 'Heating') then
		    if (temp.temperature <= 18 and average <= 18) then
		        
                    heater.switchOn().checkFirst()
            end
            if (temp.temperature >= 22 and average >= 22) then
                heater.switchOff().checkFirst()
            end
        end
    end
    
}

V 2020.2 RPI 3
RFlink 334 mhz
mysensors
broadlink
Mirabella Genio Globes
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DZvents timer wont tirgger

Post by waaren »

markjgabb wrote: Sunday 24 January 2021 9:08 but it never fires?
It should just execute.
  • Do you see other dzVents scripts executing in the log?
  • what are your settings for dzVents logging?
  • How do you look at logfile? If from within the GUI do you look at all logtypes?
  • How did you save the script? Do you see something in log when changing the script and save it again?
btw. Your profile and signature show another version then the one you mention in your post
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
markjgabb
Posts: 142
Joined: Tuesday 24 January 2017 23:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Australia
Contact:

Re: DZvents timer wont tirgger

Post by markjgabb »

Do you see other dzVents scripts executing in the log?
Yes i do, and i know others work as i dont use anything but dzvents anymore

what are your settings for dzVents logging?
Errors only, you are spot on thats why i couldnt see the logging i had in place for the debugging of the script. sometimes its the simple things....
ill answer the rest just incase someone else is curious

How do you look at logfile? If from within the GUI do you look at all logtypes?
yeah in the GUI and yeah i flip between all 3 depending on what i want to look at

How did you save the script? Do you see something in log when changing the script and save it again?
Using the DZvents editor window. No error on complile where it shows all the scripts registering after a save

btw. Your profile and signature show another version then the one you mention in your post
Cheers i have updated it now.... cant believe that its been that long since I changed the signature....
then again domoticz is one of things i get running then leave it alone to do its job for months at a time, sometimes you can forget its even there in the background

EDIT:

On a similar vein is there a way to just set one script to debug mode and have it show everything without changing the main settings? it would be usefull to have just the one script showing every action without everything else cluttering up the logs
V 2020.2 RPI 3
RFlink 334 mhz
mysensors
broadlink
Mirabella Genio Globes
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DZvents timer wont tirgger

Post by waaren »

markjgabb wrote: Sunday 24 January 2021 11:57 On a similar vein is there a way to just set one script to debug mode and have it show everything without changing the main settings? it would be usefull to have just the one script showing every action without everything else cluttering up the logs
Like this?

Code: Select all

return  
{
    on = 
    { 
        devices = {'yourDevice'}, -- set device trigger 
    }, 

    logging = 
    {   
        level = domoticz.LOG_DEBUG,
        marker = "Any string", 
    },

    execute = function(dz, item)
        dz.log('text',dz.LOG_DEBUG)        
    end
}

Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest