GarbageCalendar (new version) lua scripts

Moderator: leecollings

User avatar
jvdz
Posts: 2189
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 »

mvveelen wrote: Thursday 10 August 2023 20:33

Code: Select all

Error: !!!!> notification_event_script.lua ended with errors: /home/pi/domoticz/scripts/lua/garbagecalendar/gc_main.lua:488: attempt to call a nil value (global 'Notification_Event')
Guess you haven't downloaded/copied all new files into the garbagecalendar subdirectory?
I believe you are missing file notification_event_script.lua or have an old version ....correct?
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by mvveelen »

The file is there:

/home/pi/domoticz/scripts/lua/garbagecalendar/notification_event_script.lua

And the version I'm using is uploaded on June 20th 2023
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
jvdz
Posts: 2189
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 »

I am talking about file: garbagecalendar/notification_event_script.lua

EDIT Ok so what is its content?
It should contain line at the start:

Code: Select all

function notification_event(RunbyDzVents, commandArray, domoticz)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by mvveelen »

jvdz wrote: Thursday 10 August 2023 22:44 I am talking about file: garbagecalendar/notification_event_script.lua
Yes, I've corrected my first post. It's there.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by mvveelen »

Code: Select all

function notification_event(RunbyDzVents, commandArray, domoticz)
	-----------------------------------------------------------------------------------------------------------------
	-- garbagecalendar notification script
	-- Example script which will Switch a light on with specified color in case of a garbagecalendar notification
	--[[=== Available variables from the mainscript :
			Notify_type     = GarbageType as defined as key in "garbagetype_cfg" and coming from the internet.
			Notify_text     = Formed text sentence using the settings from the "notificationtext" field
			Notify_date     = Formatted notification date using the config variable "notificationdate"
			Notify_mtitle   = Formatted Title sentence using the settings from the "notificationtitle" field
			Notify_mtext    = Description from "garbagetype_cfg" "text" field
			Notify_reminder = Formatted content for the config variable "notificationreminder"
	]]

	--##### To enable the script you have to remove/comment the next line ####
	if 1==1 then return end
	
	
	etc
	
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
jvdz
Posts: 2189
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 »

Ok i see there is a discrepancy there with capitalization:
attempt to call a nil value (global 'Notification_Event'
function notification_event(RunbyDzVents, commandArray, domoticz)


It is best to update your files to the latest version as that also contains some more cleanup and bug fixes.
Let me know if that fixes it. :)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by mvveelen »

Ah, I see. I've updated all files in the folder now and I'll wait until the next "switch". Thanks!
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
jvdz
Posts: 2189
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 »

Just checked and indeed see that issue was part of the 20230620-1630 version, which you were running as far as I could tell.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
jvdz
Posts: 2189
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 »

I see this issue is still in there and the reason you see it is because you have enabled it in your config with:

Code: Select all

EventNotificationscript = 'notification_event_script.lua'
In the current model config that line is commented:

Code: Select all

-- EventNotificationscript = 'notification_event_script.lua'
I have in the mean time fixes the example 'notification_event_script.lua' and changed the name of the function:

Code: Select all

function Notification_Event(RunbyDzVents, commandArray, domoticz)
In case you aren't using that notification_event_script.lua , you really should comment it out in the config or else you need the update.

I've pushed a fix to Github.
Thanks for reporting.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by mvveelen »

Ah, clear. Updated again and commented out this line. Didn't see that one until now, thanks.

Code: Select all

-- EventNotificationscript = 'notification_event_script.lua' -- Specify personal notification script event eg: my_event_script.lua  (This needs to be placed in the GarbageCalendar directory together with the modules)
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
hve22
Posts: 7
Joined: Wednesday 11 October 2017 23:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by hve22 »

Question:

Does it also work with HVC?
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by mvveelen »

hve22 wrote: Saturday 07 October 2023 10:10 Question:

