Component geo-location NSW RFS and notification

Hi
I’ve set up the NSW RFS geo-location in HA and I’m trying to create a notification to send to my phone if a new event occurs. However, it doesn’t appear to be working. When I trigger the automation to test it I don’t get a message sent. Any ideas where I may be going wrong?
Thanks.

Config.yaml is:

#NSW RFS
geo_location:
  - platform: nsw_rural_fire_service_feed
    entity_namespace: 'nsw_fire_service_feed'
    radius: 50
    categories:
      - 'Emergency Warning'
      - 'Watch and Act'
      - 'Advice'

Automation is:

- alias: Notify NSW RFS
      trigger:
        platform: geo_location
        source: nsw_rural_fire_service_feed
        zone: zone.bushfire_alert_zone
      action:
        service: notify.rose_phones
        data_template:
          message: '{{ trigger.event }}'
          title: "NSW Fire Service"

When you manually trigger the automation there is no actual event, so any action using trigger.event won’t work.
For testing purposes you could temporarily increase the radius and possibly include the “Not Applicable” category. There is always some type of fire reported somewhere in NSW.

Thanks, and yes that showed it was working.

The message though is “Enter” which takes you to HA IOS. Any way of having the message give the location and category?

Yes, trigger.event is just going to be “enter” or “leave”. You want to look at the state and attributes: trigger.to_state in an “enter” event, and trigger.from_state in a “leave” event.

Here some examples with HTML-formatted messages for pushover notifications:

- id: report_fire_entering_zone
  alias: 'Report fire entering zone'
  trigger:
    - platform: geo_location
      source: nsw_rural_fire_service_feed
      zone: zone.bushfire_alert_zone
      event: enter
  action:
    service: notify.pushover
    data_template:
      message: "{{trigger.to_state.name}}<br/>Distance: {{trigger.to_state.state}} km<br/>Alert Level: {{trigger.to_state.attributes.category}}<br/>Location: {{trigger.
to_state.attributes.location}}<br/>Status: {{trigger.to_state.attributes.status}}<br/>Type: {{trigger.to_state.attributes.type}}."
      title: "Fire"
      data:
        html: 1
- id: report_fire_leaving_zone
  alias: 'Report fire leaving zone'
  trigger:
    - platform: geo_location
      source: nsw_rural_fire_service_feed
      zone: zone.bushfire_alert_zone
      event: leave
  action:
    service: notify.pushover
    data_template:
      message: "{{trigger.from_state.name}}<br/>Distance: {{trigger.from_state.state}} km<br/>Alert Level: {{trigger.from_state.attributes.category}}<br/>Location: {{tr
igger.from_state.attributes.location}}<br/>Status: {{trigger.from_state.attributes.status}}<br/>Type: {{trigger.from_state.attributes.type}}."
      title: "Fire Over"
      data:
        html: 1

Thanks for that!
Much appreciated.

I logged an issue with this component just came up in 0.105.5 - I think there was a PR merged 2 days ago that broke it?

FYI - this issue has been fixed in a new version of the integration library. With a bit of luck a reinstall of the system (of the current version) will automatically retrieve that latest version, otherwise, the next version of HA will enforce the minimum version including this fix.

The issue was related to me not having set up my automated unit tests with the correct syntax of a GeoJSON feed which in turn made parsing polygons fail.

1 Like

so just update from ssh again to latest version?

I’m running HA in a venv environment, so can’t say for sure if that works in your setup. However, if your update process reinstalls the integration library - aio_geojson_nsw_rfs_incidents v0.1 - then this should automatically install its latest dependency - aio_geojson_client v0.13 - which contains the fix.

well it just processes and then does nothing so I might downgrade to 0.105.4 and then back up again… but I have a feeling I’ll need to wait for 0.106

Yeah, that sounds as if it doesn’t attempt to reinstall the integration library. Sorry, about that.

can I manually install the integration library? Downgrading and upgrading didn’t help… (If it’s just a few files I can probably do that in the container…)

If you can run pip, then the following may work:

pip install "aio_geojson_client==0.13"

I’ve never tried manually replacing files, so not sure if that works reliably.

well it installed doing that and now reports that version. Guess I need to restart HA now…

EDIT: That works. The error is gone. Thanks!

1 Like