[UK] Looking for a beginner friendly tutorial on displaying when bins go out

Not sure it’ll be much help as it’s calculated from a rest sensor from my councils website, it returns a date. This is the template sensor

{% set x = states('sensor.date_time') %}
{% set next = state_attr('sensor.eyrc_bin_days', 'GreenDate') %}
{% if next != 'unknown' and next != '' %}
  {% set diff = as_timestamp(next, 0) - as_timestamp(now(), 0) %}
  {% if ((diff / 86400)+1) < 0 %}
    {% set days = 15 %}
  {% else %}
    {% set days = ((diff / 86400)+1) | int(0) %}
  {% endif %}  
  {{ days }}
{% else %}
  Failed to Update
{% endif %}

thank you for the code… based on it I made a sensor that collects data from the calendar.

1 Like

Complete novice here. What do I type into the json to match bin type for colour section during the set up?

HI, not sure what you mean. There should be individual sensors for each bin type setup in the integration

I got this working with the UK Bins integration, I added the configs to their repo Bin display · robbrad/UKBinCollectionData · Discussion #1677 · GitHub

1 Like