MQTT messages to show home / away etc

Hi, I have a Fingbox that sends out notification to an android unit.
I catch these notifications and convert them to MQTT

For now they are published with 2 topics

/fingbox_title
/fingbox_text

Example of messages.

title: Name arrived
text: Name is at FINGBOX

title: Name left
text: Name left FINGBOX

title: Blocked new device
text: Hostname joined FINGBOX and was blocked

title: Wi-Fi Security Alert
text: New or rogue Wi-Fi access point in FINGBOX

title: Fingbox is OFFLINE: FINGBOX
text: Discovery is missing since: Today 13:22

How can I setup this and get most out of the data in HA?
I would like to have home/away entities for all users so I also can use Node-Red to speak out who is enter the house and sequrity messages in our local language.

The warnings would also be great to use.

I’m very new to HA so I don’t know where to start to integrate this so any help would be helpfull.

For the “Blocked new device” bit, it would be more accurate if the two pieces were posted on the same topic using JSON.

/fingbox_message
{
   "title":"Blocked new device",
   "message":"iambadguy joined FINGBOX and was blocked"
}

The reason for this is that, if lots of messages are sent at the same time, by the time Home Assistant gets around to pulling the message topic after seeing the title topic change, there could be a whole new message there.

Regardless of that, the easiest would be a Binary MQTT Sensor. This will handle presence for two people, “Ed” and “Steve” (untested, may be typos):

binary_sensor:
  - platform: mqtt
    name: "Steve Home"
    state_topic: "fingbox_title"
    payload_on: "ON"
    payload_off: "OFF"
    value_template: >-
      {% if value == "Steve is at FINGBOX" %}
        ON
      {% elif value == "Steve left FINGBOX" %}
        OFF
      {% else %}
        {% if is_state('binary_sensor.steve_home', 'on') %}
          ON
        {% else %}
          OFF
        {% endif %}
      {% endif %}

  - platform: mqtt
    name: "Ed Home"
    state_topic: "fingbox_title"
    payload_on: "ON"
    payload_off: "OFF"
    value_template: >-
      {% if value == "Ed is at FINGBOX" %}
        ON
      {% elif value == "Ed left FINGBOX" %}
        OFF
      {% else %}
        {% if is_state('binary_sensor.ed_home', 'on') %}
          ON
        {% else %}
          OFF
        {% endif %}
      {% endif %}

It’s tricky (and therefore the template is more complicated) because messages for Steve and Ed both show up at the same topic. This is why you need the “else” portion of the outer “if” statement. The inner “if” statement serves to leave the state exactly as it was if the person (Ed or Steve) wasn’t mentioned at all.

How you catch Fing notifications?

I will start by change the MQTT message as JSON instead.
Now I have something to work on:)
Thank you so much,

I use tasker and Notification watch / Notification Listener , with this method I can catch all notifications or from specific apps. I sue this for many apps. News, skybell, verisure etc.

I thought that you have a method to catch Fing notifications in local network without another device. I use Tasker on my phone but I want to find a way to get data from Fingbox in local network.

one can improve the code a little bit:

binary_sensor:
  - platform: mqtt
    name: "Steve Home"
    state_topic: "fingbox_title"
    payload_on: "ON"
    payload_off: "OFF"
    value_template: >-
      {% if value == "Steve is at FINGBOX" %}
        ON
      {% elif value == "Steve left FINGBOX" %}
        OFF
      {% else %}
        {{ states('binary_sensor.steve_home').upper() }}
      {% endif %}

  - platform: mqtt
    name: "Ed Home"
    state_topic: "fingbox_title"
    payload_on: "ON"
    payload_off: "OFF"
    value_template: >-
      {% if value == "Ed is at FINGBOX" %}
        ON
      {% elif value == "Ed left FINGBOX" %}
        OFF
      {% else %}
        {{ states('binary_sensor.ed_home').upper() }}
      {% endif %}