Closed a323870 closed 2 years ago
Not sure what's the issue, looks all right. The automation is triggered when the entity is recalculated, and it has blank frequency, so it should not contain any dates - so there should be no conflicts. Did you try the include blueprint? It does exactly the same. https://github.com/bruxy70/Garbage-Collection#include-and-exclude Or you can check the automation in the debug to see when it is called, and if it is called with any dates already added in. Is it only called once? Are you sure you do not have another automation that does the same? It basically says that you are trying to add a date that has already been added previsly. So I guess the date is in, the question is why is it trying to add it multiple times...
My hypothesis is that at the change of the day for the sensors with "blank" frequency the dates are not reset. In my automation I have 8 garbage sensors, three of which are manually updated. Two are "blank" and one "every-n-weeks" For these sensors I have created automation with "garbage_collection_loaded" event. The sensor with "every-n-weeks" frequency adds the dates when the day changes without mistakes, while the two with "blank" report the date error already present.
For verification I activated the DEBUG and restarted HA. The automations are called up at start-up at 2:00 pm without mistakes and at the change of day at 00:00 with error for sensor "blank"
In the docx details and debug log.
Tanks for any idea Garbage.docx .
Thanks. I have configured that, will see what it does at night. In the meantime, whilst you are in the debug, can you go to Changed Variable and tell me what is in the trigger/event/data/collection_dates. This should show the "calculated" dates that the automation is changing. And since this is "blank", the list should be empty. And I suppose it is not - this is why it reports that the date already exists...
For Ecomobile, "blank"
this: entity_id: automation.veritas_date_aggiuntive_ecomobile state: 'on' attributes: last_triggered: '2022-04-19T12:01:28.858070+00:00' mode: single current: 0 id: veritas_date_aggiuntive_ecomobile friendly_name: Veritas Date Aggiuntive Ecomobile last_changed: '2022-04-19T12:01:08.879366+00:00' last_updated: '2022-04-19T12:01:28.929129+00:00' context: id: 5aa899c2ea9bfeb187899083935538b3 parent_id: 8171e7b4cd022cfbbf753f216a17a3e3 user_id: null trigger: id: '0' idx: '0' platform: event event: event_type: garbage_collection_loaded data: entity_id: sensor.veritas_ecomobile collection_dates:
for "verde" there are caluculated date and not the included date 2022-01-17, 2022-02-21, 2022-12-30
this: entity_id: automation.veritas_date_aggiuntive_verde state: 'on' attributes: last_triggered: '2022-04-19T12:01:28.856670+00:00' mode: single current: 0 id: veritas_date_aggiuntive_verde friendly_name: Veritas Date Aggiuntive Verde last_changed: '2022-04-19T12:01:08.878941+00:00' last_updated: '2022-04-19T12:01:28.897207+00:00' context: id: b01cbada684f2b8890cedae2cb55e508 parent_id: 4a136db018ccbae9adc1870fcda64c08 user_id: null trigger: id: '0' idx: '0' platform: event event: event_type: garbage_collection_loaded data: entity_id: sensor.veritas_verde_ramaglie collection_dates:
could it be given by utc and local time?
I can confirm that I did observe the same issue in testing. Looking for the cause...
Confirm, New version of sensor.py resolve the problem. Tanks.
Before you submit a new bug report, please check that
Describe the bug
Thanks for this addon which I enjoyed very much. I created a sensor with blank frequency, manual update and related automation to add dates. At the run of the new day I get date error already present.
No error when restart ha and the date is addesd.
Am I wrong something? Thanks.
My automation is :
Configuration
Debug logs