Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sensor:
- # Removed a whole lot of unrealted config from configuration.yaml #
- #
- # Waste Collection Sensors from Schedule
- #
- - platform: waste_collection_schedule
- name: rubbish_days
- details_format: appointment_types
- value_template: "{{ value.daysTo }}"
- types:
- - rubbish
- - platform: waste_collection_schedule
- name: recycle_days
- details_format: appointment_types
- value_template: "{{ value.daysTo }}"
- types:
- - recycle
- - platform: waste_collection_schedule
- name: food-waste_days
- details_format: appointment_types
- value_template: "{{ value.daysTo }}"
- types:
- - food-waste
- #
- # Love-lace Card
- #
- type: custom:button-card
- entity: sensor.rubbish_days
- layout: icon_name_state2nd
- tap_action:
- action: call-service
- service: input_number.decrement
- service_data:
- entity_id: input_number.rubbish_counter
- double_tap_action:
- action: call-service
- service: input_number.increment
- service_data:
- entity_id: input_number.rubbish_counter
- show_label: true
- label: |
- [[[
- var days_to = entity.state
- if (days_to == 0)
- { return "Today" }
- else if (days_to == 1)
- { return "Tomorrow" }
- else if (days_to == "unknown")
- { return "TBA" }
- else
- { return "in " + days_to + " days" }
- ]]]
- show_name: true
- name: Rubbish
- icon: |
- [[[
- if (states["input_number.rubbish_counter"].state == 1)
- { return "mdi:check-bold" }
- else
- { return entity.attributes.icon }
- ]]]
- state:
- - color: red
- operator: template
- value: '[[[ return states["input_number.rubbish_counter"].state == 2 ]]]'
- styles:
- icon:
- - animation: blink 1s ease infinite
- - color: '#1aba92'
- operator: template
- value: '[[[ return states["input_number.rubbish_counter"].state == 1 ]]]'
- - color: red
- operator: template
- value: '[[[ return entity.state == 0 ]]]'
- - color: orange
- operator: template
- value: '[[[ return entity.state == 1 ]]]'
- - value: default
- - operator: template
- value: '[[[ return entity.state > 1 ]]]'
- color: '#aaaaaa'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement