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

Recycle Week Between Sensors Not Matching #2

Open
memphisraynz opened this issue Dec 5, 2024 · 8 comments
Open

Recycle Week Between Sensors Not Matching #2

memphisraynz opened this issue Dec 5, 2024 · 8 comments

Comments

@memphisraynz
Copy link

The two sensors have been setup.
The Recycle bin in Brisbane Bin Day, reports the Recycle as False, but under the Recycle sensor it reports true.
I have confirmed my address and zone, the API is reporting the correct data.
https://data.brisbane.qld.gov.au/api/explore/v2.1/catalog/datasets/waste-collection-days-collection-weeks/records?where=week_starting%20=%20date%272024-12-02%27%20AND%20search(zone,%20%271%27)

Tomorrow, Friday is my Bin day and should be recycling, which matches above.

@mark1foley
Copy link
Owner

mark1foley commented Dec 5, 2024 via email

@memphisraynz
Copy link
Author

Hi copy of my sensor config
- platform: bne_wc name: Brisbane Bin Day scan_interval: 300 base_url: https://www.data.brisbane.qld.gov.au/api/explore/v2.1/catalog/datasets/{dataset_id}/records?where={query}&limit=1 days_table: waste-collection-days-collection-days weeks_table: waste-collection-days-collection-weeks property_number: 454726

not sure if the api results have change
{ "total_count": 1, "results": [ { "week_starting": "2024-12-02", "zone": "Zone 1" } ] }

@mark1foley
Copy link
Owner

mark1foley commented Dec 5, 2024

Hi, I added your property number (454726) to my config and it looks to be working ok. Here are the sensor attributes.

sensor.brisbane_bin_day
Alert Hours: 12
Property Number: 454726
Suburb: XXXXXX
Street: XXXXXXXX
House Number: XXXXXX
Collection Day: FRIDAY
Collection Zone: ZONE 1
Next Collection Date: "2024-12-13T00:00:00"
Extra Bin: ""
Due In: 159
Recycle Week: false
icon: mdi:trash-can
friendly_name: Brisbane Bin Day

sensor.brisbane_bin_day_recycle
Alert Hours: 12
Property Number: 454726
Suburb: XXXXX
Street: XXXXX
House Number: XXX
Collection Day: FRIDAY
Collection Zone: ZONE 1
Next Collection Date: "2024-12-20T00:00:00"
Extra Bin: Yellow/Recycling
Due In: 327
Recycle Week: true
icon: mdi:recycle
friendly_name: Brisbane Bin Day (Recycle)

So it looks to be working ok to me as it matches the calendar in the BCC app

20241205_232530000_iOS

Are you getting different results to this?

@memphisraynz
Copy link
Author

Hi,
I am sure the results I was getting differed. The problem is I only remembered to take screenshots this morning so they don't show the data as of last night.

Is there a way in the config to continue to report today (bin day) as this week.
My bin day is Friday, and at a minimum Recycling was correct on Thursday. It was reporting what Bin was due for this week, but on Bin day, it switched the results to next week.
For me if I forget to put the bins out on Thursday and do it Friday morning, the sensor would show what I should do for the next week.

@mark1foley
Copy link
Owner

Hi, so is the issue that your bin gets collected later in the day on collection day? My bin gets collected at silly o'clock so I didn't really think about that when writing it. I guess I could add a "Collection Hour" configuration item and instead of setting the collection date to midnight on collection day it would use the hour specified. That would stop the sensor flicking over to the next week until the specified hour is reached on "bin day". The "Due In" would also be the number of hours until the specified hour instead of midnight. Would that work for you?

@memphisraynz
Copy link
Author

Honestly, it may be that I just had different expectations from that the sensor was showing.

When i first put the sensor in, it was the day before Bin day. The recycing sensor show everything correct.

The main sesnor had
Next Collection Date: "2024-12-13" (where the next collection date for my bins was the 6th, but I'm gusseing this is next collection for the bin underneath.)
Extra Bin: "Green/Garden"
Recycle Week: false ( this also threw me, as I thought this being the main sensor it should show true, becuase tomorrow was recycling)

As I see it now, its really two sesnors, one for the Green bin and another for the Yellow bin.

I did end up playing with the code to put in an Offset, to push the time the bins are "collected" at.

@mark1foley
Copy link
Owner

mark1foley commented Dec 6, 2024 via email

@memphisraynz
Copy link
Author

Hi,
I forked your repository as I wasn't sure if these changes really just suited me.
https://github.com/memphisraynz/Brisbane-Bin-Day-Sensor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants