Introducing dzVents - Domoticz Lua file based event scripting made e-z!
Moderator: leecollings
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
Then you have to wait until the master guru himself returns in the forum.
The last time I synchronized was yesterday morning, no errors whatsoever then
The last time I synchronized was yesterday morning, no errors whatsoever then
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
-
- Posts: 476
- Joined: Monday 14 March 2016 13:55
- Target OS: Linux
- Domoticz version: beta
- Location: Rome, Italy
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
maybe there something in my system...
Just to understand if I am doig right:
Here is written event_helper.lua but the file in the zip is EventHelpers.lua (same name already exist in the /domoticz/scripts/lua folder and I let this one overwrite the other).
This is the only things to do except for modification in the dzVents_settings.lua), right?
Thanks
Just to understand if I am doig right:
Code: Select all
Copy the following to the Domoticz script folder: /path/to/domoticz/scripts/lua:
event_helpers.lua
script_time_main.lua
script_device_main.lua
Domoticz.lua
dzVents_settings.lua and
the folder scripts
This is the only things to do except for modification in the dzVents_settings.lua), right?
Thanks
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
Here is written event_helper.lua
in my folder it is called event_helpers.lua
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
-
- Posts: 476
- Joined: Monday 14 March 2016 13:55
- Target OS: Linux
- Domoticz version: beta
- Location: Rome, Italy
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
I missed the s in the post, sorry.
In any case I tried with both, event_helpers.lua and EventHelpers.lua like now you can find in the GitHub folder.
I'll wait for some news...
In any case I tried with both, event_helpers.lua and EventHelpers.lua like now you can find in the GitHub folder.
I'll wait for some news...
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
But you are sure you tried the 0.9.13 branch on github?
And start fresh empty dir and so?
And start fresh empty dir and so?
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
-
- Posts: 476
- Joined: Monday 14 March 2016 13:55
- Target OS: Linux
- Domoticz version: beta
- Location: Rome, Italy
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
Nope! I was using the master one
Shame on me.
Now it's working!!!
I didn't noticed the branches...
Thanks!!!
Shame on me.
Now it's working!!!
I didn't noticed the branches...
Thanks!!!
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
reading help from other people is mandatory if you ask for help
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
-
- Posts: 1355
- Joined: Friday 29 August 2014 11:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Ermelo
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
Grrr. notifications for new posts is still not working well.. so I miss new posts here every now and then, sorry about that ..
Indeed.. master branch is currently in flux. I'm refactoring stuff so that installing is even easier (and I wrote 120+ unit-tests for it this weekend for future stability (and caught a few bugs while doing this)).
So, yeah, stick to the tags when installing for now. In the future I will make the master branch the stable one and do dev stuff in another branch.
Indeed.. master branch is currently in flux. I'm refactoring stuff so that installing is even easier (and I wrote 120+ unit-tests for it this weekend for future stability (and caught a few bugs while doing this)).
So, yeah, stick to the tags when installing for now. In the future I will make the master branch the stable one and do dev stuff in another branch.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
I have the Idea (not sure) that if you do not click on the latest notification, you are not going to get a new onedannybloe wrote: Grrr. notifications for new posts is still not working well.. so I miss new posts here every now and then
I
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
-
- Posts: 63
- Joined: Sunday 14 July 2013 11:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Ipswich, UK
- Contact:
Upgrading dzVents
[smug mode] I have to say that all I do to snarf the latest version is: download the zip, unpack it to an empty directory then copy the whole kit and kaboodle EXCEPT THE SETTINGS file to the domoticz/scripts/lua on my Pi
One day I'll come a cropper because Garry will have changed the settings file, but until then ...
[/smug mode]
One day I'll come a cropper because Garry will have changed the settings file, but until then ...
[/smug mode]
-
- Posts: 1355
- Joined: Friday 29 August 2014 11:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Ermelo
- Contact:
Some daredevils needed
Today I finished refactoring dzVents. As I said earlier, I wrote around 130 unit tests for the code and I moved most of the dzVents code to a subfolder. I also added some new functionality (from the history.txt):
So, my intention is that this will become version 1.0 but before releasing it I ask anyone who dares to test the master branch (perhaps make a copy of your entire lua folder so you can easily restore it). I have tested it locally here and all seems fine.
Fingers crossed
- Added SMS method.
- Added toggleSwitch() method to devices that support it.
- Added more switch states that control device.bState (e.g. on == true, open == true etc)
- Added secondsAgo next to minutesAgo to the device.lastUpdate attribute
So, my intention is that this will become version 1.0 but before releasing it I ask anyone who dares to test the master branch (perhaps make a copy of your entire lua folder so you can easily restore it). I have tested it locally here and all seems fine.
Fingers crossed
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
- remb0
- Posts: 499
- Joined: Thursday 11 July 2013 22:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
Lua editor in domoticz is fully compatible with this?
Maybe when its finished it can Be obtained in domoticz?
I Will test tomorrow and put an install script for it in my script.
https://github.com/remb0/Domoticz_configurator
Maybe when its finished it can Be obtained in domoticz?
I Will test tomorrow and put an install script for it in my script.
https://github.com/remb0/Domoticz_configurator
-
- Posts: 1355
- Joined: Friday 29 August 2014 11:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Ermelo
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
You mean the one that runs in the browser? I don't think so. dzVents has it's own mechanism to figure out which script needs to be called (based on the triggers and active state and timer states). The problem is that the scripts that can be edited inside Domoticz don't live on the file system but in the database. That means that the script dispatchers from dzVents cannot find them and cannot call them. You could pass the domoticz object to these scripts with a bit of effort for easy controlling of the domoticz devices but you would miss some part of the fun.remb0 wrote:Lua editor in domoticz is fully compatible with this?
It would have been nice if the script editor in Domoticz would have stored the scripts on the filesystem as was suggested by a couple of people. That would have made this an awesome combination I guess.
Nice!Maybe when its finished it can Be obtained in domoticz?
I Will test tomorrow and put an install script for it in my script.
https://github.com/remb0/Domoticz_configurator
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
eh,
I have to read it again i think or something to do with rights?
Files copied from windows
Code: Select all
2016-03-22 22:36:11.738 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_device_main.lua: /home/pi/domoticz/scripts/lua/dzVents/EventHelpers.lua:3: module 'utils' not found:
no field package.preload['utils']
no file '/usr/local/share/lua/5.2/utils.lua'
no file '/usr/local/share/lua/5.2/utils/init.lua'
no file '/usr/local/lib/lua/5.2/utils.lua'
no file '/usr/local/lib/lua/5.2/utils/init.lua'
no file './utils.lua'
no file '/home/pi/domoticz/scripts/lua//utils.lua'
no file '/home/pi/domoticz/scripts/lua/dzVents/utils.lua'
no file '/home/pi/domoticz/scripts/lua/scripts/utils.lua'
no file '/usr/local/lib/lua/5.2/utils.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './utils.so'
Files copied from windows
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
-
- Posts: 1355
- Joined: Friday 29 August 2014 11:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Ermelo
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
Can you print the package path right after it is constructed in de main scripts?
Are you sure you did exactly as described in the readme? Replaced all the files with the new ones?
There should be a folder dzEvents inside the lua folder.
Are you sure you did exactly as described in the readme? Replaced all the files with the new ones?
There should be a folder dzEvents inside the lua folder.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
I will try tomorrow again, I was pretty sure that I followed the "Instructions"
But for now i have put the old scripts back.
Tomorrow another try, with fresh mind
eh?
But for now i have put the old scripts back.
Tomorrow another try, with fresh mind
eh?
Can you print the package path right after it is constructed in de main scripts?
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
By the way the file devices.lua cannot be removed i see?
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
-
- Posts: 1355
- Joined: Friday 29 August 2014 11:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Ermelo
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
In script_device_main.lua or script_time_main.lua at line 7 addNietGiftig wrote:I will try tomorrow again, I was pretty sure that I followed the "Instructions"
But for now i have put the old scripts back.
Tomorrow another try, with fresh mind
eh?Can you print the package path right after it is constructed in de main scripts?
Code: Select all
print(package.path)
And devices.lua contains the data that is fetched from Domoticz through http for additional data like battery status. You should be able to remove it. If you have set ['Enable http fetch'] = true in the settings file then it will automatically be refetched after a while.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
-
- Posts: 121
- Joined: Sunday 11 October 2015 8:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6224
- Location: Holland
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
And here are the results:
It seems that on the Domoticz image no lua 5.2 is installed.
There is no /usr/local/share/lua on my system
The file '/home/pi/domoticz/scripts/lua/dzVents/utils.lua' is named Utils.lua
Installed from the zip file.
Code: Select all
2016-03-23 08:24:09.316 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_device_main.lua: /home/pi/domoticz/scripts/lua/dzVents/EventHelpers.lua:3: module 'utils' not found:
no field package.preload['utils']
no file '/usr/local/share/lua/5.2/utils.lua'
no file '/usr/local/share/lua/5.2/utils/init.lua'
no file '/usr/local/lib/lua/5.2/utils.lua'
no file '/usr/local/lib/lua/5.2/utils/init.lua'
no file './utils.lua'
no file '/home/pi/domoticz/scripts/lua//utils.lua'
no file '/home/pi/domoticz/scripts/lua/dzVents/utils.lua'
no file '/home/pi/domoticz/scripts/lua/scripts/utils.lua'
no file '/usr/local/lib/lua/5.2/utils.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './utils.so'
2016-03-23 08:24:42.915 LUA: /usr/local/share/lua/5.2/?.lua;/usr/local/share/lua/5.2/?/init.lua;/usr/local/lib/lua/5.2/?.lua;/usr/local/lib/lua/5.2/?/init.lua;./?.lua;/home/pi/domoticz/scripts/lua//?.lua;/home/pi/domoticz/scripts/lua/dzVents/?.lua;/home/pi/domoticz/scripts/lua/scripts/?.lua
There is no /usr/local/share/lua on my system
The file '/home/pi/domoticz/scripts/lua/dzVents/utils.lua' is named Utils.lua
Installed from the zip file.
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
-
- Posts: 1355
- Joined: Friday 29 August 2014 11:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Ermelo
- Contact:
Re: Introducing dzVents - Domoticz Lua file based event scripting made e-z!
These package paths are provided by the lua system itself instead of the stuff that I add to it.
I commited some changes in master. Could you try this? The utils.lua file should be with a capital now and both _main.lua files have been changed as well.
I commited some changes in master. Could you try this? The utils.lua file should be with a capital now and both _main.lua files have been changed as well.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Who is online
Users browsing this forum: Bing [Bot] and 0 guests