bruxy70 / Garbage-Collection

🗑 Custom Home Assistant sensor for scheduling garbage collection (or other regularly re-occurring events - weekly on given days, semi-weekly or monthly)
MIT License
383 stars 90 forks source link

Migration off this integration since development is ending #462

Closed genebean closed 1 year ago

genebean commented 1 year ago

Before you submit a new bug report, please check that

Write your question here

I saw in the read me you are stopping work here since it’s not needed anymore… can you elaborate on how to replace this integration with the native bits?

bruxy70 commented 1 year ago

Hi. I made a video about that on my channel. There might be some advanced functionalities that might still need some love, and I am looking forward to see the community to take it to the next level.

genebean commented 1 year ago

Awesome! Mind sharing a link to your channel? So, I found the video (https://youtu.be/RpwAhy7f52I) and have one question: does your custom card work with the native bits or do I need to use a card like what’s in your video?

bruxy70 commented 1 year ago

https://www.youtube.com/@bruxy70

The custom card was made by someone else, I do not think it works with the local calendars, and no, you do not have to use the card like in my video.

genebean commented 1 year ago

Thanks! I looked at the card and it seems to rely mostly on the next_date attribute, so I took what you showed in your video and added that plus used some of what is on https://www.home-assistant.io/docs/configuration/templating/ to make for a way cleaner set of templates. The result is I have this in my config. I am still testing to verify it works as expected, but it sees like it will (today is trash day for me).

- sensor:
    - name: "Days until trash pickup"
      state: "{{ min((as_local(as_datetime(state_attr('calendar.trash_can', 'start_time'))) - today_at('00:00')).days, 2) }}"
      unit_of_measurement: "D"
      icon: mdi:trash-can
      attributes:
        days: "{{ (as_local(as_datetime(state_attr('calendar.trash_can', 'start_time'))) - today_at('00:00')).days }}"
        next_date: "{{ as_local(as_datetime(state_attr('calendar.trash_can', 'start_time'))).isoformat() }}"
genebean commented 1 year ago

@bruxy70 After removing your custom integration, there is still an entity for the calendar that it created that I can't seem to find where to delete... any tips on how to clean this up would be greatly appreciated as looking in the UI doesn't seem to be working.

Screenshot from 2023-04-27 09-45-31

Screenshot from 2023-04-27 09-45-20

bruxy70 commented 1 year ago

You should find them in helpers. The second message is interesting, they should have an entity ID and should be able to be removed from UI. Except for the old versions, where the configuration was in the YAML. But I suppose you already removed that after they were migrated to the UI config flow.

genebean commented 1 year ago

I never had any yaml config… the custom integration was only installed for a couple of days before I found the deprecation info. I don’t have any helpers remaining for garbage - I’m fairly sure there was one I’d already deleted though.

sstarkey12 commented 1 year ago

@genebean I had this same problem. I fixed it by creating a Local Calendar with the same name and then deleting it. It's gone from the HA Calendar tab now. Not sure what was going on there but that seems to have fixed it.

MicheleMercuri commented 1 year ago

Just migrated from garbage-collection to local calendar, it seems all works fine for me (just added template for collection “in {n} days” / “Today” / “Tomorrow” + picture elements card with state image blink/color/gray):

sensors garbage

# new garbage package
template:
# Organico
  - sensor:
      - name: "Organico Calendar"
        state: "{{ min((as_local(as_datetime(state_attr('calendar.umido', 'start_time'))) - today_at('00:00')).days, 2) }}"
        unique_id: organico_calendar
        unit_of_measurement: "D"
        icon: mdi:trash-can
        attributes:
          days: "{{ (as_local(as_datetime(state_attr('calendar.umido', 'start_time'))) - today_at('00:00')).days }}"
          next_date: "{{ as_local(as_datetime(state_attr('calendar.umido', 'start_time'))).isoformat() }}"
  - sensor:
      - name: "Organico"
        unique_id: organico
        state: >-
          {% set days = state_attr('sensor.organico_calendar','days') %}
          {% if days == 0 %}
            Oggi!
          {% elif days == 1 %}
            Domani
          {% else %}
            Tra {{ days }} Giorni
          {% endif %}

picture elements card code

type: picture-elements
image: /local/garbage/blank.jpg
elements:
  - type: image
    title: Organico
    entity: sensor.organico
    image: /local/garbage/umido1_g2.jpg
    state_image:
      Domani: /local/garbage/umido11.jpg
      Oggi!: /local/garbage/umido_anim.gif
    style:
      left: 50%
      top: 50%
      width: 103%
  - type: state-label
    entity: sensor.organico
    style:
      color: white
      left: 50%
      top: 89.5%
      width: 100%
      font-size: 120%
      text-align: center
  - type: state-label
    entity: sensor.umido_fake
    style:
      color: white
      left: 50%
      top: 10%
      width: 100%
      font-size: 120%
      text-align: center

Immagine 2023-05-02 155203

Immagine 2023-05-02 155518

Many thanks @ all. Regards.

derjoerg commented 1 year ago

First of all: Thanks for this wonderful component. Second: Please keep it running till your component can be 100% replaced :)

I heavily use your component together with the blueprint to move an event if there is a public holiday and it is just a no-brainer, it just works.

Till now I haven't found a way to implement the same functionality directly in HA.

My use-case:

Joerg

I3lackshirts commented 1 year ago

@derjoerg I have the same problem and was one of the best features. It may help you, but I actually didn't find it to difficult to manually go through the holidays in one go. The calendar card makes it very easy to see the holiday weeks and shift the events yourself. Not a "set it and forget it" solution as it was before but could buy you time as another solution is worked on or more features get added to local calendars and automations.

I understand why its being discontinued after watching the YT video and think this will ultimately be the better option going forward. Hopefully something better gets developed soon!

Scepticalist commented 1 year ago

Just migrated from garbage-collection to local calendar, it seems all works fine for me (just added template for collection “in {n} days” / “Today” / “Tomorrow” + picture elements card with state image blink/color/gray):

sensors garbage

# new garbage package
template:
# Organico
  - sensor:
      - name: "Organico Calendar"
        state: "{{ min((as_local(as_datetime(state_attr('calendar.umido', 'start_time'))) - today_at('00:00')).days, 2) }}"
        unique_id: organico_calendar
        unit_of_measurement: "D"
        icon: mdi:trash-can
        attributes:
          days: "{{ (as_local(as_datetime(state_attr('calendar.umido', 'start_time'))) - today_at('00:00')).days }}"
          next_date: "{{ as_local(as_datetime(state_attr('calendar.umido', 'start_time'))).isoformat() }}"
  - sensor:
      - name: "Organico"
        unique_id: organico
        state: >-
          {% set days = state_attr('sensor.organico_calendar','days') %}
          {% if days == 0 %}
            Oggi!
          {% elif days == 1 %}
            Domani
          {% else %}
            Tra {{ days }} Giorni
          {% endif %}

picture elements card code

type: picture-elements
image: /local/garbage/blank.jpg
elements:
  - type: image
    title: Organico
    entity: sensor.organico
    image: /local/garbage/umido1_g2.jpg
    state_image:
      Domani: /local/garbage/umido11.jpg
      Oggi!: /local/garbage/umido_anim.gif
    style:
      left: 50%
      top: 50%
      width: 103%
  - type: state-label
    entity: sensor.organico
    style:
      color: white
      left: 50%
      top: 89.5%
      width: 100%
      font-size: 120%
      text-align: center
  - type: state-label
    entity: sensor.umido_fake
    style:
      color: white
      left: 50%
      top: 10%
      width: 100%
      font-size: 120%
      text-align: center

Immagine 2023-05-02 155203

Immagine 2023-05-02 155518

Thanks for posting this, but it's absolutely crazy that you now need a separate local calendar for each garbage type instead of one calendar for all rubbish collections.

bschatzow commented 1 year ago

@Scepticalist Did you create sensors for each type of collection (waste, recycle, etc.)?

Scepticalist commented 1 year ago

Cant see any way of creating a single calendar, then have states that show number of days until each different event. Seems to only be able to show time until the next event.

This is what I had under this now discontinued integration: image

image

broyuken commented 1 year ago

I think I am going to have to stick with the custom integration rather than this calendar hack. The integration has many features that the calendar simply cannot do, at least not easily if at all. Such as the holidays, countdown until the next event, etc. Hopefully this will not break with a future update, or if it does someone can fork it and keep it alive. If not I'll have to learn to code ;)

jrb80 commented 1 year ago

@genebean I had this same problem. I fixed it by creating a Local Calendar with the same name and then deleting it. It's gone from the HA Calendar tab now. Not sure what was going on there but that seems to have fixed it.

Thanks, I was trying to manually remove the calendar through the backend without success and you solved it for me!

CDRX2 commented 1 year ago

I just followed the video and moved to the local calendar. It is not very difficult to do, but I too am missing the skip holidays automation part. Anyone figured something out?

broyuken commented 1 year ago

Yea stick with the integration :)

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had any activity in last 30 days. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.