-
-
Notifications
You must be signed in to change notification settings - Fork 466
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
[FEATURE REQUEST]🦄Notification using custom webhook #726
Comments
Thanks Luc! Sounds promising. I don't know (yet) how ESP3D manage notifications and how this feature is coded. The main use case for this feature request is to integrate ESP3D notifications with customs apps like home automation software (Home Assistant in my case) and notify the status of the printer via webhook. For example, when printer start printing, stops or got some error. This allows make some automations you need according the printer status changes. The idea of a payload template is really good because most of the webhooks are expecting json object as payload. This is an example of Home Assistant webhook request:
You actually can do this with Octoprint on the Raspberry Pi but if this feature can be ported to ESP3D will be awesome! The price of a Raspberry Pi doesn't worth the purpose. |
about automation there is a big difference between raspberry and esp3d So the ESP3D current autonotification is limited to ESP3D got internet access , as it do not monitor printing error and may even not able to catch them alone that is why I suggest to put [ESP600] notifications in GCODE file, they will be processed by ESP3D when it see them. I understood the format so I can imagine this way to setup T1= some_hook_id because it is custom web hook it will use template (but I am also considering using autonotification template for all notifications if available to allow user to change it anytime) Just an idea for the moment to store and feed data |
Thanks for the explanation, now I understand how it works. Putting the [ESP600] codes on the .GCODE file you can actually notify the start and finish, not the errors. But it's OK! About the T1, I think it is not necessary to put a variable for the hook id separated to the URL, this is the Home Assistant way to implement webhooks, and this webhook feature needs to be generic. With just one field to config the full webhook URL it's OK and will be more generic for other type of webhook integrations. Also, to be more flexible, instead of the hook id variable, it's more important to have a method configuration for the request, I mean, GET, POST, PUT, DELETE, and if there is another token available will be awesome to send custom request headers, for example: "Content-Type: application/json" The payload template is perfect. |
the idea behind using T1 it is because T has only 127 chars so I am afraid it is not enough |
@cyberiano As I rewriting all command syntax I just remember this command : |
@cyberiano Possible variables:
Common entries that are mandatories or optional in parenthesis default value:
Sample entries used as reference:
2 - TELEGRAM
3 - LINE
4 - IFTTT
the template file could be in root of file system, e.g: notification.tpl Example 1(based on IFTTT webhook):
2 - Minimal version (removing optional entries suing default values)
Example 2 (based on your example where t1 = hookId):
Like this is it is pretty flexible I think, it allows control every part of the querie, it can be elaborate to add more user case if FW allow it (e.g: error message) What do you think ? |
This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
Make generic solution need to cover too many user cases, and I doubt it will be really used, so I prefer to drop this feature request |
as suggested by @cyberiano #708 (comment)
the issue is to fit all data in 3 slots : (not including message content)
Token 1 = 63 chars (hidden in settings)
Token 2 = 63 chars (hidden in settings)
Token extra = 128 chars fully visible
also what the AUTO_NOTIFICATION behaviour should do with such notification ? should be disabled ?
or need to change the content of
#define NOTIFICATION_ESP_ONLINE "Hi, %ESP_NAME% is now online at %ESP_IP%"
which mean the webhook is actually hardcoded which I would like to avoid as much as possible
Another possibility would be to allow more variables in message and also use [ESP600] to define id and value
like
[ESP600]ID=msg MSG=Hi, %ESP_NAME% is now online at %ESP_IP%
another possibility would be to allow template message file on FS and use it if present
The text was updated successfully, but these errors were encountered: