Page 2 of 24

Re: GarbageCalendar (new version) lua scripts

Posted: Thursday 13 February 2020 20:49
by JuanUil
thanx for the help again!!

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 11:56
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 ?

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 12:11
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

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 12:34
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)

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 12:39
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

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 12:41
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

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 12:44
by Thuis
So i have to install lua ? what version 5.2 ?

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 12:44
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

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 12:46
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 !!!

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 12:59
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

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 13:08
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.

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 13:19
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 ?

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 13:29
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

Re: GarbageCalendar (new version) lua scripts

Posted: Friday 14 February 2020 13:35
by Thuis
:D Ah ok did that, working now. Thanks.

Re: GarbageCalendar (new version) lua scripts

Posted: Sunday 16 February 2020 13:38
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?

Re: GarbageCalendar (new version) lua scripts

Posted: Sunday 16 February 2020 14:38
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

Re: GarbageCalendar (new version) lua scripts

Posted: Sunday 16 February 2020 15:11
by rron
Hello Jos,
Perhaps I ḿ trying it later on. For now it is working very good. Thanks.
Ronald

Re: GarbageCalendar (new version) lua scripts

Posted: Monday 17 February 2020 16:35
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.

Re: GarbageCalendar (new version) lua scripts

Posted: Monday 17 February 2020 19:10
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

Re: GarbageCalendar (new version) lua scripts

Posted: Monday 17 February 2020 19:21
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! ;)