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

Defective schedule entity can not be removed #384

Open
m4v3r1ck1 opened this issue Oct 26, 2024 · 5 comments
Open

Defective schedule entity can not be removed #384

m4v3r1ck1 opened this issue Oct 26, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@m4v3r1ck1
Copy link

m4v3r1ck1 commented Oct 26, 2024

Screenshot 2024-10-26 at 11 20 00 Screenshot 2024-10-26 at 11 20 25 Screenshot 2024-10-26 at 11 20 34
@m4v3r1ck1 m4v3r1ck1 added the bug Something isn't working label Oct 26, 2024
@hacscred
Copy link

This is a Home Assistant bug, I think. It's not specific to this integration.

home-assistant/core#11533 wanted an API to do this, which was shot down for a user hostile reason. The author of the RFC implemented an integration to allow deleting any entity, which if you install it, will also solve your problem.

@nielsfaber
Copy link
Owner

The scheduler integration offers a service scheduler.remove for manually removing schedules that cannot be displayed by scheduler card.

Note that a schedule only becomes defective in case of user error where no timepoints can be calculated, e.g. configuring it to only repeat on Wednesdays and at the same time to only occur on 26/10/2024 which is an impossible combination. Can also be avoided by yourself.

@hacscred
Copy link

The scheduler integration offers a service scheduler.remove for manually removing schedules that cannot be displayed by scheduler card.

Note that a schedule only becomes defective in case of user error where no timepoints can be calculated, e.g. configuring it to only repeat on Wednesdays and at the same time to only occur on 26/10/2024 which is an impossible combination. Can also be avoided by yourself.

Depending on who you want to use this, I can tell from experience that non-developers with a graduate technical degree can't follow such instructions out of laziness or stupidity.

I don't know the reason for the concept of defective schedules to exist, but just displaying a message once every week with a link to some explanation seems better than bringing people to despair (opening such an issue is basically that). A schedule which would never run is an input validation issue and should just be tackled at the time of input. I think making it impossible to create defective schedules should be how it should work.

I was able to figure it (using the remove call) out in minutes when I had the issue. Getting it to work programmatically with unknown entities was much more involved, but was needed during development.

I make heavy use of the remove API call, because I compute almost all schedules from external data. I literally don't even know when things go on and off. (I suppose I should add some cyber resilience to it, because switching lights 600 times per day is not exactly good for the electronics. It would be a fairly good attack vector for an adversary to destabilize the grid at scale. So, I would suggest you add both default jitter (I think you already do that) and a maximum number of actions per schedule and perhaps even in total, unless someone specifically configures some option to not limit it or set another limit. Crossing the limit could also act as a kind of tripwire. Perhaps something like it could be generalized for Home Assistant in general as well. )

(I think Home Assistant developers don't want people to do high quality stable deployments of Home Assistant in order to make their products more enticing. Kind of annoying. I hope a true community fork will happen someday. )

@m4v3r1ck1
Copy link
Author

m4v3r1ck1 commented Oct 26, 2024

scheduler.remove

How can I trigger this service? I can not directly find any service in the integration which I could trigger.
Screenshot 2024-10-26 at 13 19 32
Screenshot 2024-10-26 at 13 19 52

@hacscred
Copy link

Under Developer tools, actions.

(Such simple questions can also be answered by LLMs. )

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

No branches or pull requests

3 participants