Does it also work with HVC?
Yes, HVC user here, Hoorn. No problem.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
jvdz
Posts: 2189
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 »

hve22 wrote: Saturday 07 October 2023 10:10 Question:

Does it also work with HVC?
You need these settings for HVC:

Code: Select all

wmodule=m_opzet_api
Hostname=inzamelkalender.hvcgroep.nl
Zipcode=11234AB
Housenr=11
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Dutchsea
Posts: 116
Joined: Tuesday 08 December 2015 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version: v2023.2
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Dutchsea »

Hi, my domoticz in raspberry pi crashed and i didnt have a recent back-up. So i started a fresh install also installing the new garbage calendar (om my old pi i still used afvalkalender).

It working: the relevant webpage is scraped properly and my text device is properly updated.
I just cant customize the text nor get a custom icon working though i added the missing records as pee the instrcutions.

I have been checking logs etc for quite a long time but i don't succeed in understanding the reason.
hope someone can find the issue.

Below data from my domoticz log:
  • Run command:
    2023-10-27 21:00:00.566 ls -l /home/pi/domoticz/scripts/lua/garbagecalendar/tmp/garbagecal*m_opzet*:
    2023-10-27 21:00:00.575 Status: LUA: -rw-r----- 1 root root 1677 Oct 27 21:00 /home/pi/domoticz/scripts/lua/garbagecalendar/tmp/garbagecalendar_m_opzet.data
    2023-10-27 21:00:00.575 -rw-r----- 1 root root 17132 Oct 27 21:00 /home/pi/domoticz/scripts/lua/garbagecalendar/tmp/garbagecalendar_m_opzet_run.log
    2023-10-27 21:00:00.575 -rw-r----- 1 root root 19808 Oct 27 20:59 /home/pi/domoticz/scripts/lua/garbagecalendar/tmp/garbagecalendar_m_opzet_run_webupdate.log
    2023-10-27 21:00:00.575 Status: LUA: 21:00:00 gc_main: 876: Access OK: /home/pi/domoticz/scripts/lua/garbagecalendar/tmp/garbagecalendar_m_opzet.data
    2023-10-27 21:00:00.575 Status: LUA: 21:00:00 gc_main: 876: Access OK: /home/pi/domoticz/scripts/lua/garbagecalendar/tmp/garbagecalendar_m_opzet_run.log
    2023-10-27 21:00:00.576 Status: LUA: 21:00:00 gc_main: 584: -> Start update for GarbageCalendar text device "KlikoAgenda"
    2023-10-27 21:00:00.576 Status: LUA: 21:00:00 gc_main: 611: 14 data records loaded, updated at Fri Oct 27 21:00:00 2023 from Datafile:/home/pi/domoticz/scripts/lua/garbagecalendar/tmp/garbagecalendar_m_opzet.data
    2023-10-27 21:00:00.576 Status: LUA: 21:00:00 gc_main: 627: -> Start looping through data to find the first 3 events to show:
    2023-10-27 21:00:00.577 Status: LUA: 21:00:00 gc_main: 674: > first type:groente-, fruit, tuinafval en etensresten Icon:"nil"
    2023-10-27 21:00:00.577 Status: LUA: >> GarbageDate:2023-10-30 GarbageType:groente-, fruit, tuinafval en etensresten ; Calc Days Diff=3; *** Notify skipped because active <> on ( ??) in garbagetype_cfg[]!
    2023-10-27 21:00:00.577 Status: LUA: >> GarbageDate:2023-11-3 GarbageType:papier en karton ; Calc Days Diff=7; *** Notify skipped because active <> on ( ??) in garbagetype_cfg[]!
    2023-10-27 21:00:00.578 Status: LUA: >> GarbageDate:2023-11-6 GarbageType:restafval ; Calc Days Diff=10; *** Notify skipped because active <> on ( ??) in garbagetype_cfg[]!
    2023-10-27 21:00:00.578 Status: LUA: 21:00:00 gc_main: 774: -< End data loop
    2023-10-27 21:00:00.578 Status: LUA: 21:00:00 gc_main: 776: #!# Warning: These records are missing in your garbagecalendarconfig.lua file, so no notifications will be send!
    2023-10-27 21:00:00.578 Status: LUA: 21:00:00 gc_main: 777: #!# Add these records into the garbagetype_cfg table and adapt the schedule, text and icon info to your needs:
    2023-10-27 21:00:00.578 Status: LUA:
    2023-10-27 21:00:00.578 ["groente-, fruit, tuinafval en etensresten "] ={hour=19,min=02,daysbefore=1,reminder=0,text="groente-, fruit, tuinafval en etensresten ", icon=nil},
    2023-10-27 21:00:00.578 ["papier en karton "] ={hour=19,min=02,daysbefore=1,reminder=0,text="papier en karton ", icon=nil},
    2023-10-27 21:00:00.578 ["restafval "] ={hour=19,min=02,daysbefore=1,reminder=0,text="restafval ", icon=nil},
    2023-10-27 21:00:00.578 ["plastic, blik en drinkpakken "] ={hour=19,min=02,daysbefore=1,reminder=0,text="plastic, blik en drinkpakken ", icon=nil},
    2023-10-27 21:00:00.578
    2023-10-27 21:00:00.578 Status: LUA: 21:00:00 gc_main: 779: #!# -- end ----------------------------
    2023-10-27 21:00:00.579 Status: LUA: 21:00:00 gc_main: 786: -> found schedule:maa 30 okt: groente-, fruit, tuinafval en etensresten ; vri 3 nov: papier en karton ; maa 6 nov: restafval ;
    2023-10-27 21:00:00.579 Status: LUA: 21:00:00 gc_main: 846: > No updated text for TxtDevice.
    2023-10-27 21:00:00.579 Status: LUA: 21:00:00 gc_main:1013: -< ### TimeEvent: End garbagecalendar script v20230811-0900
    2023-10-27 21:00:00.588 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_garbagecalendar.lua
And below the code of my config file (with some personal data changed):

Code: Select all

------------------------------------------------------------------------------------------------------------------------------------
-- garbagecalendarconfig.lua
------------------------------------------------------------------------------------------------------------------------------------
-- Specify your information here as needed for your needs

-- Domoticz URL to communicate with Domoticz for version & Icon updates Default http://127.0.0.1:8080
-- Ensure that you are allowing access to Domoticz from 127.0.0.1 without an userid/password!
DomoticzURL     = 'http://127.0.0.1:8080'
myGarbageDevice = 'KlikoAgenda' -- The Text devicename in Domoticz. eg 'Container'
Zipcode = '1234AB' 			-- Your zipcode  eg '1234AB'
Housenr = '99' 			-- Your housnr. eg '99'
Housenrsuf = '' 		-- Your housnr suffix  ('a', 'b'  etc)
Hostname = 'inzamelkalender.gad.nl' 			-- m_opzet & m_opzet_api: Specify the hostname of your website. eg 'inzamelkalender.hvcgroep.nl'
Street = '' 			-- Street name Only needed for: m_recycleapp
Companycode = ''		-- m_ximmio Companycode. (See m_ximmio.lua file for how to find this code).

-- ==============================
-- choose one of these modules ==
-- ==============================
--websitemodule = "m_deafvalapp"
--websitemodule = 'm_mijnafvalwijzer_API'
--websitemodule = 'm_mijnafvalwijzer'
--websitemodule = "m_montferland"
--websitemodule = "m_ophaalkalender-be"
--websitemodule = "m_omrin"
--websitemodule = "m_opzet_api"
websitemodule = "m_opzet"
--websitemodule = "m_recycleapp-be"
--websitemodule = "m_rmn_api"
--websitemodule = "m_rova_api"
--websitemodule = "m_ximmio"
--websitemodule = "m_zuidlimburg"
------------------------------------------------------------------------------------------------------------------------------------
-- When using a CSV input file uncomment the next 2 lines and specify the location and name of the file.
-- check the m_csv_file.lua file for the appropriate format.
--websitemodule = "m_csv_file"
--input_csv_file = "c:/data/garbage_input.csv"
--input_csv_file = "/home/pi/garbage_input.csv"
-- =================================================================================================================================

-- Switch on mydebug in case of issues and initially and check the domoticz log for any issues or missing
-- set to true or false
mydebug = true            -- run the script as it normally does when any of the scheduled times is the current time
testdataload = true       -- run the web update module in the foreground with each run for debugging.
testdataloadbatch = true  -- run the web update module in the background with each run for debugging. (testdataload takes presedence)
testnotification = true   -- trigger a test notification each run for the first record for testing the notification system

-- Specify the directoy used for the Data and Log files.
-- It will default to the gabagecalendar/data directory when invalid or missing.
datafilepath = '/home/pi/domoticz/scripts/lua/garbagecalendar/tmp'    -- Linux/RPI example
--datafilepath = 'D:/temp' -- windows example

------------------------------------------------------------------------------------------------------------------------------------
-- ### define format for text device in Domoticz
-- date options:
--    wd   = weekday in 3 characters as defined in the daysoftheweek table below. eg zon;maa;din
--    wdd  = weekday as defined in the Longdaysoftheweek table below. eg zondag;maandag;dinsdag
--    dd   = day in 2 digits   eg 31
--    mm   = month in 2 digits eg 01
--    mmm  = month abbreviation in 3 characters as defined in the ShortMonth table below. eg : jan
--    mmmm = month  as defined in the LongMonth table below. eg: januari
--    yy   = year in 2 digits eg 19
--    yyyy = year in 4 digits eg 2019
-- Garbage type description options
--    sdesc = short garbage type description from Website  eg pmd
--    ldesc = long garbage type description from Website when available, will be replaced by table description when not
--    tdesc = Use the description available in the table text field
--textformat = 'tdesc: wd dd mmm'
textformat = 'wd dd mmm: tdesc'
-- One can also add some html formatting formating to the output when the used interface supports that:eg:
--    textformat = '<font color="red" size=1>tdesc: wd dd mmm</font>'

-- ### define  what to show in the domoticz text device
-- !!! ShowSinglePerType will be forced to false when Combine_Garbage_perDay = true
ShowSinglePerType = false        -- (default) false => show multiple occurrences of a garbagetype (default)
--                               --	          true  => show one the next occurrence for a unique garbagetype
ShowNextEvents = 3               -- indicate the next x eventlines to show in the TEXT Sensor in Domoticz
Combine_Garbage_perDay = false   -- (default) false will show each garbagetype on its own line
--                               --            true will show multiple garbagetype on a single line when collected the same day

------------------------------------------------------------------------------------------------------------------------------------
-- Configuration for the Notificaton system:
-- IcalDesc:
--   @GARBAGETYPE@ ==> Will be replaced by the GarbageType definion from the WebSite
--   @GARBAGETEXT@ ==> Will be replaced by the text from garbagetype_cfg[].text field
IcalEnable = true -- false/true: When true, a garbagecalendar_Modulename.ics will be created in the datafilepath which can be used in a calendar application.
IcalTitle = 'GarbageCalendar' -- title of the calendar
IcalDesc = '@GARBAGETEXT@ wordt opgehaald.' -- text for the events in the calendar
IcalEvents = 10 -- max number of upcomming events to save to icalfile, but could be less when less events are provided by the website.
IcalNotify = 12 -- Notification Time in hours before event. 0=no notification
------------------------------------------------------------------------------------------------------------------------------------
-- Configuration for the Notificaton system:
NotificationEmailAdress = {'', ''} -- Specify multiple Email Addresses for the notifications. Leave empty to skip email notification
Notificationsystem = '' -- Specify notification system eg "telegram/pushover/gcm/http/kodi/lms/nma/prowl/pushalot/pushbullet/pushsafer" leave empty to skip

-- Specify external personal notification script/command (Shelled async)
--Notificationscript = 'lua /home/pi/domoticz/scripts/lua/garbagecalendar/notification_external_script.lua "@GARBAGETYPE@" > /tmp/GC_Notify.log 2> /tmp/GC_Notify.log'

-- Specify personal notification event script
-- This example is provided and will work in DzVents and regular Lua Time Events
-- EventNotificationscript = 'notification_event_script.lua' -- Specify personal notification script event eg: my_event_script.lua  (This needs to be placed in the GarbageCalendar directory together with the modules)

-- Supported variables for Title and Body
-- @DAY@         ==> Will be replaced by notificationtoday; notificationtomorrow; notificationlonger depending on the days difference.
-- @GARBAGETYPE@ ==> Will be replaced by the GarbageType definition from the WebSite
-- @GARBAGEDATE@ ==> Will be replaced by the pickup date found on the schedule data
-- @GARBAGETEXT@ ==> Will be replaced by the text from garbagetype_cfg[].text field
-- @REMINDER@    ==> Will be set to "" for first notification and "notificationreminder" for the reminder run
-- @TEXT@        ==> Will be replaced by the finalised notificationtext and can be used in the notification script
-- @TITLE@       ==> Will be replaced by the finalised notificationtitle and can be used in the notification script
--### Dutch example
-- Define how the title and bodytext should look
notificationreminder = ' (herinnering)'
notificationtitle = 'GarbageCalendar: @DAY@ de @GARBAGETEXT@ aan de weg zetten!'
notificationtext = '@GARBAGETEXT@ wordt @DAY@ opgehaald!@REMINDER@\nOphaal datum is @GARBAGEDATE@'
notificationtoday = 'vandaag'
notificationtomorrow = 'morgen'
notificationlonger = 'over @DAYS@ dagen'
notificationdate = 'wd dd mmmm yyyy' -- @GARBAGEDATE@ format -> Options are the same as available for textformat date options

--### English example
-- notificationreminder = ' (reminder)'
-- notificationtitle    = 'GarbageCalendar: @GARBAGETEXT@ will be picked up in @DAY@!'
-- notificationtext     = 'Put the @GARBAGETEXT@ out as it will be picked up @DAY@.!@REMINDER@'
-- notificationtoday    = 'today'
-- notificationtomorrow = 'tomorrow'
-- notificationlonger   = 'in @DAYS@ days'
-- notificationdate     = 'wd dd mmmm yyyy'      -- Options are the same as available for textformat date options
------------------------------------------------------------------------------------------------------------------------------------
-- Configuration for the generation of an ics file:
-- IcalDesc:
--   @GARBAGETYPE@ ==> Will be replaced by the GarbageType definion from the WebSite
--   @GARBAGETEXT@ ==> Will be replaced by the text from garbagetype_cfg[].text field
IcalEnable = false -- false/true: When true, a garbagecalendar_Modulename.ics will be created in the datafilepath which can be used in a calendar application.
IcalTitle = 'GarbageCalendar' -- title of the calendar
IcalDesc = '@GARBAGETEXT@ wordt opgehaald.' -- text for the events in the calendar
IcalEvents = 10 -- max number of upcomming events to save to icalfile, but could be less when less events are provided by the website.
IcalNotify = 12 -- Notification Time in hours before event. 0=no notification
------------------------------------------------------------------------------------------------------------------------------------
-- ### define a line for each garbage type returned by the webrequest.
-- Look at the Domoticz log for any missing records as they will be displayed there and can be just copy/pasted in.
-- Fields description:
-- hour & min ==> the time the check needs to be performed and notification send when daysbefore is true
-- daysbefore ==> 0 means that the notification is send on the day of the planned garbage collection
-- daysbefore ==> X means that the notification is send X day(s) before the day of the planned garbage collection
-- reminder   ==> Will send a second reminder after x hours. 0=no reminder (can be between 0 - 24 hours)
-- text       ==> define the text for the notification and Text Device.
-- active     ==> (optional)  default="on"
--           active="on"   Both will show in Domoticz Text Device and Send notifications
--           active="off"  Will show in Domoticz Text Device but not send notifications
--           active="skip" Will not show in Domoticz Text Device and not send notifications
-- The "reloaddata" entry is required to run the background process to update the data one time per day.
-- The "dummy" entry can be used to force reading the data, update the Domoticz text device and see if there are any errors or missing garbadge types.

-- Without updating the Text device ICON:
garbagetype_cfg = {
	-- Add any missing records below this line -----------------------------------------------------
["groente-, fruit, tuinafval en etensresten "] ={hour=19,min=02,daysbefore=1,reminder=0,text="groente-, fruit, tuinafval en etensresten ", icon=nil},
["papier en karton "] ={hour=19,min=02,daysbefore=1,reminder=0,text="papier en karton ", icon=nil},
["restafval "] ={hour=19,min=02,daysbefore=1,reminder=0,text="restafval ", icon=nil},
["plastic, blik en drinkpakken "] ={hour=19,min=02,daysbefore=1,reminder=0,text="plastic, blik en drinkpakken ", icon=nil},
	-- ['groente-, fruit, tuinafval en etensresten '] ={hour=19,min=02,daysbefore=1,reminder=0,text='groente-, fruit, tuinafval en etensresten ', icon=garbagecalendar_green},
	-- ['papier en karton '] ={hour=19,min=02,daysbefore=1,reminder=0,text='papier en karton ', icon=garbagecalendar_blue},
	-- ['restafval '] ={hour=19,min=02,daysbefore=1,reminder=0,text='restafval ', icon=garbagecalendar_grey},
	-- ['plastic, blik en drinkpakken '] ={hour=19,min=02,daysbefore=1,reminder=0,text='plastic, blik en drinkpakken ', icon=garbagecalendar_orange},
	-- ['pmd'] = {hour = 19, min = 22, daysbefore = 1, reminder = 3, text = 'plastic bak', icon = nil},
	-- ['pmd'] = {hour = 19, min = 22, daysbefore = 1, reminder = 3, text = 'plastic bak', icon = 'garbagecalendar_yellow'},
	-- ['gft'] = {hour = 19, min = 22, daysbefore = 1, reminder = 3, text = 'groene bak', icon = nil},
	-- ['papier'] = {hour = 19, min = 22, daysbefore = 1, reminder = 3, text = 'blauwe bak', icon = nil},
	-- ['restafval'] = {hour = 19, min = 22, daysbefore = 1, reminder = 3, text = 'grijze bak', icon = nil},
	-- Add any missing records above this line -----------------------------------------------------
	--  "reloaddata" is used to start the background update process at this given time.
	['reloaddata'] = {hour = 02, min = 30, daysbefore = 0, reminder = 0, text = 'trigger for reloading data from website into garbagecalendar.data'},
	['dummy'] = {hour = 04, min = 01, daysbefore = 0, reminder = 0, text = 'dummy to trigger update of textdevice early morning'}
}

------------------------------------------------------------------------------------------------------------------------------------
-- Taal opties Nederlands
-- Datum / dag informatie:
-- Gebruikt door functie getdate voor formats "mmmm" & "mmm"
daysoftheweek = {'zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'}
Longdaysoftheweek = {'zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'}
ShortMonth = {'jan', 'feb', 'maa', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'}
LongMonth = {'januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'}
-- Wordt gebruikt om de maand afkorting van de ontvangen kalender data te vertalen naar het maandnummer. Meerder opties mogelijk.
-- Pas deze tabellen aan indien de afvalverwerker andere afkortingen gebruikt.
InputMonth = {jan = 1, feb = 2, mrt = 3, maa = 3, apr = 4, mei = 5, jun = 6, jul = 7, aug = 8, sep = 9, okt = 10, nov = 11, dec = 12}
------------------------------------------------------------------------------------------------------------------------------------
-- Language options English
-- Date/day info:
--daysoftheweek={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"}
--Longdaysoftheweek={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"}
--ShortMonth={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}
--LongMonth={"January","February","March","April","May","June","July","August","September","October","November","December"}
-- Used to translate the month abbreviation back to the month number. Can contain multiple options for abbreviations.
-- Adapt when your GarbageCollector is using different abbreviations.
--InputMonth={jan = 1, feb = 2, mar = 3, apr = 4, may = 5, jun = 6, jul = 7, aug = 8, sep = 9, oct = 10, nov = 11, dec = 12}
something else too; i noted during the initial set-up that the log and data files are created with 'root" as owner and group owner. This makes it a bit more difficult to read/use them on my pi. Not sure if this is expected behaviour?
Raspberry PI 3B on USB drive, Debian version: 12 (bookworm), Domoticz 2023.2
Aeon Z-Wave G5 stick, RFXCOM, Sonof Zigbee 3.0 Dongle plus E, Nefit Easy, Fritzbox, Buienradar, Sonos
User avatar
jvdz
Posts: 2189
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 »

Dutchsea wrote: Friday 27 October 2023 21:08 It working: the relevant webpage is scraped properly and my text device is properly updated.
I just cant customize the text nor get a custom icon working though i added the missing records as pee the instrcutions.

I have been checking logs etc for quite a long time but i don't succeed in understanding the reason.
hope someone can find the issue.
And below the code of my config file (with some personal data changed):
Looking at this info it seems that there is an extra space in the proposed garbage types at the end, which could be the cause and an issue in the current module, as it seems they are like that in the config......but I can only be sure when you could share your zipcode & housenr via PM, so I can do some proper testing, as I need the total logfiles and data to do some checks.
Dutchsea wrote: Friday 27 October 2023 21:08 something else too; i noted during the initial set-up that the log and data files are created with 'root" as owner and group owner. This makes it a bit more difficult to read/use them on my pi. Not sure if this is expected behaviour?
The file owner will be the same as the owner of the process running the script.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Dutchsea
Posts: 116
Joined: Tuesday 08 December 2015 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version: v2023.2
Location: The Netherlands
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by Dutchsea »

Ho Jos,

Thank your for responding so quickly. I noticed the space too. I don't have sufficient knowledge to understand if that made a difference and what to try to test a fix. I also wondered about the double quotes (") in the strings as the examples in the config file showed single quotes ('). Below also the code of the garbagecalendar_m_opzet.data file showing the strings without a space. (what does the/13 do?)

Code: Select all

return {
-- Table: {1}
{
   {2},
   {3},
   {4},
   {5},
   {6},
   {7},
   {8},
   {9},
   {10},
   {11},
   {12},
   {13},
   {14},
   {15},
   ["Garbage_LastUpdate"]="Fri Oct 27 23:37:00 2023",
},
-- Table: {2}
{
   ["garbagedate"]="2023-10-30",
   ["garbagetype"]="Groente-\\, fruit\\, tuinafval en etensresten\13",
},
-- Table: {3}
{
   ["garbagedate"]="2023-11-3",
   ["garbagetype"]="Papier en karton\13",
},
-- Table: {4}
{
   ["garbagedate"]="2023-11-6",
   ["garbagetype"]="Restafval\13",
},
-- Table: {5}
{
   ["garbagedate"]="2023-11-8",
   ["garbagetype"]="Plastic\\, blik en drinkpakken\13",
},
-- Table: {6}
{
   ["garbagedate"]="2023-11-13",
   ["garbagetype"]="Groente-\\, fruit\\, tuinafval en etensresten\13",
},
-- Table: {7}
{
   ["garbagedate"]="2023-11-20",
   ["garbagetype"]="Restafval\13",
},
-- Table: {8}
{
   ["garbagedate"]="2023-11-27",
   ["garbagetype"]="Groente-\\, fruit\\, tuinafval en etensresten\13",
},
-- Table: {9}
{
   ["garbagedate"]="2023-11-29",
   ["garbagetype"]="Plastic\\, blik en drinkpakken\13",
},
-- Table: {10}
{
   ["garbagedate"]="2023-12-1",
   ["garbagetype"]="Papier en karton\13",
},
-- Table: {11}
{
   ["garbagedate"]="2023-12-4",
   ["garbagetype"]="Restafval\13",
},
-- Table: {12}
{
   ["garbagedate"]="2023-12-11",
   ["garbagetype"]="Groente-\\, fruit\\, tuinafval en etensresten\13",
},
-- Table: {13}
{
   ["garbagedate"]="2023-12-18",
   ["garbagetype"]="Restafval\13",
},
-- Table: {14}
{
   ["garbagedate"]="2023-12-20",
   ["garbagetype"]="Plastic\\, blik en drinkpakken\13",
},
-- Table: {15}
{
   ["garbagedate"]="2023-12-22",
   ["garbagetype"]="Groente-\\, fruit\\, tuinafval en etensresten\13",
},
}
I have send you a PM with the address details
Raspberry PI 3B on USB drive, Debian version: 12 (bookworm), Domoticz 2023.2
Aeon Z-Wave G5 stick, RFXCOM, Sonof Zigbee 3.0 Dongle plus E, Nefit Easy, Fritzbox, Buienradar, Sonos
User avatar
jvdz
Posts: 2189
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 »

Dutchsea wrote: Friday 27 October 2023 23:45 Below also the code of the garbagecalendar_m_opzet.data file showing the strings without a space. (what does the/13 do?)
Ah... Think I understand the issue now! It seems in your case that there is still an ascii representation of a LineFeed character (/13).
I will check and fix when you can provide the zipcode. ;)
Dutchsea wrote: Friday 27 October 2023 23:45 I have send you a PM with the address details
See my answer in PM. :)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
rensbr
Posts: 61
Joined: Friday 27 July 2018 19:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by rensbr »

