I did yes.
Ive added the as_timestamp(strptime and the automation seems to run with that, will see on the day of pickup
any chance an automation like my Afval vandaag, with a value_template and data_templates for Afval Morgen? Yours soes work, but requires the hard coding of the trash types, which id rather set using the template as in Afval Vandaag.
No pickup day today or tomorrow result in an unknown state. If there is some garbage to pickup, the sensor will update sensor.trash_today or sensor.trash_tomorrow with the garbage type to be picked up.
hi,
will test. just to be sure, the component doesn’t create a sensor.trash_ per trash_type anymore, only the trash_today and _tomorrow, which will then have the trash_type as value?
Will need to change a lot of template sensors and automation if so…
It should show all other sensors with just an addition of two more sensors called trash_today and trash_tomorrow. I just modified the module again, I had some datetime parsing issues.
sure i will!
had given it some effort already trying to customize a bit, indeed found the other sensors were still there
cant find the right customization to change the state into something prettier yet:
sensor.trash_today:
friendly_name: 'Trash today'
templates:
entity_picture: >
if (state === 'papier') return '/local/mijnafvalwijzer/papier.png';
else if (state === 'gft' ) return '/local/mijnafvalwijzer/gft.png';
else if (state === 'plastic verpakkingsafval') return '/local/mijnafvalwijzer/plastic.png';
else if (state === 'restafval') return '/local/mijnafvalwijzer/restafval.png';
else return '/local/mijnafvalwijzer/kliko.png';
_stateDisplay: >
if (state === 'papier') return 'Papier';
else if (state === 'gft' ) return 'Gft';
else if (state === 'plastic verpakkingsafval') return 'Plastic';
else if (state === 'restafval') return 'Restafval';
else return 'Geen';
sensor.trash_tomorrow:
friendly_name: 'Trash tomorrow'
templates:
entity_picture: >
if (state === 'papier') return '/local/mijnafvalwijzer/papier.png';
else if (state === 'gft' ) return '/local/mijnafvalwijzer/gft.png';
else if (state === 'plastic verpakkingsafval') return '/local/mijnafvalwijzer/plastic.png';
else if (state === 'restafval') return '/local/mijnafvalwijzer/restafval.png';
else return '/local/mijnafvalwijzer/kliko.png';
_stateDisplay: >
if (state === 'Papier') return 'Papier';
else if (state === 'gft' ) return 'Gft';
else if (state === 'plastic verpakkingsafval') return 'Plastic';
else if (state === 'restafval') return 'Restafval';
else return 'Geen';
Id like the state to show Gft, instead of gft, (bot sure what the sensor finds for the other values yet) and the Unknown to be ‘Geen’, as my _stateDisplay template is trying to do. No luck yet …
since you brought it up: would you consider changing this format a bit?d = datetime.strptime(item['date'], "%Y-%m-%d") Its almost always the same year, so this order takes away some unnecessary Card space (imho).
Thank you for this component and the additional today and tomorrow sensors. The problem I encountered, and maybe some other people as well, is that in my region there is a possibility of that more than 1 kind of trash will be picked up on the same day. For example today the plastic was picked up, but also the gft/restafval. In the today/tomorrow sensor I can only see the plastic will be picked up today. Below a picture of my dashboard. I can fix this for myself with some templating or python script but maybe the best solution would be if you could implement it in the component.
unfortunately the ‘{{ states.sensor.afval_datum.state }}’ renders 19 april, and not ‘tomorrow’ which would make templating easier…
could you help in creating a template the calculates the date of tomorrow, in this case 19 april, to be a day after the current date?
that would enable the automation im looking for, in a way you use yourself with the current big automation, where you subtract (1 * 86400 )…
Hope you understand what im asking here…
Cheers,
Marius
I think i’m gonna love this component. The thrash is piling up here, due to bad memory
The link to your component is not working. I would like to implement this in my hassio. Can you provide the new link to your component?
Hi,
After installing the latest version of the files from github and the given automations i get the error:
Error:
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/components/automation/init.py”, line 335, in async_trigger
if skip_condition or self._cond_func(variables):
File “/usr/lib/python3.6/site-packages/homeassistant/components/automation/init.py”, line 444, in if_action
return all(check(hass, variables) for check in checks)
File “/usr/lib/python3.6/site-packages/homeassistant/components/automation/init.py”, line 444, in
return all(check(hass, variables) for check in checks)
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/condition.py”, line 317, in template_if
return async_template(hass, value_template, variables)
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/condition.py”, line 299, in async_template
value = value_template.async_render(variables)
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/template.py”, line 132, in async_render
return self._compiled.render(kwargs).strip()
File “/usr/lib/python3.6/site-packages/jinja2/asyncsupport.py”, line 76, in render
return original_render(self, *args, **kwargs)
File “/usr/lib/python3.6/site-packages/jinja2/environment.py”, line 1008, in render
return self.environment.handle_exception(exc_info, True)
File “/usr/lib/python3.6/site-packages/jinja2/environment.py”, line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File “/usr/lib/python3.6/site-packages/jinja2/_compat.py”, line 37, in reraise
raise value.with_traceback(tb)
File “”, line 1, in top-level template code
TypeError: unsupported operand type(s) for -: ‘NoneType’ and ‘int’
Home Assistant 0.68.0 on Hassio
Automation:
alias: ‘Trash - Groene bak’
trigger:
platform: time
hours: 12
minutes: 57
seconds: 0
condition: