Alert for failure of a network device

Hi folks,

I want to be notified, when a special networkdevice will fail.

the entitiy looks like this:

source_type: router
ip: 192.168.178.65
mac: 00:EE:4D:CE:10:7E
host_name: CANBUS-CLIENT
last_time_reachable: '2021-08-31T10:56:35+00:00'
friendly_name: CANBUS-CLIENT
icon: mdi:lan-connect

and I made an automation like this:

- id: '1630407735728'
  alias: Ausfall CANBUS-CLIENT
  description: ''
  trigger:
  - platform: state
    entity_id: device_tracker.canbus_client
    attribute: last_time_reachable
  condition:
  - condition: not
    conditions:
    - condition: state
      entity_id: device_tracker.canbus_client
      state: CANBUS-CLIENT
      attribute: host_name
  action:
  - service: notify.mobile_app_oneplus_a6003
    data:
      message: CANBUS-CLIENT ist ausgefallen
  mode: single

Why does it not work?

I still don’t have any idea.
I think that I have to use the ‘last_time_reachable’ attribute, but I don’t know how.

Is there anybody who wants to help me?

Likely because you trigger on the last_time_reachable which, by definition, will not change if the device is not reachable.
Assuming the entity is a device_tracker, just trigger on the state (remove the attribute part) and the condition should be "not home" or just not_home. The values for a device_tracker are fixed.