Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarter Diaper Trash bin #6

Closed
adonno opened this issue May 8, 2020 · 9 comments
Closed

Smarter Diaper Trash bin #6

adonno opened this issue May 8, 2020 · 9 comments
Labels
Projects

Comments

@adonno
Copy link
Owner

adonno commented May 8, 2020

Objective

We have a baby diaper trash bin and we can't see when it's full. Based on that id' like to get a notification to let me know before it's full so I don't have to stick up my head in it 馃挬 .

@adonno adonno added the Project label May 8, 2020
@adonno
Copy link
Owner Author

adonno commented May 8, 2020

First I had to identify how to count the baby diapers.
I used an Aqara open/close sensor and stuck it to the axle, I had to identify a spot where it could easily be mounted and it would not be in the way of the mechanism.

@jcallaghan
Copy link

jcallaghan commented May 8, 2020

I love this. Such a simple application and use of these sensors. It's also a great example of proactive chore maintenance and I bet great for WAF 馃構

@adonno adonno added this to In Progress in SmartHome May 8, 2020
@adonno adonno moved this from In Progress to Blog Article in SmartHome May 8, 2020
@adonno adonno moved this from Blog Article to Focus in SmartHome May 8, 2020
@adonno
Copy link
Owner Author

adonno commented May 9, 2020

I created a counter in Home-assistant to keep track of the diapers. and then an automation to increment it on every state change that is either close and open
(do not track EVERY state change since a disconnection or a battery update would increment the counter)

Counter

---
counter: 
  diaper_counter:
    initial: 0
    step: 1
    icon: mdi:emoticon-poop

Automation

---
- id: '1579629145305'
  alias: Increment diapers counter
  description: ''
  trigger:
  - entity_id: binary_sensor.openclose_19
    from: 'on'
    platform: state
    to: 'off'
  - entity_id: binary_sensor.openclose_19
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - entity_id: counter.diaper_counter
    service: counter.increment

@adonno
Copy link
Owner Author

adonno commented May 9, 2020

Whenever the bin is emptied the counter needs to be reset. I've thought about automating it but found no effective way to do it, so I just added an Aqara button which on a button press resets the counter via an automation

Automation:

- id: '1579629681167'
  alias: Reset diaper counter
  description: ''
  trigger:
  - device_id: 98bb594b8fff4e4ca78656d95a266519
    domain: deconz
    platform: device
    subtype: turn_on
    type: remote_button_short_press
  condition: []
  action:
  - entity_id: counter.diaper_counter
    service: counter.reset

@adonno
Copy link
Owner Author

adonno commented May 9, 2020

Whenever a defined threshold (15) has been reached a notification should be sent to our phones as well as on each additional item until the counter has been reset

Notifications
This is done via NodeRed

Threshold Reached

image

Counter Reset
image

@jcallaghan
Copy link

Do you need to lift the lid to empty it? If so could you automate based on the sensor being open for a period longer than you would when normally using it?

@adonno
Copy link
Owner Author

adonno commented May 10, 2020

Do you need to lift the lid to empty it? If so could you automate based on the sensor being open for a period longer than you would when normally using it?

Yes but i can鈥檛 take that into account or i鈥檇 have to add a second open/close sensor Since the bin works in both positions so
Open -> 1st diaper
Close -> 2nd diaper
Open -> 3rd diaper

And so on

@adonno
Copy link
Owner Author

adonno commented May 10, 2020

Display diaper count on switch
This one is a bit more tricky to explain. The bin stands next to one of our KNX light switches. These have a screen to display additional information like time, temperature or whatever additional data one would like to display.
here you can see a demo video

I won't explain how KNX works but basically you have to set up a group address like "4/2/30" and the specific function of that switch will be added to that group. I then exposed the value of the "counter" to KNX into the specific group

knx:
  expose:
    - type: 'percent'
      entity_id: counter.diaper_counter
      address: '4/2/30'

I had to use percent since the switch wouldn't allow for a plain text field

@adonno
Copy link
Owner Author

adonno commented May 10, 2020

Flash red light on the wall switch when threshold reached

As explained in the previous comment these switches can display some nice information. You can also define the LEDs.

Here I used Node-Red again since I had it already set up for my mobile notifications and I didn't want to create an additional entity in HA. (see here)
In Node-Red I used a Plugin called UltimateKnx. Used a switch node to change the value "15" to "true" and value 0 to "false"
image

@adonno adonno closed this as completed Jul 14, 2020
SmartHome automation moved this from Focus to Done Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
SmartHome
  
Done
Development

No branches or pull requests

2 participants