Extend meshtastic_api_text_message for additional data#126
Open
heggi wants to merge 1 commit intomeshtastic:mainfrom
Open
Extend meshtastic_api_text_message for additional data#126heggi wants to merge 1 commit intomeshtastic:mainfrom
heggi wants to merge 1 commit intomeshtastic:mainfrom
Conversation
|
When will this be implemented? Where can I download this version? |
|
@heggi mb you would like to have more data: #120 =) @megadimich you already can use it by pulling the branch directly. I was able to implement this automation with my branch from #120. Automation replies automatically went got message contains Example: alias: "Meshtastic: !test reply"
description: Test reply
triggers:
- domain: meshtastic
device_id: XXX
type: channel_message.received
entity_id: meshtastic.gateway_XXX_channel_secondary
trigger: device
id: message_recieved_from_XXX
conditions:
- condition: template
value_template: |-
{{ trigger.event.data.message | lower
is search('(^|\\s)!test(\\s|$)') }}
actions:
- action: notify.send_message
data:
message: >-
{%- set msg = trigger.event.data.message | default('') -%}
@{{ trigger.event.data.sender_short_name }} got your test message: "{{
msg[:40] }}{{ '…' if msg|length > 40 else '' }}" near Stroomi rand at
{%- set tf = trigger.event.time_fired -%}
{%- set tf_str = tf if tf is string else tf.isoformat() -%}
{%- set fixed = tf_str[:-3] ~ tf_str[-2:] -%}
{%- set dt = strptime(fixed, '%Y-%m-%dT%H:%M:%S.%f%z')
if 'T' in fixed
else strptime(fixed, '%Y-%m-%d %H:%M:%S.%f%z') -%}
{{ as_local(dt).strftime(' %H:%M:%S %Z (UTC%z)') }}
{%- if trigger.event.data.rx_snr is defined %}
SNR: {{ trigger.event.data.rx_snr }}dB
{%- endif %}
{%- if trigger.event.data.rx_rssi is defined %}
RSSI: {{ trigger.event.data.rx_rssi }}dBm
{%- endif %}
{%- if trigger.event.data.hop_count is defined %}
Hops: {{ trigger.event.data.hop_count }}
{%- endif %}
target:
entity_id:
- notify.mesh_channel_longfast
mode: singleResulting message looks like this: |
|
Super!!! |
|
I couldn't find it: sender_short_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added to meshtastic_api_text_message fields
hops_count,rx_rssiandrx_snr.Using me in automatization auto replay for direct message
Example: