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

Define number of scan cycles before device is marked as offline/down #587

Closed
1 task done
AdmiralRaccoon opened this issue Mar 12, 2024 · 6 comments
Closed
1 task done
Labels
Feature request➕ New feature or request Workaround provided ⚒️ A workaround for the issue was provided so no further actions will be taken.

Comments

@AdmiralRaccoon
Copy link

AdmiralRaccoon commented Mar 12, 2024

Is there an existing issue for this?

  • I have searched the existing open and closed issues

Is your feature request related to a problem? Please describe

I have some devices (A switch, some shelly devices), which for what reason doesn´t seem to respond during a scan and get marked as offline/down, although they´re online

Describe the solution you'd like

A device setting that allows to define a value after how many scan cycles the device becomes offline/down

Describe alternatives you've considered

edit: Or, maybe something similar to home assistant´s "consider home", a period of time that must pass without reaching the device, to set it as offline/down

Anything else?

@AdmiralRaccoon AdmiralRaccoon added the Feature request➕ New feature or request label Mar 12, 2024
@jokob-sk
Copy link
Owner

Hi @AdmiralRaccoon ,

Thanks for the suggestion! From what you are describing these devices are unmovable so once detected their online status is not that important.

There is a setting for down devices already, which should enable you to achieve the described scenario for down notifications:

image

You could theoretically ignore the devices via the NTFPRCS_event_condition setting for offline notifications.

Another alternative is to mark specific devices as Scan device: NO via one of these settings:

image

BTW: There is a mass-edit functionality coming in the next release so marking multiple devices will be easier. You can test the pi.alert_dev container if interested.

Happy to hear your thoughts. I could implement a similar offline detection mechanism for down notifications, but I want to avoid overcomplicating the logic if you can cater to your use case with the existing configuration options.

Thanks,
j

@jokob-sk jokob-sk added the Waiting for reply⏳ Waiting for the original poster to respond, or discussion in progress. label Mar 12, 2024
@AdmiralRaccoon
Copy link
Author

Thanks for the reply, I should have read the docs more carefully! :-D
I will test it asap

@AdmiralRaccoon
Copy link
Author

AdmiralRaccoon commented Mar 13, 2024

Another thing...would it be possible to make the "Alert down after" a per device setting? For some devices, 10-15min is great, but for others 5 minutes would be better to trigger automations in Home Assisant for example.

@jokob-sk
Copy link
Owner

Hey there!

I don't plan to extend the functionality to a per-device setting as it would require DB changes, thus changing the CSV export import functionality, the device columns and the columns ordering and picker, and the dependent plugin. So, even if the changes might look small, the downflow effect is pretty significant.

You can list your exact use case in the Workflows feedback issue and I might consider it for a custom workflow scenario: https://github.com/jokob-sk/Pi.Alert/issues/562

You could also move that logic into HA, e.g. have a list of devices that you want to trigger automation right away and some that have a wait timer (e.g. based on the device name based on some naming convention).

Or you could have a middle layer via n8n/nodeRed to cater to more advanced automation needs: https://github.com/jokob-sk/Pi.Alert/blob/main/docs/WEBHOOK_N8N.md

Hope the above gives you some ideas.

Thanks,
j

@jokob-sk jokob-sk added Workaround provided ⚒️ A workaround for the issue was provided so no further actions will be taken. and removed Waiting for reply⏳ Waiting for the original poster to respond, or discussion in progress. labels Mar 13, 2024
@AdmiralRaccoon
Copy link
Author

Ok thank you for you hints, I´ll give it a try.

Apart from that - I guess there´s nothing PiAlert can do but to deactivate the scan for example this device: It´s a small managed Draytek switch, i simply don´t know why the arp-scan doesn´t recognize it all the time as it´s online 24/7 and I would loose my internet connection if it would be malfunctioning.

image

@jokob-sk
Copy link
Owner

Yeah, that is a possible workaround. I regrettably don't have the mentioned switch so I can't reproduce the behavior. If you have time & know how to code you can help me to improve PiAlert and the arp-scan if you have ideas on how to possibly make it more reliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request➕ New feature or request Workaround provided ⚒️ A workaround for the issue was provided so no further actions will be taken.
Projects
None yet
Development

No branches or pull requests

2 participants