In my Domoticz CarbageCalendar I now have a strange name for the 'restafval'. It says 'restafval-mini containers'. It this something I can fix or does the plugin needs an update?

I'm using the Blink afval verwerker.
Screenshot 2023-11-02 080420.png
Screenshot 2023-11-02 080420.png (8.65 KiB) Viewed 2888 times
User avatar
jvdz
Posts: 2189
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 »

rensbr wrote: Thursday 02 November 2023 8:05 In my Domoticz CarbageCalendar I now have a strange name for the 'restafval'. It says 'restafval-mini containers'. It this something I can fix or does the plugin needs an update?
No plugins needed, simply follow the Wiki how to change the config! ;)
https://github.com/jvanderzande/Garbage ... evice-icon

Update the text='restafval-mini containers' to what you want to see.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
rensbr
Posts: 61
Joined: Friday 27 July 2018 19:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GarbageCalendar (new version) lua scripts

Post by rensbr »

jvdz wrote: Thursday 02 November 2023 15:01
rensbr wrote: Thursday 02 November 2023 8:05 In my Domoticz CarbageCalendar I now have a strange name for the 'restafval'. It says 'restafval-mini containers'. It this something I can fix or does the plugin needs an update?
No plugins needed, simply follow the Wiki how to change the config! ;)
https://github.com/jvanderzande/Garbage ... evice-icon

Update the text='restafval-mini containers' to what you want to see.
Ah great. It works again like it should. Thank you for the support and fast reply!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest