Skip to content

Provide an MQTT subscription triggered version #16

@LouPaloma

Description

@LouPaloma

The Lovelace component works great... but can't use it for my own sensor
So I've created my own remote sensor wired to an ESP32 powered by a solar panel and LION battery. It publishes strikes via MQTT. For me, Python makes my head spin (yet I my ESP32 is in C++... ain't that a kick).

How about making a version of this that is driven by an incoming MQTT subscription
Can you yank out the SPI/I2C code and make this purely driven by an MQTT subscription? I've found it quite easy to ETL my own published messages into your detect format based on an HA automation. All that missing is a way to feed it back into your process.

While your at it, can you make this script something that HA can manage either in the scripts/ or python_scripts/ subfolders?

Describe alternatives you've considered
None, really... I like your Lovelace component and would love to add it...

Additional context
Here's a stupid simple template on reformatting my own message into your detect message:

- alias: Republish Lightning Message
  trigger:
    platform: mqtt
    topic: 'sensor/weather/test'
  action:
    service: mqtt.publish
    data_template:
      topic: 'sensor/weather/lightning/detect'
      #retain: true
      payload: >-
        {"last":{{ trigger.payload_json["sensor"]["timeStamp"] }},"energy":{{ trigger.payload_json["weather"]["energy"] }},"distance":{{ trigger.payload_json["weather"]["distanceMiles"] }},"count":1}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions