Skip to content

Redalert Windows service is a service that listen to redalerts and publishes it using Mqtt or Telegram bot

License

Notifications You must be signed in to change notification settings

t0mer/Redalert-Windows-Service

Repository files navigation

Red Alert Windows Service


c# based windows service that reads json from Oref Website and publishes it over MQTT Protocol and/or Telegram Bot.

Installation

In order to install the service download the code and compile it. than move the binary files as listed below in to a new folder under Program Files:

  • RedAlert.exe
  • RedAlert.exe.config
  • Newtonsoft.Json.dll
  • M2Mqtt.Net.dll And run the following command from Command line (Make sure to run as admin):
 c:\Windows\Microsoft.NET\Framework64\v4.0.30319 "c:\Program Files\RedAlert\RedAlert.exe"

Service configuration

RedAlert.exe.config

In order to use this service, some configuration need to be done. Open RedAlert.exe.config in any text editor and edit the required settings as follows:

 <appSettings>
    <!--General Settings-->
    <add key="IsDebugMode" value="false"/>
    
    <!--Select Alert Region or * for any-->
    <add key="City" value=""/>
    
    <!--Telegrem Bot Settings-->
    <add key="IsTelegramEnabled" value="true"/>
    <add key="telegramApi" value=""/>
    <add key="channelId" value="orefredalert"/>
    <add key="telegramApiUrl" value="https://api.telegram.org/bot{0}/sendMessage?chat_id={1}&amp;text={2}"/>
    
    <!--Mqtt Settings-->
    <add key="IsMqttEnabled" value="true"/>
    <add key="MqttHost" value=""/>
    <add key="MqttUser" value=""/>
    <add key="MqttPass" value=""/>

    <!--UDP Settings-->
    <add key="IsUdpEnabled" value=""/>
    <add key="UdpAddress" value=""/>
    <add key="UdpPort" value=""/>
   
    
    
  </appSettings>

How to create Telgram Bot

Usage

Adding Sensor in Home-Assistant

Get full json (including date and id)

  - platform: mqtt
    name: "Red Alert"
    state_topic: "/redalert/"
    # unit_of_measurement: '%'
    icon: fas:broadcast-tower
    value_template: "{{ value_json }}"
    qos: 1

Get json with alert areas only

  - platform: mqtt
    name: "Red Alert"
    state_topic: "/redalert/"
    # unit_of_measurement: '%'
    icon: fas:broadcast-tower
    value_template: "{{ value_json.data }}"
    qos: 1

About

Redalert Windows service is a service that listen to redalerts and publishes it using Mqtt or Telegram bot

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages