Hello,
I am working to integrate a sensor emitting LoRa messages to home assistant.
The default model seems to manually define a collection of MQTT sensors in home assistant (for instance this project which uses the same moisture sensor I have).
Situation gets a bit more complex when using OMG for multiple sensors. The link above suggest to define sensor that filter values:
value_template: >-
{% if (value_json.message|from_json).name == "Soil_1" %}
{{ (value_json.message|from_json).hum }}
{% else %}
{{ states("sensor.soil_1_Humidity") }}
{% endif %}
This is quite tedious (it has to be done once per sensor value and per sensor). My understanding is that this happens because the LoRa gateway in OMG does not uses different MQTT channel per LoRa “device”.
I also understand LoRa does not naturally identify messages emitters (which bluetooth does for instance using their mac address). So OMG cannot distinguish emitters unless they all follow some convention in the message they send.
I’d like to know what are your ideas regarding this issue which can be formulated in different manners:
- how to automatically create distinct devices in home assistant when data comes from LoRa gateway
- how to distinguish devices at OMG level when using LoRa gateway