GarbageCalendar (new version) lua scripts

Moderator: leecollings

JuanUil
Posts: 497
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by JuanUil »

thanx for the help again!!
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
User avatar
Thuis
Posts: 271
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thuis »

Trying to make it work, but there are so many things i get this in log:
Spoiler: show
@GarbageCalendar(m_goeree-overflakkee): #### start garbagecalendar script v20200211-2130
@GarbageCalendar(m_goeree-overflakkee): #### Debuging with extra messages because "mydebug=true" in garbagecalendarconfig.lua
@GarbageCalendar(m_goeree-overflakkee): #### please change it back to "mydebug=false" when done testing to avoid growing a big domoticz log.
@GarbageCalendar(m_goeree-overflakkee): domoticzjsonpath: /home/onshuis/Domotica/domoticz/scripts/lua/
@GarbageCalendar(m_goeree-overflakkee): datafilepath: /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/
@GarbageCalendar(m_goeree-overflakkee): scriptpath: /home/onshuis/Domotica/domoticz/scripts/lua/
@GarbageCalendar(m_goeree-overflakkee): Loaded /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/garbagecalendarconfig.lua.
@GarbageCalendar(m_goeree-overflakkee): Loaded /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/tablefuncs.lua.
@GarbageCalendar(m_goeree-overflakkee): Start checking garbagetype_cfg table:
@GarbageCalendar(m_goeree-overflakkee): -> NotificationTime:19:22 Garbagetype:pmd
@GarbageCalendar(m_goeree-overflakkee): -> NotificationTime:19:22 Garbagetype:gft
@GarbageCalendar(m_goeree-overflakkee): -> NotificationTime:2:30 Garbagetype:dummy1
@GarbageCalendar(m_goeree-overflakkee): -> NotificationTime:2:30 Garbagetype:reloaddata
@GarbageCalendar(m_goeree-overflakkee): -> NotificationTime:19:22 Garbagetype:papier
@GarbageCalendar(m_goeree-overflakkee): Start update for text device:
@GarbageCalendar(m_goeree-overflakkee): Warning: Datafile not found:/home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/garbagecalendar_m_goeree-overflakkee.data . Start webupdate now.
@GarbageCalendar(m_goeree-overflakkee): start foreground webupdate for module m_goeree-overflakkee of file /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/garbagecalendar_m_goeree-overflakkee.data
@GarbageCalendar(m_goeree-overflakkee): lua /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/m_goeree-overflakkee.lua "/home/onshuis/Domotica/domoticz/scripts/lua/" "3251AT" "100" "" "/home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/garbagecalendar_m_goeree-overflakkee.data" "/home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/garbagecalendar_web_m_goeree-overflakkee.log" "" ""
@GarbageCalendar(m_goeree-overflakkee): Unable to load the data. please check your setup and runlogfile :/home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/garbagecalendar_run_m_goeree-overflakkee.log
@GarbageCalendar(m_goeree-overflakkee): ### Warning: No valid records found in the datafile: /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/garbagecalendar_m_goeree-overflakkee.data
@GarbageCalendar(m_goeree-overflakkee): ### Please check the garbagecalendar log files for issues : /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/garbagecalendar_web_m_goeree-overflakkee.log and /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/garbagecalendar_run_m_goeree-overflakkee.log
@GarbageCalendar(m_goeree-overflakkee): - End -----------------
@GarbageCalendar(m_goeree-overflakkee): ==> found schedule:
@GarbageCalendar(m_goeree-overflakkee): Update device from:
0
replace with:
I get the error in the other log file--> sh: 1: lua: not found

The permissions on the directory /garbagecalendar and /temp are 760.
Both log files are written to the temp dir, but there is no data. What am i doing wrong ?
I Love Domoticz ! And the community around it :-)
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

Thuis wrote: Friday 14 February 2020 11:56 Trying to make it work, but there are so many things i get this in log:

I get the error in the other log file--> sh: 1: lua: not found

The permissions on the directory /garbagecalendar and /temp are 760.
Both log files are written to the temp dir, but there is no data. What am i doing wrong ?
The logfile is large but now contains every step that happens which makes debugging much easier. ;)
Are you sure the setting for the data file is correct:

Code: Select all

datafilepath     = '/home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/'                           -- specify the directory where the afval.data & afval.log will be stored

If that is correct I need to see the file "garbagecalendar_web_m_goeree-overflakkee.log" as that contains the LOG of the module that gets the data from the website.

PS: I get this for your info:

Code: Select all

@GarbageCalendar(m_goeree-overflakkee): ==> found schedule:Groente-, fruit- en tuinafval: Maa 17 feb ; Restafval: Maa 24 feb ; Groente-, fruit- en tuinafval: Maa 2 maa ; 
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Thuis
Posts: 271
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thuis »

yes the destination is correct : /home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp/

in this destination i have only 2 log files, and no .data file.

the file "garbagecalendar_web_m_goeree-overflakkee.log contains : --> sh: 1: lua: not found
Spoiler: show
-- Specify the appropriate directories (Raspberry Pi example)
datafilepath = '/home/onshuis/Domotica/domoticz/scripts/lua/garbagecalendar/temp' -- specify the directory where the garbagecalendar.data & garbagecalendar.log will be stored
scriptpath = '/home/onshuis/Domotica/domoticz/scripts/lua' -- specify the directory for the main "script_time_garbagecalendar.lua" script
domoticzjsonpath = '/home/onshuis/Domotica/domoticz/scripts/lua' -- specify the path to domoticz where the JSON.lua file can be found
-- Specify the appropriate directories (Windows example)
Last edited by Thuis on Friday 14 February 2020 12:40, edited 1 time in total.
I Love Domoticz ! And the community around it :-)
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

Thuis wrote: Friday 14 February 2020 12:34 in this destination i have only 2 log files, and no .data file.
the file "garbagecalendar_web_m_goeree-overflakkee.log contains : --> sh: 1: lua: not found
That would mean that lua isn't in the standard search path?
What happens when you go to the command prompt and just run: lua -v
EDIT: Also try these commands when the first one doesn't work:
lua52 -v
lua53 -v

Jos
Last edited by jvdz on Friday 14 February 2020 12:42, edited 1 time in total.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Thuis
Posts: 271
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thuis »

onshuis@onshuis-pc:~$ lua -v

Command 'lua' not found, but can be installed with:

sudo apt install lua5.1
sudo apt install lua5.2
sudo apt install lua50
sudo apt install tarantool
I Love Domoticz ! And the community around it :-)
User avatar
Thuis
Posts: 271
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thuis »

So i have to install lua ? what version 5.2 ?
I Love Domoticz ! And the community around it :-)
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

ah, so you haven't lua installed at all yet and just use lua within domoticz.
Please install lua5.2 which should fix the issue.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Thuis
Posts: 271
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thuis »

onshuis@onshuis-pc:~$ lua -v
Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio

Let's see again . . . Working !!! Now try to find out why the paper blue bin is not between the dates. It is brown, green, brown instead of brown, green, blue. Perhaps some setting somewhere ? But hey the rest is working perfectly :-) Thanks !!!
I Love Domoticz ! And the community around it :-)
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

Thuis wrote: Friday 14 February 2020 12:46 Let's see again . . . Working !!!
Great!
Thuis wrote: Friday 14 February 2020 12:46 Now try to find out why the paper blue bin is not between the dates. It is brown, green, brown instead of brown, green, blue. Perhaps some setting somewhere ?
Have a look at the Setup page in the wiki: https://github.com/jvanderzande/Garbage ... wiki/Setup
and read about this setting:ShowSinglePerType and see if that is what you are looking for. ;)

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Thuis
Posts: 271
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thuis »

Left the old script, ........................................................... right the new :
Image

Where is Paper and Carton ?

I have change the single type thing from false to true and back, but i see no difference on the text switch, it's the same. I even restarted domoticz after chnging from false to true and back.

And what is the maximum x events to show in the TEXT Sensor?, i put it on 5, but it still displays 3.
I Love Domoticz ! And the community around it :-)
User avatar
Thuis
Posts: 271
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thuis »

O wait, the sensor says, last seen on 12:48, so i think i have to wait ? until it shows the new layout ?
I Love Domoticz ! And the community around it :-)
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

Thuis wrote: Friday 14 February 2020 13:19 O wait, the sensor says, last seen on 12:48, so i think i have to wait ? until it shows the new layout ?
Set the "mydebug = true" to update it each minute till all is ok after which you set it back to "mydebug = false".
In normal operation, the text device is only updated at any of the given times in the table.
You want ShowSinglePerType=true when you want the same result as the "old" version. :D

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Thuis
Posts: 271
Joined: Tuesday 11 September 2018 11:36
Target OS: Linux
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Thuis »

:D Ah ok did that, working now. Thanks.
I Love Domoticz ! And the community around it :-)
rron
Posts: 247
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by rron »

Hello Jos,

works perfect for me. Just one question. The old garbage script is in the internal editor. Is it with the new scripts also possible?
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

rron wrote: Sunday 16 February 2020 13:38 Just one question. The old garbage script is in the internal editor. Is it with the new scripts also possible?
I don't know how that works and I am not using the internal editor at all since I like to have control over the scripts myself. :)
All it needs to be able to is to call the other 3 files currently located in the GabageCalendar directory:
  • garbagecalendarconfig.lua
  • m_????????.lua
  • table_funcs.lua
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
rron
Posts: 247
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by rron »

Hello Jos,
Perhaps I ḿ trying it later on. For now it is working very good. Thanks.
Ronald
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
BarryT
Posts: 369
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by BarryT »

We are getting an notification trough the mail today for the garbage tommorow:

Email sent with text: @DAG@ aan de beurt: De @AFVALTEXT@!

This is not good?

*Edit:
Replaced the dutch @dag@ and @afvaltext@ into english ones, working now.
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by jvdz »

BarryT wrote: Monday 17 February 2020 16:35 We are getting an notification trough the mail today for the garbage tommorow:

Email sent with text: @DAG@ aan de beurt: De @AFVALTEXT@!

This is not good?

*Edit:
Replaced the dutch @dag@ and @afvaltext@ into english ones, working now.
Barry, not sure I understand what you mean here.
Could you let me know whether there is a error in the script that needs to be fixed or did you have an issue in your config?

Thanks
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
BarryT
Posts: 369
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by BarryT »

jvdz wrote: Monday 17 February 2020 19:10 Barry, not sure I understand what you mean here.
Could you let me know whether there is a error in the script that needs to be fixed or did you have an issue in your config?

Thanks
Jos
hi Jos,

Script was working, but the notification (email) not like it should be.. ;)

in my older config there was:

Code: Select all

--### Dutch example
notificationtitle    = 'GarbageCalendar: @DAG@ de @AFVALTEXT@ aan de weg zetten!'
notificationtext     = '@AFVALTEXT@ wordt @DAG@ opgehaald!'
notificationtoday    = 'vandaag'
notificationtomorrow = 'morgen'
notificationlonger   = 'over @DAYS@ dagen'
changed into:

Code: Select all

--### Dutch example
notificationtitle    = 'GarbageCalendar: @DAY@ de @GARBAGETEXT@ aan de weg zetten!'
notificationtext     = '@GARBAGETEXT@ word @DAY@ opgehaald!'
notificationtoday    = 'vandaag'
notificationtomorrow = 'morgen'
notificationlonger   = 'in @DAYS@ dagen'
Did the job.

The english version works, dutch doesnt.
I don't know as well where i found this "afvaltext" as it seems not to be in this script?
Weird one, but its working now! ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest