Advertisement
Guest User

Home Assistant Waste Schedule

a guest
Apr 12th, 2024
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.12 KB | Source Code | 0 0
  1. Sensor:
  2. # Removed a whole lot of unrealted config from configuration.yaml #
  3.  
  4. #
  5. # Waste Collection Sensors from Schedule
  6. #
  7.     - platform: waste_collection_schedule
  8.       name: rubbish_days
  9.       details_format: appointment_types
  10.       value_template: "{{ value.daysTo }}"
  11.       types:
  12.        - rubbish
  13.     - platform: waste_collection_schedule
  14.       name: recycle_days
  15.       details_format: appointment_types
  16.       value_template: "{{ value.daysTo }}"
  17.       types:
  18.        - recycle
  19.     - platform: waste_collection_schedule
  20.       name: food-waste_days
  21.       details_format: appointment_types
  22.       value_template: "{{ value.daysTo }}"
  23.       types:
  24.        - food-waste
  25.  
  26. #
  27. # Love-lace Card
  28. #
  29.  
  30. type: custom:button-card
  31. entity: sensor.rubbish_days
  32. layout: icon_name_state2nd
  33. tap_action:
  34.   action: call-service
  35.   service: input_number.decrement
  36.   service_data:
  37.     entity_id: input_number.rubbish_counter
  38. double_tap_action:
  39.   action: call-service
  40.   service: input_number.increment
  41.   service_data:
  42.     entity_id: input_number.rubbish_counter
  43. show_label: true
  44. label: |
  45.  [[[
  46.     var days_to = entity.state
  47.     if (days_to == 0)
  48.     { return "Today" }
  49.     else if (days_to == 1)
  50.     { return "Tomorrow" }
  51.     else if (days_to == "unknown")
  52.     { return "TBA" }
  53.     else
  54.     { return "in " + days_to + " days" }
  55.   ]]]
  56. show_name: true
  57. name: Rubbish
  58. icon: |
  59.  [[[
  60.   if (states["input_number.rubbish_counter"].state == 1)
  61.   { return "mdi:check-bold" }
  62.   else
  63.   { return entity.attributes.icon }
  64.   ]]]
  65. state:
  66.   - color: red
  67.     operator: template
  68.     value: '[[[ return states["input_number.rubbish_counter"].state == 2 ]]]'
  69.     styles:
  70.       icon:
  71.         - animation: blink 1s ease infinite
  72.   - color: '#1aba92'
  73.     operator: template
  74.     value: '[[[ return states["input_number.rubbish_counter"].state == 1 ]]]'
  75.   - color: red
  76.     operator: template
  77.     value: '[[[ return entity.state == 0 ]]]'
  78.   - color: orange
  79.     operator: template
  80.     value: '[[[ return entity.state == 1 ]]]'
  81.   - value: default
  82.   - operator: template
  83.     value: '[[[ return entity.state > 1 ]]]'
  84.     color: '#aaaaaa'
  85.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement