Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HA Automation snippet for " Create a Send Message Automation" might be outdated #1252

Open
t984447 opened this issue May 9, 2024 · 0 comments

Comments

@t984447
Copy link

t984447 commented May 9, 2024

Automatiation for message via MQTT might be outdated

MQTT: Home Assistant Integrations for Meshtastic
Topic: Create a Send Message Entity
Sub-topic: Create a Send Message Automation

Home Automation OS Versions

  • Core
    2024.5.2
  • Supervisor
    2024.05.1
  • Operating System
    12.3
  • Frontend
    20240501.1

Describe what section of the docs is outdated or otherwise in need of change

This guide gives an example at the bottom which ends with Home Assistant Automatiation YAML Editor
giving following error when trying to save;
Message malformed: extra keys not allowed @ data['0']
Meshtastic_Automation_guide_error

Suggested Changes

Please note that I am currently very fresh on both Home Assistant and Meshtastic. There might be better errors.
The changes I made is;

  • Delay definitions is no longer split (hours, minutes, seconds) but rather defined in one HH:MM:SS input; e.g 2 Seconds = "00:00:02"
  • YAML positioning re-format brining Trigger and Action to the same level as Alias.

My code which I got working with added Replace me changes;
[REPLACE ME with full topic path]
[REPLACE ME with node ID]

alias: Meshtastic - Send Automation
description: Create a Send Message Automation
trigger:
  - platform: state
    entity_id:
      - input_text.meshtastic_send_box
action:
  - delay: "00:00:02"
  - service: mqtt.publish
    data:
      qos: 0
      retain: false
      topic: [REPLACE ME with full topic path]
      payload: >-
        {"from":[REPLACE ME with node ID],"type":"sendtext","payload":"{{    
        states('input_text.meshtastic_send_box') }}"}
  - delay: "00:00:01"
  - service: input_text.set_value
    data:
      value: " "
    target:
      entity_id: input_text.meshtastic_send_box
  - delay: "00:00:02"
mode: single

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant