1st very little dzVents script based on video don't work  [Solved]

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

Moderator: leecollings

Post Reply
User avatar
KroontjesPen
Posts: 43
Joined: Thursday 03 November 2016 15:46
Target OS: Windows
Domoticz version: 4.10717
Location: Spijkenisse NL
Contact:

1st very little dzVents script based on video don't work

Post by KroontjesPen »

 
On this rainy Sunday a good moment for testing my first very little dzVents script.
That was disappointing.

Taken from the video 26:18:
Image

Make this changes:
Image


But get this error:

Code: Select all

2019-10-06 14:32:00.529 Status: dzVents: Info: ------ Start internal script: 4 mei:, trigger: at 6/10 between 14:32 and 14:33
2019-10-06 14:32:00.530 Status: dzVents: Error (2.4.19): There is no group or scene with that name or id: Tuin Lantaarns. If you just created the scene or group you may have to restart Domoticz to make it become visible to dzVents.
2019-10-06 14:32:00.530 Status: dzVents: Error (2.4.19): An error occured when calling event handler 4 mei
2019-10-06 14:32:00.530 Status: dzVents: Error (2.4.19): ...86)\Domoticz\scripts\dzVents\generated_scripts/4 mei.lua:11: attempt to index a nil value
2019-10-06 14:32:00.530 Status: dzVents: Info: ------ Finished 4 mei
2019-10-06 14:33:00.184 Status: dzVents: Info: ------ Start internal script: 4 mei:, trigger: at 6/10 between 14:32 and 14:33
2019-10-06 14:33:00.185 Status: dzVents: Error (2.4.19): There is no group or scene with that name or id: Tuin Lantaarns. If you just created the scene or group you may have to restart Domoticz to make it become visible to dzVents.
2019-10-06 14:33:00.185 Status: dzVents: Error (2.4.19): An error occured when calling event handler 4 mei
2019-10-06 14:33:00.185 Status: dzVents: Error (2.4.19): ...86)\Domoticz\scripts\dzVents\generated_scripts/4 mei.lua:11: attempt to index a nil value
2019-10-06 14:33:00.185 Status: dzVents: Info: ------ Finished 4 mei 
DZ is restarted Friday for Windows update.
 
Bear with me, English is not my native language.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: 1st very little dzVents script based on video don't work

Post by waaren »

KroontjesPen wrote: Sunday 06 October 2019 14:56 There is no group or scene with that name or id: Tuin Lantaarns. If you just created the scene or group you may have to restart Domoticz to make it become visible to dzVents.
Seems like a very descriptive error message to me. The scene "Tuin Lantaarns" does not exist or is not visible yet to dzVents.
If domoticz was already restarted after creation of the scene it might be that Tuin Lantaarns is not spelled exact (Case matters) or that it is no scene but a device or group.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
KroontjesPen
Posts: 43
Joined: Thursday 03 November 2016 15:46
Target OS: Windows
Domoticz version: 4.10717
Location: Spijkenisse NL
Contact:

Re: 1st very little dzVents script based on video don't work

Post by KroontjesPen »

 Looking further myself.

Confusion:
Image
Scene


Image
Group


Result
Image

Code: Select all

 2019-10-06 15:20:00.400 Status: dzVents: Info: ------ Start internal script: 4 mei:, trigger: at 6/10 between 15:20 and 15:21
2019-10-06 15:20:00.401 Status: dzVents: Error (2.4.19): An error occured when calling event handler 4 mei
2019-10-06 15:20:00.401 Status: dzVents: Error (2.4.19): ...86)\Domoticz\scripts\dzVents\generated_scripts/4 mei.lua:11: attempt to call field 'group' (a nil value)
2019-10-06 15:20:00.401 Status: dzVents: Info: ------ Finished 4 mei
2019-10-06 15:21:00.521 Status: dzVents: Info: ------ Start internal script: 4 mei:, trigger: at 6/10 between 15:20 and 15:21
2019-10-06 15:21:00.521 Status: dzVents: Error (2.4.19): An error occured when calling event handler 4 mei
2019-10-06 15:21:00.521 Status: dzVents: Error (2.4.19): ...86)\Domoticz\scripts\dzVents\generated_scripts/4 mei.lua:11: attempt to call field 'group' (a nil value)
2019-10-06 15:21:00.521 Status: dzVents: Info: ------ Finished 4 mei 
Bear with me, English is not my native language.
User avatar
KroontjesPen
Posts: 43
Joined: Thursday 03 November 2016 15:46
Target OS: Windows
Domoticz version: 4.10717
Location: Spijkenisse NL
Contact:

Re: 1st very little dzVents script based on video don't work

Post by KroontjesPen »

 
@waaren

Why can Blockly events works on daily base with "Tuin Lantaarns"

The I will try it on a device in the room.

Code: Select all

return {
	on = {
		timer = {

            'at 6/10 between 15:42 and 15:43'

	   },
    },
	execute = function(domoticz, dummy)
	    
		domoticz.devices('Kamer Midden').switchOn()
	end
}

The device was switchOn but NOT OFF.

2019-10-06 15:42:00.478 Status: dzVents: Info: ------ Start internal script: 4 mei:, trigger: at 6/10 between 15:42 and 15:43
2019-10-06 15:42:00.608 Status: dzVents: Info: ------ Finished 4 mei
2019-10-06 15:42:00.609 Status: EventSystem: Script event triggered: C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua
2019-10-06 15:43:00.576 Status: dzVents: Info: ------ Start internal script: 4 mei:, trigger: at 6/10 between 15:42 and 15:43
2019-10-06 15:43:00.612 Status: dzVents: Info: ------ Finished 4 mei
2019-10-06 15:43:00.613 Status: EventSystem: Script event triggered: C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua

That 'at 6/10 between 15:42 and 15:43' is also not working properly.


It had to be domoticz.groups('Tuin Lantaarns').switchOn() (To be sure I copied the name from the Devices list.)

But also here: NO switching OFF

For 4 mei I can't use it. :(
 
Last edited by KroontjesPen on Sunday 06 October 2019 16:12, edited 3 times in total.
Bear with me, English is not my native language.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: 1st very little dzVents script based on video don't work

Post by waaren »

KroontjesPen wrote: Sunday 06 October 2019 15:38  
@waaren

Why can Blockly events works on daily base with "Tuin Lantaarns"

The I will try it on a device in the room.

The result I post here
Tuin Lantaarns is not a scene. It is a group !
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
KroontjesPen
Posts: 43
Joined: Thursday 03 November 2016 15:46
Target OS: Windows
Domoticz version: 4.10717
Location: Spijkenisse NL
Contact:

Re: 1st very little dzVents script based on video don't work

Post by KroontjesPen »

 
Resume.

My problem is solved.

1) It was a group and it had to be put this way in 't script: domoticz.groups('Tuin Lantaarns').switchOn()
2) To be sure of the right spelling of the name I copied from the Devices list.


Sadly we bumped to an other problem.

The 'at dd/mm between hh:mm and hh:mm' rule switched the device/group on, but NOT OFF.

For the search, I think, it's better to close this one.
 
Bear with me, English is not my native language.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: 1st very little dzVents script based on video don't work

Post by waaren »

KroontjesPen wrote: Sunday 06 October 2019 16:42 The 'at dd/mm between hh:mm and hh:mm' rule switched the device/group on, but NOT OFF.
You misunderstand the concept of the timer section.
In this section it is determined when the script should be triggered.
The what the script must do is defined in the execute section.
So if you want to switch something on on the 6th of october at 15:42 and switch it off at 15:43 on the same day the script should look like:

Code: Select all

return {
	on = {
		timer = {
            'on 6/10 at 15:42'
	   },
    },

	execute = function(domoticz)
		domoticz.devices('Kamer Midden').switchOn()
		domoticz.devices('Kamer Midden').switchOff().afterMin(1)
	end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
KroontjesPen
Posts: 43
Joined: Thursday 03 November 2016 15:46
Target OS: Windows
Domoticz version: 4.10717
Location: Spijkenisse NL
Contact:

Re: 1st very little dzVents script based on video don't work

Post by KroontjesPen »

 
In the
https://www.domoticz.com/wiki/DzVents: ... scripting
there are giving a lot of examples like:

Code: Select all

'between aa and bb'          -- aa/bb can be a time stamp like 15:44
                                        -- aa/bb can be sunrise/sunset
                                        -- aa/bb can be 'xx minutes before/after
                                           sunrise/sunset'
-------------------------------------------------------------------------------------------------------------------                                           
And this one:
 					-- or if you want to go really wild and combine them:
           				'at nighttime at 21:32-05:44 every 5 minutes on sat, sun',
           				'every 10 minutes between 20 minutes before sunset and 30 minutes after sunrise on mon,fri,tue on 20/5-18/8'                                           
If that is not working where I get then the right info for learning dzVents. ;)
Bear with me, English is not my native language.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: 1st very little dzVents script based on video don't work

Post by waaren »

KroontjesPen wrote: Sunday 06 October 2019 18:05  .... If that is not working where I get then the right info for learning dzVents. ;)
Sorry but you miss my point on the concepts of the different sections as I explained in my previous post. I don't know how to make it more clear.
I will try in a PM to you in dutch
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
KroontjesPen
Posts: 43
Joined: Thursday 03 November 2016 15:46
Target OS: Windows
Domoticz version: 4.10717
Location: Spijkenisse NL
Contact:

Re: 1st very little dzVents script based on video don't work  [Solved]

Post by KroontjesPen »

 

Every problem solved.

Code: Select all

return {
	on = {
		timer = {

            'on 04/05 at 20:00',

	   },
    },
	execute = function(domoticz, dummy)
	    
		domoticz.groups('Tuin Lantaarns').switchOn()
		domoticz.groups('Tuin Lantaarns').switchOff().afterMin(2)
	end
}

Bear with me, English is not my native language.
Post Reply

Who is online

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