Proof of Concept
Maybe sharing how my idea works will make everyone understand better the value of having this alternative to Amazon Dash Button.
The idea is to stick these mini remote controls strategically around the house such as in the store room, on the fridge, beside the washing machine, behind the bathroom door, etc… When an item is about to finish, you just press the “ON” button and it will add the specific item to the shopping list. When any of the occupants visited a groceries shop, HA will automatically send the shopping list to his/her phone. When you have replenished the item, you just press the “OFF” button to remove it from the shopping list. Simple right?
Due to limitation of the new Shopping List component, I feel the best solution at the moment is to use input_boolean for each items in your shopping list. The idea is to turn on the input boolean if you want to add the item to your list and turn off if you want to remove it from the list.
Step 1: Create the input boolean for each items
# Items for shopping list
shoplist_coffee:
name: Coffee
icon: mdi:coffee
shoplist_milk:
name: Milk
icon: mdi:cow
shoplist_shampoo:
name: Shampoo
icon: mdi:cart
shoplist_egg:
name: Egg
icon: mdi:cart
shoplist_milo:
name: Milo
icon: mdi:cart
shoplist_toothpaste:
name: Tooth Paste
icon: mdi:cart
shoplist_toothbrush:
name: Tooth Brush
icon: mdi:cart
shoplist_facialfoam:
name: Facial Foam
icon: mdi:cart
shoplist_shaver:
name: Shaver
icon: mdi:cart
shoplist_shavingcream:
name: Shaving Cream
icon: mdi:cart
shoplist_bread:
name: Bread
icon: mdi:cart
shoplist_butter:
name: Butter
icon: mdi:cart
shoplist_jam:
name: Jam
icon: mdi:cart
shoplist_peanutbutter:
name: Peanut Butter
icon: mdi:cart
shoplist_cereal:
name: Cereal
icon: mdi:cart
shoplist_lettuce:
name: Lettuce
icon: mdi:cart
shoplist_tomato:
name: Tomato
icon: mdi:cart
shoplist_saladdressing:
name: Salad Dressing
icon: mdi:cart
shoplist_sausages:
name: Sausages
icon: mdi:cart
shoplist_nugget:
name: Nugget
icon: mdi:cart
Step 2: Add the input_boolean in a group. This group will be your shopping list
shopping_list:
name: Shopping List
entities:
- input_boolean.shoplist_coffee
- input_boolean.shoplist_milk
- input_boolean.shoplist_shampoo
- input_boolean.shoplist_egg
- input_boolean.shoplist_milo
- input_boolean.shoplist_toothpaste
- input_boolean.shoplist_toothbrush
- input_boolean.shoplist_facialfoam
- input_boolean.shoplist_shaver
- input_boolean.shoplist_shavingcream
- input_boolean.shoplist_bread
- input_boolean.shoplist_butter
- input_boolean.shoplist_jam
- input_boolean.shoplist_peanutbutter
- input_boolean.shoplist_cereal
- input_boolean.shoplist_lettuce
- input_boolean.shoplist_tomato
- input_boolean.shoplist_saladdressing
- input_boolean.shoplist_sausages
- input_boolean.shoplist_nugget
It will look something like this…
Step 3: Create a template sensor that will list down all the items that is turned on.
shoppinglist:
friendly_name: 'Shopping List'
value_template: >-
{% for entity in states.group.shopping_list.attributes.entity_id if is_state(entity, 'on') %}
- {{ states[entity.split('.')[0]][entity.split('.')[1]].name }}
{%- endfor %}
entity_id:
- input_boolean.shoplist_coffee
- input_boolean.shoplist_milk
- input_boolean.shoplist_shampoo
- input_boolean.shoplist_egg
- input_boolean.shoplist_milo
- input_boolean.shoplist_toothpaste
- input_boolean.shoplist_toothbrush
- input_boolean.shoplist_facialfoam
- input_boolean.shoplist_shaver
- input_boolean.shoplist_shavingcream
- input_boolean.shoplist_bread
- input_boolean.shoplist_butter
- input_boolean.shoplist_jam
- input_boolean.shoplist_peanutbutter
- input_boolean.shoplist_cereal
- input_boolean.shoplist_lettuce
- input_boolean.shoplist_tomato
- input_boolean.shoplist_saladdressing
- input_boolean.shoplist_sausages
- input_boolean.shoplist_nugget
Step 4: Create an automation that will turn on/off the items in shopping list when the buttons on the remote is pressed.
OK. Before that, you need to have an OpenMQTTGateway. If you haven’t build one, go to the link and follow the instruction. It is pretty easy.
Example automation for this item; Coffee
- alias: 'Add Coffee to the shopping list'
trigger:
- platform: mqtt
topic: home/433toMQTT
payload: 123456789
action:
service: input_boolean.turn_on
entity_id: input_boolean.shoplist_coffee
- alias: 'Remove Coffee to the shopping list'
trigger:
- platform: mqtt
topic: home/433toMQTT
payload: 234567891
action:
service: input_boolean.turn_off
entity_id: input_boolean.shoplist_coffee
Replace the payload number with the code from the “On” and “Off” buttons on the Coffee remote control. Repeat the above automation for other items.
Step 5: Send the shopping list to any occupants that has entered specific zones such as grocery shops.
For this to work, you need a device tracker component that has GPS data such as Owntracks or Zanzito. You also need to create the relevant zones and using a notification component that can be received by your phone such as Telegram. Once you have these ready, you can start to use this automation…
- alias: 'Track Anakin'
trigger:
- platform: state
entity_id: device_tracker.anakin_zanzito
to: 'Shop 1'
- platform: state
entity_id: device_tracker.anakin_zanzito
to: 'Shop 2'
- platform: state
entity_id: device_tracker.anakin_zanzito
to: 'Shop 3'
condition:
condition: state
entity_id: group.shopping_list
state: 'on'
action:
service: notify.anakin
data_template:
title: ""
message: "Hello Anakin. Since you are at {{ trigger.to_state.state }}, please buy these back... {{ states('sensor.shoppinglist') }}"
Ideas of modification on the remote control
- Custom made stickers to stick over the remote control front face. It can be colorful stickers with brand name like those from Amazon Dash Buttons. The “ON” label replace with “+” sign and the “OFF” label replace with “-” sign. It is totally up to your creativity.
- Stick a thin magnetic sheet such as this one http://amzn.to/2w21NdD at the back of the remote control so that it can stick on the fridge, metal cabinet or washing machine.
Crowdfunding
By default, every remotes transmit the same code. In order to customize the remote so that each remotes have unique code, the seller who is also the manufacturer can only fulfill that if I order at least 500 pieces. The price for each units remain at $1.35 USD/pc. However, the shipping will be free. Since I don’t need so many pieces, I am seeking anyone who sees value in this project to share the cost with me. I am looking for at most 10 people (incl myself) to share this order with me. That means, the minimum quantity each one must commit is 50 pieces which I think is reasonable. That is the average amount of my items in my monthly shopping list. I do not profit a single cent from this. Please see below for conversation I had with the seller…
So guys, lets make this happen especially for those who stays at places where there is no Amazon like myself.
Thank you in advance!