Please use oref-alerts-proxy-ms instead.
Node.js RESTful API to retrieve Israeli Pikud Ha-Oref so called "Red Color" alerts.
The project deployed on Docker Hub as dmatik/oref-alerts.
docker run -d -p 49000:3000 --name oref-alerts dmatik/oref-alerts:latest
version: "3.6"
services:
oref-alerts:
image: dmatik/oref-alerts:latest
container_name: oref-alerts
hostname: oref-alerts
network_mode: "bridge"
ports:
- 49000:3000
restart: unless-stopped
{
"alert": "true",
"current": {
"data": [
"סעד",
"אשדוד - יא,יב,טו,יז,מרינה"
],
"id": 1621242007417,
"title": "התרעות פיקוד העורף"
}
}
{
"lastDay": [
{
"data": "בטחה",
"date": "17.05.2021",
"time": "13:31",
"datetime": "2021-05-17T13:32:00"
},
{
"data": "גילת",
"date": "17.05.2021",
"time": "13:31",
"datetime": "2021-05-17T13:32:00"
}
]
}
sensor:
- platform: rest
resource: http://[YOUR_IP]:49000/current
name: redalert
value_template: 'OK'
json_attributes:
- alert
- current
scan_interval: 5
timeout: 30
NOTE: This responce is very long, while there is 255 characters limit in HA sensors.
Hence adding it to the attribute, which does not have such limit.
sensor:
- platform: rest
resource: http://[YOUR_IP]:49000/last_day
name: redalert_history
value_template: 'OK'
json_attributes:
- "lastDay"
scan_interval: 120
timeout: 30
binary_sensor:
- platform: template
sensors:
redalert_all:
friendly_name: "Redalert All"
value_template: >-
{{ state_attr('sensor.redalert', 'alert') == "true" }}
binary_sensor:
- platform: template
sensors:
redalert_ashdod:
friendly_name: "Redalert Ashdod"
value_template: >-
{{ state_attr('sensor.redalert', 'alert') == "true" and
'אשדוד - יא,יב,טו,יז,מרינה' in state_attr('sensor.redalert', 'current')['data'] }}