-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It's bin day π and the bin has been emptied π notification β° #53
Comments
Calendar integrationI have copied in our local rubbish and recycling bin collection schedule as reoccurring events in my calendar. I adjust the occurrence accordingly to account for public holidays etc.
Using the Google Calendar integration I am able to add a search pattern Additionally, I have created a secondary template sensor that displays the name of the next event that has the event details as attributes. platform: template
sensors:
calendar_house_bin:
friendly_name: 'Next Bin'
value_template: >
{{ state_attr('calendar.house_bin','message') }}
attribute_templates:
description: >-
{{ state_attr('calendar.house_bin','description') }}
location: >-
{{ state_attr('calendar.house_bin','location') }}
start_time: >-
{{ state_attr('calendar.house_bin','start_time') }}
end_time: >-
{{ state_attr('calendar.house_bin','end_time') }}
icon_template: mdi:trash-can I use information from this template sensor in my text-to-speech notifications. |
Notification templatingWhile I was creating the automation I use the Developer Tools > Template tool to evaluate my conditions and templates. During this exercise, I noticed the TemplateVibration sensor last changed:
{{ states.binary_sensor.black_bin_vibration.last_changed }}
Bin day:
{{ states('calendar.house_bin') }}
{{ states('sensor.calendar_house_bin') }}
Is this great than 4 hours?
{{ (as_timestamp(states.sensor.date_time.last_changed) -
(as_timestamp(states.binary_sensor.black_bin_vibration.last_changed))) > 14400 }}
Have 25 minutes passed since the last update?
{{ (as_timestamp(states.sensor.date_time.last_changed) -
(as_timestamp(state_attr('automation.bin_notification','last_triggered')))) > 1500 }}
Notification:
The {{ states('sensor.calendar_house_bin') | lower }} is being collected today.
*** summertime bug ***
This triggered 10 minutes ago but shows as 70 minutes ago
{{state_attr('automation.bin_notification','last_triggered')}}
Time now:
{{states('sensor.date_time') }} Output
|
Would love to see a picture of the actual bin cover. :) |
Bin emptied templatingAgain to test my automation I use the template tool to help see what data I have. TemplateBin day?
{{ states('calendar.house_bin') }}
Next bin:
{{ states('sensor.calendar_house_bin') }}
Orientation X: {{ state_attr('binary_sensor.black_bin_vibration','orientation')[0] | int }}
Open: 7;
Closed: 6;
Orientation Y: {{ state_attr('binary_sensor.black_bin_vibration','orientation')[1] | int }}
Open: -3;
Closed: -2;
Orientation Z: {{ state_attr('binary_sensor.black_bin_vibration','orientation')[2] | int }}
Open: -82;
Closed: -83;
Vibration: {{ state_attr('binary_sensor.black_bin_vibration','vibrationstrength') }}
Idle: ~6
Slammed: ~45
Tilt: {{ state_attr('binary_sensor.black_bin_vibration','tiltangle') }}
Open: 360
Partial Open: ~45
Closed: ~8 Output
|
Sensor attached to bin lidI canβt say Iβve taken a picture of the inside of a bin before but in the interest of sharing...here is a picture @CCOSTAN. |
Consider adding a more visual card https://github.com/bruxy70/Garbage-Collection/. |
@jcallaghan Bin a while i see, but ..still working ok for you ? The bin guys here usually take the bin up the street for a bin, so the sensor will go out of range no doubt. How does one deal with that? Does the 180' flip get registered upon return ? Also, i guess you need to place the sensor at the right spot, but the shaking up in the truck is pretty brutal, no issues with the sensor falling off yet? |
Objective
I work from home a lot and it is not unusual to be on calls for most of the day. Sometimes this leads to bin mix up where someone takes the wrong bin or worse where you're left with no bin at all π.
As I know what day my bins are being updated through my calendar integration I added a vibration sensor to each bin lid. On bin day when this is turned upside down 180Β° degrees or received significant vibration, I send a notification to say the bin has been emptied. This allows me to almost immediately fetch it back in without forgetting about it or it going astray.
Ingredients
Related
The text was updated successfully, but these errors were encountered: