Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Days in the future issue #274

Closed
2 tasks done
Kevin-Kusters opened this issue Mar 28, 2024 · 5 comments · Fixed by #281
Closed
2 tasks done

[Bug]: Days in the future issue #274

Kevin-Kusters opened this issue Mar 28, 2024 · 5 comments · Fixed by #281
Labels
bug Something isn't working

Comments

@Kevin-Kusters
Copy link

Kevin-Kusters commented Mar 28, 2024

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

Hi,

I have installed this great card but for some reason the days in the future option doesn't work as intended.
I have set the days in the future to 1 but it shows a calendar event that is 2 days in the future. (See attached screenshot).

Yesterday it was Wednesday 27-3 and the garbage pick up event is on Saturday 30-3. But the card was already visible on the 27th while the days in the future is set to 1.

Any idea how to solve this?
Schermafbeelding 2024-03-28 om 12 14 43

Expected Behavior

Be hidden until 1 day before the pickup (calendar event)

Steps To Reproduce

No response

Context

YAML state

type: custom:trash-card
entities:
  - calendar.afvalbeheer_rd4
items_per_row: 1
refresh_rate: 60
with_label: true
filter_events: true
hide_time_range: false
full_size: false
use_summary: false
event_grouping: true
drop_todayevents_from: '10:00:00'
next_days: 1
pattern:
  - icon: mdi:delete-empty
    color: light-green
    type: organic
    label: Huisvuilophaling GFT
    pattern: GFT
  - icon: mdi:delete-empty
    color: light-green
    type: paper
    pattern: Papier
    label: Huisvuilophaling papier
  - icon: mdi:delete-empty
    color: light-green
    type: recycle
    label: ' Huisvuilophaling PMD'
    pattern: PMD
  - icon: mdi:delete-empty
    color: light-green
    type: waste
    label: Huisvuilophaling restafval
    pattern: Restafval
  - icon: mdi:dump-truck
    color: purple
    type: others


Environment

- Browser: Safari, Chrome and HA companion app on iOS and Android
- HA version: 
Core 2024.3.3
Supervisor 2024.03.1
Operating System 12.1
Frontend 20240307.0
- TrashCard: 2.1.0

Debug data

No response

Anything else?

No response

@Kevin-Kusters Kevin-Kusters added the bug Something isn't working label Mar 28, 2024
@idaho
Copy link
Owner

idaho commented Mar 28, 2024

Hey @Kevin-Kusters could you please post the debug output?
Add only

debug: true

to the card configuration and you will see the debug data.

@Kevin-Kusters
Copy link
Author

Kevin-Kusters commented Mar 29, 2024

Test – Home Assistant.pdf
Hi @idaho, thank you for you quick response.

I have added the debug line. I see a copy debug log button but that doesn't seem to work. So I attached the debug log as a PDF.

@snigehere
Copy link

snigehere commented Mar 30, 2024

I am getting the same issue - I run two calendars one is a manually maintained calendar, the second is a calendar maintained by the waste collection schedule where it pulls records from my council system.

Its Saturday 30th March today I have two bin collections on monday 1st April - the refuse bin, pulled from the waste collection maintained calendar and the second, food waste bin, which is from a manual calendar.

It may not be significant but the manual one works as expected, the entry in the waste collection schedule integration is not correct.

Sorry for the edits here - I needed to clean up what I posted .. adding a picture
Snap26

This shows three cards with titles to show what I see .. as you see the dates are correct, the icon card shows the collections are both two days in advance

Here are two debug logs
First the debug feature is great however as mentioned the copy button does not copy it to the clipboard. I expanded all the sections (I hope) and copy pasted it.

The first debug log shows with the integration set to 1 day in advance it shows the refuse bin as due on 1st April but is already displayed

log 1

Waste collections
DEBUG LOG
timezone
"+00:00"
calendar data
[
{
"start": {
"date": "2024-04-01"
},
"end": {
"date": "2024-04-02"
},
"summary": "refuse bin",
"description": null,
"location": null,
"uid": null,
"recurrence_id": null,
"rrule": null,
"entity": "calendar.portsmouth_city_council"
}
]
normaliseEvents
[
{
"date": {
"start": "2024-04-01T00:00:00.000Z",
"end": "2024-04-02T00:00:00.000Z"
},
"isWholeDayEvent": true,
"content": {
"summary": "refuse bin",
"description": null,
"location": null,
"uid": null,
"recurrence_id": null,
"rrule": null,
"entity": "calendar.portsmouth_city_council"
}
}
]
dropAfter
true
now
"2024-03-30T11:39:49.388Z"
activeElements
[
{
"date": {
"start": "2024-04-01T00:00:00.000Z",
"end": "2024-04-02T00:00:00.000Z"
},
"isWholeDayEvent": true,
"content": {
"summary": "refuse bin",
"description": null,
"location": null,
"uid": null,
"recurrence_id": null,
"rrule": null,
"entity": "calendar.portsmouth_city_council"
}
}
]
eventsToItems
[
{
"date": {
"start": "2024-04-01T00:00:00.000Z",
"end": "2024-04-02T00:00:00.000Z"
},
"isWholeDayEvent": true,
"content": {
"summary": "refuse bin",
"description": null,
"location": null,
"uid": null,
"recurrence_id": null,
"rrule": null,
"entity": "calendar.portsmouth_city_council"
},
"icon": "mdi:trash-can-outline",
"color": "white",
"type": "waste",
"label": "Black bin",
"pattern": "refuse bin",
"idx": 3
}
]

