Page 5 of 48

Re: Dashticz - Module - Garbage collector

Posted: Thursday 11 May 2017 11:04
by EdwinK
I think Rob should make something to alert us on Dashticz that there is a new update :)

Re: Dashticz - Module - Garbage collector

Posted: Thursday 11 May 2017 14:10
by gielie
robgeerts wrote:
gielie wrote:I have different colours for the text corresponding to the afval, is it possible to change the color of the trashcan, corresponding to the trash of that week.
Try latest beta, the icon gets the color of the first upcoming type of trash that gets picked up
This doesnt work in my setup. I changed the colour of the grey bin text but the icon is not changing.
ImageImage



I looked at the code and i already what is happening, the code doesn't look at the colour of the text but at the next trash, i will know next week if it is working, probably it does.

Re: Dashticz - Module - Garbage collector

Posted: Thursday 11 May 2017 14:14
by mvveelen
Coloured trashcan working over here. Subtle and very nice! Thanks Rob :)

Question:

My city works with several different companies who collect paper. For this, they have a PDF file with the dates. I'd like to have this in the dashboard.
If I put the dates (for my location) in a .txt file, or whatever file, could there be something added to Dashticz so the file (use CONFIG.js for the location) can be read and the data can be displayed in an extra block? Maybe a komma-seperated file or something? Like:

Code: Select all

11-05-2017,25-05,2017, etc
Edit:

for now (I hope Rob can make something so I / we can use a .txt file or something to use in the Dashboard) I altered the bin_selecter script to only show me the dates for picking up the paper. I changed it so you now if it's the week the paper is picked up, if it will be picked up tomorrow and if it will be picked up tonight (in my situation it will be picked up every uneven week on Thursday evening).
I haven't tested it yet, but for today it all seems to work:

Code: Select all

week    = tonumber (os.date( "%V"))
dag      = tostring(os.date("%a"));
status   = tonumber(otherdevices_svalues['Paper'])
print('script paper_script executed')

-- Every Thursday evening in the uneven weeks paper get's picked up here.
-- IDX 3573 is my dummy text utility (see below) called 'Paper' (see above)
-- If in your city the paper is picked up in the even weeks, change the ~= to ==

commandArray = {}
if (dag=='Sat' or dag=='Sun'  ) then
   weekend = true; weekdag = false
end 

if (dag=='Mon' or dag=='Tue' or dag=='Wed' or dag=='Thu' or dag=='Fri') then
   weekend = false ; weekdag = true 
end

--Bepalen morgen papier   
if(week % 2 ~= 0 and dag=='Wed') then
      morgenpapier = true; papier = true; vanavondpapier = false
-- ('Morgen papier')
end

--Bepalen vanavond papier   
if(week % 2 ~= 0 and dag=='Thu') then
      morgenpapier = false; papier = true; vanavondpapier = true
-- ('Vanavond papier')
end

--Bepalen deze week papier
if(week % 2 ~= 0 and dag~='Wed' and dag~='Thu') then
      morgenpapier = false; papier = true; vanavondpapier = false
-- ('Deze week papier')
end 

if (papier and weekdag) or (papier and weekend) then      
      commandArray ['UpdateDevice']= '3573|1|Deze week oud papier'
end

if (morgenpapier and weekdag and papier) then
      commandArray ['UpdateDevice']= '3573|1|Morgen oud papier'
end

if (vanavondpapier and weekdag and papier) then
      commandArray ['UpdateDevice']= '3573|1|Vanavond oud papier'
end

if (not(morgenpapier) and not(papier) and not(vanavondpapier)) then
      commandArray ['UpdateDevice']= '3573|1|Deze week geen oud papier'      
end

return commandArray

Re: Dashticz - Module - Garbage collector

Posted: Thursday 11 May 2017 14:48
by niceandeasy
niceandeasy wrote:In my municipality, trash collection day is always Wednesday, for all kinds of trash.
Today, they collected GFT and PBD. Next week, it will be GFT only. In 2 weeks, GFT and Rest, in 3 weeks: GFT only, and in 4 weeks, the cycle repeats: GFT and PBD.

Now, my afvalapp block only shows GFT pick-up dates.
Are the Rest and PBD dates suppressed, because they coincide with the GFT dates? Can I change something, to correct this, or to filter out GFT, because I already know that they pick that up every week?

