cyberjunky / RTL-SDR-P2000Receiver-HA

Receive P2000 messages using RTL-SDR stick and post them to Home Assistant
MIT License
23 stars 11 forks source link

Notification in HASS when no data #29

Closed leejoow closed 2 years ago

leejoow commented 2 years ago

Not a real issue, but more of a question.

@Dinges28 wrote in a pull request he lets HASS send a message if there is no update in the last 30 minutes. I'm trying to get this done, but I cannot figure it out.

Do you have an example how to get this working?

Dinges28 commented 2 years ago

I have it right now as a automation in Home Assistant for the sensor that display's most of the country....

- id: '4000000000012'
  alias: SDR hangt Notification
  trigger:
    - platform: state
      entity_id: sensor.p2000sdr
      for:
        minutes: 30
  action:
  - service: persistent_notification.create
    data_template:
      title: P2000SDR hangt
      message: "P2000SDR hangt"
  - service: notify.mobile_app_ios
    data_template:
      title: P2000SDR hangt
      message: P2000SDR hangt - {{ now().strftime("%d-%m-%Y - %H:%M:%S") }}

Bit I would like to have a dummy sensor that just updates on every message that is received and trigger this automation on that sensor (ultimate would be a script that logs in to the machine and restarts the service ;-) )