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
382 stars 90 forks source link

Blueprints not work #399

Closed blavak68 closed 2 years ago

blavak68 commented 2 years ago

Before you submit a new bug report, please check that

Describe the bug

after upgrading to version 4.7.7 or 4.7.8 blueprints = date entry and exclusion automation does not work they work correctly with version 4.7.6

Configuration

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.5.5",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.9.9",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Prague",
    "os_name": "Linux",
    "os_version": "5.15.38",
    "supervisor": "2022.05.2",
    "host_os": "Home Assistant OS 8.0",
    "docker_version": "20.10.14",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "version": "1.24.5",
      "requirements": [
        "aiogithubapi>=21.11.0"
      ]
    },
    "garbage_collection": {
      "version": "4.7.8",
      "requirements": [
        "python-dateutil>=2.8.2"
      ]
    }
  },
  "integration_manifest": {
    "domain": "garbage_collection",
    "name": "Garbage Collection",
    "version": "4.7.8",
    "documentation": "https://github.com/bruxy70/Garbage-Collection/",
    "issue_tracker": "https://github.com/bruxy70/Garbage-Collection/issues",
    "iot_class": "calculated",
    "dependencies": [],
    "config_flow": true,
    "codeowners": [
      "@bruxy70"
    ],
    "requirements": [
      "python-dateutil>=2.8.2"
    ],
    "is_built_in": false
  },
  "data": {
    "entity_id": "sensor.papier",
    "state": 2,
    "attributes": {
      "next_date": null,
      "days": null,
      "last_collection": "2022-05-03T12:54:00+02:00",
      "last_updated": null,
      "device_class": "garbage_collection__schedule"
    },
    "config_entry": {
      "entry_id": "f5aff8a830d70f3ff4779252372d45f0",
      "version": 5,
      "domain": "garbage_collection",
      "title": "Papier",
      "data": {
        "unique_id": "58ba0217-e673-4869-bf01-be6abf9c2b7a",
        "frequency": "group",
        "icon_normal": "mdi:trash-can",
        "icon_today": "mdi:delete-restore",
        "icon_tomorrow": "mdi:delete-circle",
        "entities": [
          "sensor.papier_1"
        ],
        "expire_after": "09:00",
        "manual_update": true
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": null,
      "disabled_by": null
    }
  }
}

Debug logs

Logger: custom_components.garbage_collection.sensor
Source: custom_components/garbage_collection/sensor.py:382
Integration: Garbage Collection (documentation, issues)
First occurred: 08:07:57 (2 occurrences)
Last logged: 08:07:57

2022-05-26 not removed from Papier 1 - not in the collection schedule
2022-06-30 not removed from Plasty 1 - not in the collection schedule

--------------------------------------------------------

Logger: custom_components.garbage_collection.sensor
Source: custom_components/garbage_collection/sensor.py:371
Integration: Garbage Collection (documentation, issues)
First occurred: 08:37:43 (2 occurrences)
Last logged: 08:37:43

2022-05-12 not added to Papier 1 - already on the collection schedule
2022-06-09 not added to Papier 1 - already on the collection schedule
bruxy70 commented 2 years ago

Can you please check, if the two dates you try to remove (2022-05-26 and 06-30) are in the schedule calculated by the integration (if you disable the manual update (you should also be able to see that from the logs)). And if the two dates you try to add (05-12 and 06-09) are not in the schedule? I cannot reproduce it from the provided configuration - it is a group, and I do not know the configuration of the individual entities in the group. So looking at the log should help. Also, do you only have one automation for the manual update? What sometimes happen is, people have two or more blueprints that try to add or remove the same date.

Finally, if you look in the calendar, does the schedule look all right, or not? The error message says that it cannot do that, since it was already done. So if the schedule looks all right, it would work technically, just a reminder that there is a redundant automation that does not do anything (for these 4 dates anyhow).

blavak68 commented 2 years ago

I already had a downgrade to version 4.7.6 (where everything works), but I went to version 4.7.8 again, it occurred to me to turn off the check box on entities = Manual update - sensor state updated manually by a service ( Blueprint) and after that all already running without error msg and the dates are in calendar correct, included with the corrections from Blueprint automations.

so: on version 4.7.6 it is necessary to have this check box on and on versions 4.7.7 / 4.7.8 it must be turned off

I just don't know if that was the intention -)))

obrázok

lots of thx for your interest

bruxy70 commented 2 years ago

I do not think it worked differently in the old version. It just did not display the message. Other than that, it should be the same. If you do not check the checkbox, then it does not call the blueprint (that's why it does not show the error I guess). So if everything works without the blueprint, then you do not need it I guess.

blavak68 commented 2 years ago

but when I turn off the automation blueprint, the dates are without the corrections that these automations do

obrázok

if I turn them on, the dates will be corrected

The above mentioned check box is off