Pfsense device tracker blueprint please

i am using pfsense router along with this HA add on GitHub - travisghansen/hass-pfsense: pfSense integration with Home Assistant
is there a BluePrint that can alert me when certain devices change from Home to Unavailable or Unknown? i guess i could write an automation by putting devices into a group but wondering if anyone has a better solution…

Sounds like fun.
I might give it a try, no promises though…

Alert me what are you thinking? Mobile notification, flip a sensor? What do you thiink would work the best?

Why would you need to create a group?
You can add all the entities you are interested in to a list in the state platform trigger.
Then in the notification you just use:
{{ states[trigger.to_state.name] }} just changed to Unavailable.

automation:
  trigger:
    - platform: state
      entity_id:
        - device_tracker.computer1
        - device_tracker.computer2
        - device_tracker.computer3 
      from: "home"
      to: "unavailable"
  action:
    - service: persistent_notification.create
      data:
        title: "{{ states[trigger.to_state.entity_id].name }} Status"
        message: >-
          {{ states[trigger.to_state.entity_id].name}} has gone unavailable!
mode: parallel
max: 10

Something like that.
You can also use {{ trigger.to_state.name }}

I threw something together. Give it a test please. If it works I’ll release it officially.
Let me know either way…

Pfsense device tracker blueprint please - #11 by Sir_Goodenough.

wow. it looks crazy good! very easy to use via the GUI.
2 questions though. what do i put in message if i want to be alerted of the specific name of the device that went down?
and if 2 or more devices go down at the same time, what would the message look like? or would i get 2 Telegram notifications?

description: ""
alias: Notify if Device goes Down.
use_blueprint:
  path: SirGoodenough/pfsense_device_tracker.yaml
  input:
    trackees:
      - device_tracker.pfsense_home_arpa_b4_fb_e3_fa_3f_20
      - device_tracker.sm_t220_2
      - device_tracker.sm_t220
    alt_notify:
      - service: notify.telegram
        data:
          message: device xxxx is down.

Since there are a myriad of messaging apps, specific message to specific apps like telegram are something you have to write and put into the 'Manual Notification; section. If you look in the blueprint code, you will see the templates needed for device name and state in the persistent notification code.
The messages will now as-is show up in the bottom left corner of HA dashboard and have the device name and state,
Try it out, let me know. It it is working I’ll do a decent write-up with examples for telegram and other messaging that I know about for the manual section. I’ll also see what others are doing for messaging to mobile, etc.
But since you requested this I wanted you to shake it out a bit.

On question 2, would be 2 messages.

made another tweak.
The persistent notification now shows the full attribute list so if you wanted to put a different data attribute in your custom message, they are all listed there easy to find. You would use the way I did name and state to pull those out individually.

If you delete your blueprint (not the automation you made that calls the blueprint) and re-install it, you will get the new version and your automation will still work.

looks like i will have to get back to you on this one.
for some reason, my pfsense Travis add on keeps showing up as unavailable.

i uninstalled the addon and trying NMAP integration now. while it does show a lot more devices as home, some devices are unavailable as well


very strange…

This blueprint will work with any device tracker, as long as it uses home when home and anything else when hot home. I have a host I do a ping to in device tracker, it works with the blueprint as well.

For the pfSense integration (It’s not an add-on…), it did this to me a while back. I uninstalled the integration from everywhere including all the device trackers, made sure my login for HA inside pfSense was fresh and had the proper permissions again, rebooted my host computer, and reinstalled it. All was good again.

Made another update to the blueprint, fleshed it out a bit.

  • It now has a provision to add an optional notification_id, a thing that some might want.
  • It allows you to turn off the persistent_notification with the assumption that you will then use it only manually with your own notification code.
  • I also found that Awesome Blueprints Matt has a blueprint to send this stuff to your phone, so I referenced that to be helpful if you are looking for that.

About ready to release it in my blueprints library Github.
If you find any problems let me know.

New blueprint has been released.
Please get your copy from there, not the other links found in this thread.