Is it possible to filter an incoming message and only forward (via stream) certain parameters? On a more general level, can we use incoming messages to build custom messages (including addition of our own custom parameters) in flespi?

For example, can I receive an incoming message, extract only the location parameters, add the device name and ident from the flespi device, add a custom parameter (key-value pair), and then forward this custom message (including only device name, ident, my custom parameter, and location data) to my outgoing streams?

I'm looking to do this with messages that are coming into flespi through device protocol channels (i.e., I have an ATrack protocol channel and a Topflytech protocol channel)

    Nick Hello. Right now it can be set up as following:

    1. Atrack or Topflytech channels parse incoming data from the devices
    2. create MQTT channel which subscribes to messages from initial channels. By specifying Custom naming scheme you select which parameters to register.
    3. create a plugin with the scheme of key-value pairs you need to inject (by now, only static values can be added)
    4. create MQTT generic devices and assign plugin to them with specifying static values
      Looks rather complicated, contact us in flespi chat (top right corner of https://flespi.io panel) if you face difficulties with it.

    What's more: in Q1 2021 we will upgrade plugins functionalty. It will be much more powerful tool to post-process incoming messages. Keep an eye on our news!

    • Edited

    baja
    I've made some other considerations about my particular needs concerning flespi. As a result, I don't think your suggestion will work for me. Is there an alternative that may fit my needs as described below?

    I want to move away from using flespi devices. In the future I will be handling 100s of devices and it won't be feasible for me to create a corresponding flespi device for each one. This makes steps 3 and 4 of your suggestion not a good option for me. Adding custom parameters to a message is no longer of concern to me though, so this is not a problem by itself.

    I also want to move away from using channels to handle different manufacturer protocols and instead use channels as a way of managing who a device belongs to. I will have several different clients so I want to assign each of them a single ip:port to configure their hardware to (via HTTP channels ), regardless of the manufacturer protocol. These channels then subscribe to an MQTT stream (to flespi broker). This way, I can easily expose only that client's data to them. Is there a better way to do this through flespi?

    It seems that if I use an additional MQTT channel (as suggested in #2 of your reply) to specify a custom naming scheme, then I can no longer distinguish what channel the message originally came through on. For example, I have a channel for client A and a a channel for client B. Each client's devices send messages to their respective channel, regardless of manufacturer of the devices. These messages then go to the MQTT channel to be custom parsed. They then get pushed to an MQTT stream where they can be subscribed to as needed.

    The problem is, once the messages get pushed through the MQTT channel, how do I now distinguish if it came from client A or client B? I understand that I can associate each unique device id (IMEI) with the correct client, but as mentioned, I'll be dealing with dozens of clients and 100s of devices, so it would save me a great deal of time if I could avoid this. Hence the idea to use channels to distinguish clients so that I can instead just subscribe to appropriate topic. For example, to get all messages for client A, I subscribe to "flespi/message/gw/channels/<Client A's channel>".

    Can I properly do this through flespi and still have some freedom to customize message payload?

      Write a Reply...