Log 2
For this second log I have changed the "days to display" to 2 and both entities show correctly, I included it for the purpose of compare

DEBUG LOG
timezone
"+00:00"
calendar data
[
{
"start": {
"date": "2024-04-01"
},
"end": {
"date": "2024-04-02"
},
"summary": "refuse bin",
"description": null,
"location": null,
"uid": null,
"recurrence_id": null,
"rrule": null,
"entity": "calendar.portsmouth_city_council"
},
{
"start": {
"date": "2024-04-01"
},
"end": {
"date": "2024-04-02"
},
"summary": "food waste bin",
"description": "",
"location": null,
"uid": "removed when posted",
"recurrence_id": "20240401",
"rrule": "FREQ=WEEKLY;BYDAY=MO",
"entity": "calendar.home_assistant_calendar"
}
]
normaliseEvents
[
{
"date": {
"start": "2024-04-01T00:00:00.000Z",
"end": "2024-04-02T00:00:00.000Z"
},
"isWholeDayEvent": true,
"content": {
"summary": "refuse bin",
"description": null,
"location": null,
"uid": null,
"recurrence_id": null,
"rrule": null,
"entity": "calendar.portsmouth_city_council"
}
},
{
"date": {
"start": "2024-04-01T00:00:00.000Z",
"end": "2024-04-02T00:00:00.000Z"
},
"isWholeDayEvent": true,
"content": {
"summary": "food waste bin",
"description": "",
"location": null,
"uid": "removed when posted",
"recurrence_id": "20240401",
"rrule": "FREQ=WEEKLY;BYDAY=MO",
"entity": "calendar.home_assistant_calendar"
}
}
]
dropAfter
true
now
"2024-03-30T11:41:06.777Z"
activeElements
[
{
"date": {
"start": "2024-04-01T00:00:00.000Z",
"end": "2024-04-02T00:00:00.000Z"
},
"isWholeDayEvent": true,
"content": {
"summary": "refuse bin",
"description": null,
"location": null,
"uid": null,
"recurrence_id": null,
"rrule": null,
"entity": "calendar.portsmouth_city_council"
}
},
{
"date": {
"start": "2024-04-01T00:00:00.000Z",
"end": "2024-04-02T00:00:00.000Z"
},
"isWholeDayEvent": true,
"content": {
"summary": "food waste bin",
"description": "",
"location": null,
"uid": "removed when posted",
"recurrence_id": "20240401",
"rrule": "FREQ=WEEKLY;BYDAY=MO",
"entity": "calendar.home_assistant_calendar"
}
}
]
eventsToItems
[
{
"date": {
"start": "2024-04-01T00:00:00.000Z",
"end": "2024-04-02T00:00:00.000Z"
},
"isWholeDayEvent": true,
"content": {
"summary": "refuse bin",
"description": null,
"location": null,
"uid": null,
"recurrence_id": null,
"rrule": null,
"entity": "calendar.portsmouth_city_council"
},
"icon": "mdi:trash-can-outline",
"color": "white",
"type": "waste",
"label": "Black bin",
"pattern": "refuse bin",
"idx": 3
},
{
"date": {
"start": "2024-04-01T00:00:00.000Z",
"end": "2024-04-02T00:00:00.000Z"
},
"isWholeDayEvent": true,
"content": {
"summary": "food waste bin",
"description": "",
"location": null,
"uid": "removed when posted",
"recurrence_id": "20240401",
"rrule": "FREQ=WEEKLY;BYDAY=MO",
"entity": "calendar.home_assistant_calendar"
},
"label": "Food Waste",
"icon": "mdi:silverware-variant",
"color": "grey",
"type": "custom-5",
"pattern": "Food waste bin",
"idx": 5
}
]

@idaho
Copy link
Owner

idaho commented Apr 2, 2024

Really strange bug. I think there is a small possible issue in the calender api from home-assistant. Like you see we get those entries even if the start and end date are set correct. I now filter them manually.

@Kevin-Kusters
Copy link
Author

I see you changed some things. If I am correct it now calculates back from the event end.

What do I need to do to get this fixed? I don't see a Trashcard update in HACS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants