Pushover Twincat
Pushover is a cloud-based service for sending real-time notifications. It allows you to send alerts, reminders, and messages to smartphones and computers. Pushover supports various platforms, including Android, iOS, Windows, and macOS. It provides APIs to send messages programmatically, making it ideal for industrial applications where real-time notifications are crucial.
This project allows integration of Pushover notifications directly from a PLC. It enables you to send real-time alerts and messages from your PLC over Pushover to notify users about important events, alarms, and statuses. There are two main parts of this project
- An ADS Server implemented with C#, which sends requests to pushover via the pushover api
- A PLC Library, which sends requests to the ADS Server
Installation (Windows)
Download the latest release
Install and start the Windows Service by opening a Command Prompt with Administrator privileges and running:
sc create PushoverService binpath="<ABSOLUTE_PATH_TO_PushoverService.exe>" sc start PushoverService
For instance, the commands may look like
sc create PushoverService binpath="C:\Users\Stefan\Downloads\PushoverTwincat\PushoverService.exe" sc start PushoverService
Installation (Linux, BSD)
Download the latest release
Create a service file
/etc/systemd/system/pushoverservice.service
, which looks similar to[Unit] Description=Pushover TwinCAT Service [Service] ExecStart=/usr/bin/dotnet </path/to/PushoverService.dll>/PushoverService.dll Restart=always User=<youruser> Environment=DOTNET_ENVIRONMENT=Production [Install] WantedBy=multi-user.target
and adapt the placeholders
</path/to/PushoverService.dll>
and<youruser>
Start the service by calling
sudo systemctl enable pushoverservice sudo systemctl start pushoverservice
Usage
Reference the
Pushover
PLC Library with the Twinpack Package Manager. Alternatively, get it from the latest GitHub release, install and reference it manually with TwinCAT.Use the following code for sending push notifications
PROGRAM MAIN VAR _send : BOOL; _pushoverClient : Pushover.PushoverClient('<your_pushover_apptoken>', '<your_pushover_user>'); END_VAR IF _send THEN _send := FALSE; _pushoverClient.SendMessageAsync('Hello World!'); END_IF _pushoverClient.Cyclic();
Uninstall (Windows)
Uninstall the Windows Service by opening a Command Prompt with Administrator privileges and running:
sc stop PushoverService sc delete PushoverService
Uninstall (Linux, BSD)
Stop the service by calling
sudo systemctl stop pushoverservice
Delete the service file previously created in
/etc/systemd/system/pushoverservice.service