Closed dredjohn21 closed 1 year ago
Thos examples need updating actually because I changed the event format a while ago.
This is what I use in my setup and it seems to work.
alias: "Notify: Velop Information"
description: ""
trigger:
- platform: event
event_type: linksys_velop_event
event_data:
subtype: new_device
id: Device Found
alias: When new device is found
- platform: event
event_type: linksys_velop_event
event_data:
subtype: new_node
id: Node Found
alias: When new node is found
- platform: event
event_type: linksys_velop_event
event_data:
subtype: new_primary_node
id: Primary Node Changed
alias: When primary node has changed
- platform: event
event_type: linksys_velop_event
event_data:
subtype: logging_stopped
id: Logging Stopped
alias: When logging has stopped
condition: []
action:
- variables:
title_prefix: "Linksys Velop - "
- if:
- condition: template
value_template: "{{ trigger.id in [\"Logging Stopped\"] }}"
then:
- variables:
notification_id: logging_stopped
message: Logging has stopped for {{ trigger.event.data.get('name') }}
- service: persistent_notification.create
data:
notification_id: "{{ notification_id }}"
title: "{{ title_prefix }}{{ trigger.id }}"
message: "{{ message }}"
else:
- variables:
notification_id: >-
{{ trigger.event.event_type }}_{{
trigger.event.data.get('unique_id') or
trigger.event.data.get('serial') }}
message: >-
{% if trigger.event.data.get('name') is not none %}
## {{ trigger.event.data.name }}
{% endif %}
| | | |
|---|---|---| {% if trigger.event.data.get('mesh_device_id') is not
none %}
|Mesh:| |{{ device_attr(trigger.event.data.mesh_device_id,
'name_by_user') or device_attr(trigger.event.data.mesh_device_id,
'name') }}| {% endif %} {% if trigger.event.data.get('parent_name')
is not none %}
|Parent:| |{{ trigger.event.data.parent_name }}| {% endif %} {%
if trigger.event.data.get('host') is not none %}
|Host:| |{{ trigger.event.data.host }}| {% endif %} {% if
trigger.event.data.get('connected_adapters') is not none and
trigger.event.data.get('connected_adapters') | count > 0 %}
|Guest:| |{{ 'Yes' if
trigger.event.data.connected_adapters[0].get('guest_network', False)
is eq true else 'No' }}|
|IP:| |{{ trigger.event.data.connected_adapters[0].get('ip',
'N/A') }}|
|MAC:| |{{ trigger.event.data.connected_adapters[0].get('mac',
'N/A') }}| {% endif %} {% if trigger.event.data.get('description')
is not none %}
|Description:| |{{ trigger.event.data.description }}| {% endif
%} {% if trigger.event.data.get('manufacturer') is not none %}
|Manufacturer:| |{{ trigger.event.data.manufacturer }}| {%
endif %} {% if trigger.event.data.get('model') is not none %}
|Model:| |{{ trigger.event.data.model }}| {% endif %} {% if
trigger.event.data.get('serial') is not none %}
|Serial:| |{{ trigger.event.data.serial }}| {% endif %} {% if
trigger.event.data.get('operating_system') is not none %}
|Operating System:| |{{ trigger.event.data.operating_system }}|
{% endif %}
- service: persistent_notification.create
data:
notification_id: "{{ notification_id }}"
title: "{{ title_prefix }}{{ trigger.id }}"
message: "{{ message }}"
mode: parallel
Worked perfectly - thank you!!!!! This is such a helpful integration.
README updated now. The automation above was already in there so I've removed the offending bad ones.
Thank you!
I tried to create an automation to alert based on new device per readme and copy pasted:
Unfortunately I get an error message in the logs when I add a new Wi-Fi device:
extra keys not allowed @ data['notification_id']
Any tips and tricks on how to get working?