I did not set any custom names, trash icons and colours, so that is not causing this weird issue.
robgeerts wrote:Could you send me your trash-config including zipcode?
So I can test with it..
zip PM'ed ...

And after getting the latest beta, it works perfectly. It now shows a darkblue container and this text:
Zak_blauw: Woensdag
Gft: Woensdag
Pbp: 24-05-2017
Gft: 24-05-2017
....which is correct, at least, for now, hahaha.

Thanks for the fast bugfixes.

Re: Dashticz - Module - Garbage collector

Posted: Thursday 11 May 2017 14:55
by niceandeasy
EdKo66 wrote:I think Rob should make something to alert us on Dashticz that there is a new update :)
You should just put your git clone command in your cron.

Re: Dashticz - Module - Garbage collector

Posted: Thursday 11 May 2017 18:53
by EdwinK
I rather do git pull :)

Re: Dashticz - Module - Garbage collector

Posted: Thursday 11 May 2017 19:29
by mvveelen
With the paper-script (few posts up):
Schermafbeelding 2017-05-11 om 19.30.02.png
Schermafbeelding 2017-05-11 om 19.30.02.png (120.25 KiB) Viewed 3001 times
:D

Re: Dashticz - Module - Garbage collector

Posted: Thursday 11 May 2017 19:47
by capman
Is it possible to add some script for belgium garbage collector site ? The site is http://www.ophaalkalender.be/Calendar .
A ask this a couple of days here before http://www.domoticz.com/forum/viewtopic ... 20#p133120, but get no response . So a ask again ;)

Re: Dashticz - Module - Garbage collector

Posted: Thursday 11 May 2017 19:54
by EdwinK
Try and see if they give a JSON of XML file.

Re: Dashticz - Module - Garbage collector

Posted: Thursday 11 May 2017 20:24
by capman
EdKo66 wrote:Try and see if they give a JSON of XML file.
When a go to the site and push F12 a screen appear with some codding. At the tab debugging a see some js code , a think :?:
I'm not a coder so if someone can have a look if there is something to do with it ?
Thanks from all Belgium dashticz users :)

Re: Dashticz - Module - Garbage collector

Posted: Thursday 11 May 2017 21:32
by robgeerts
You can now define the maxitems that are listed:

Code: Select all

var trashcan = {}
trashcan.afvalapp = { maxitems: 10, trashapp: 'deafvalapp', width:12,zipcode:'5692VG', housenumber:'33', country:'NL' }

Re: Dashticz - Module - Garbage collector

Posted: Friday 12 May 2017 20:27
by geertvercamer
This is what I found with F12 on http://www.ophaalkalender.be

Code: Select all

[{allDay: true, color: "grey", start: "2017-05-12T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "brown", start: "2017-05-12T00:00:00+02:00", title: "P-K"},
{allDay: true, color: "blue", start: "2017-05-19T00:00:00+02:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-05-19T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-05-26T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "blue", start: "2017-06-02T00:00:00+02:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-06-02T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-06-09T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "brown", start: "2017-06-09T00:00:00+02:00", title: "P-K"},
{allDay: true, color: "blue", start: "2017-06-16T00:00:00+02:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-06-16T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-06-23T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "blue", start: "2017-06-30T00:00:00+02:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-06-30T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-07-07T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "brown", start: "2017-07-07T00:00:00+02:00", title: "P-K"},
{allDay: true, color: "blue", start: "2017-07-14T00:00:00+02:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-07-14T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-07-20T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "blue", start: "2017-07-28T00:00:00+02:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-07-28T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-08-04T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "brown", start: "2017-08-04T00:00:00+02:00", title: "P-K"},
{allDay: true, color: "blue", start: "2017-08-11T00:00:00+02:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-08-11T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-08-18T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "blue", start: "2017-08-25T00:00:00+02:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-08-25T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-09-01T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "brown", start: "2017-09-01T00:00:00+02:00", title: "P-K"},
{allDay: true, color: "blue", start: "2017-09-08T00:00:00+02:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-09-08T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-09-15T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "blue", start: "2017-09-22T00:00:00+02:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-09-22T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-09-29T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "brown", start: "2017-09-29T00:00:00+02:00", title: "P-K"},
{allDay: true, color: "blue", start: "2017-10-06T00:00:00+02:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-10-06T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-10-13T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "blue", start: "2017-10-20T00:00:00+02:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-10-20T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-10-27T00:00:00+02:00", title: "Restafval"},
{allDay: true, color: "brown", start: "2017-10-27T00:00:00+02:00", title: "P-K"},
{allDay: true, color: "blue", start: "2017-11-03T00:00:00+01:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-11-03T00:00:00+01:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-11-10T00:00:00+01:00", title: "Restafval"},
{allDay: true, color: "blue", start: "2017-11-17T00:00:00+01:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-11-17T00:00:00+01:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-11-24T00:00:00+01:00", title: "Restafval"},
{allDay: true, color: "brown", start: "2017-11-24T00:00:00+01:00", title: "P-K"},
{allDay: true, color: "blue", start: "2017-12-01T00:00:00+01:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-12-01T00:00:00+01:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-12-08T00:00:00+01:00", title: "Restafval"},
{allDay: true, color: "blue", start: "2017-12-15T00:00:00+01:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-12-15T00:00:00+01:00", title: "Restafval"},
{allDay: true, color: "grey", start: "2017-12-22T00:00:00+01:00", title: "Restafval"},
{allDay: true, color: "brown", start: "2017-12-22T00:00:00+01:00", title: "P-K"},
{allDay: true, color: "blue", start: "2017-12-29T00:00:00+01:00", title: "PMD"},
{allDay: true, color: "grey", start: "2017-12-29T00:00:00+01:00", title: "Restafval"}]

Re: Dashticz - Module - Garbage collector

Posted: Friday 12 May 2017 21:19
by capman
Can it implentent in dashticz with this code ? A search on the side for some js or xml code , but a don't know where to look :(

Re: Dashticz - Module - Garbage collector

Posted: Friday 12 May 2017 21:40
by EdwinK
I'm not sure if that can be done. Lookss like a calendar to me. But, maybe the creator of the script knows more about this.

Re: Dashticz - Module - Garbage collector

Posted: Saturday 13 May 2017 10:41
by barbaar
I'm having some invalid date issues using afvalwijzer.

Both GFT and Plastic show the invalid date for the most recent items..

Anybody else with this?

Re: Dashticz - Module - Garbage collector

Posted: Saturday 13 May 2017 21:05
by sonar
geertvercamer wrote:This is what I found with F12 on http://www.ophaalkalender.be

Code: Select all

[{allDay: true, color: "grey", start: "2017-05-12T00:00:00+02:00", title: "Restafval"},
With this url you can get the id for your addres:
Example :
http://www.ophaalkalender.be/calendar/f ... pcode=2930

The ID that is in the JSON result can be used to get the schedule in JSON format from the following URL:
http://www.ophaalkalender.be/api/rides? ... pcode=2930

With this input I think Rob can make it work in the garbage script.

Re: Dashticz - Module - Garbage collector

Posted: Saturday 13 May 2017 22:07
by robgeerts
yes, i can :)
(asap)

Re: Dashticz - Module - Garbage collector

Posted: Sunday 14 May 2017 9:18
by geertvercamer
Thanks Sonar, figured that out around midnight and would post it this morning.

And thanks to Rob, of course!

Re: Dashticz - Module - Garbage collector

Posted: Sunday 14 May 2017 9:33
by capman
Thanks Geert to figured this out. This dashboard goes still better and better ... also thanks to Rob !
@ Sonar , how did you become to this url ? Did you find this in some code when using the F12 on that page ? Also thanks for this :D

Re: Dashticz - Module - Garbage collector

Posted: Sunday 14 May 2017 12:31
by gielie
my garbage bin doesn't change color.
Image

this is the code i use

Code: Select all

 var trashcan = {}
trashcan.afvalwijzer = { maxitems: 3, trashapp: 'mijnafvalwijzer', width:12, zipcode:'', housenumber:'' }

var trashnames = {}
trashnames['Gft'] = 'Groene bak';
trashnames['Papier'] = 'Blauwe bak';
trashnames['Restafval'] = 'Grijze bak'

var trashcolors = {}
trashcolors['Gft'] = 'Lime';
trashcolors['Papier'] = 'deepskyBlue';
trashcolors['Restafval'] = 'Darkgrey'
What am i doing wrong?

Ok i figured it out already, the names i use are not compatible with the colored bin code, changed the names and its working.