Closed ntah closed 1 year ago
This issue is related to this pull request I created, unfortunatelly no updates on this side.
The only way to make it work(since the pull request has not been merged ) is to edit your config.h and compile the fw.
Put a unique value on MQTT_TOPIC_ROOT
.
Is not possibile to define this value elsewhere at the moment (eg: web config).
yes we can define MQTT_TOPIC_ROOT and recompile for each device firmware.
the easiest way for me is,
adding MQTT_HOME_ASSISTANT_DEVICE_NAME on config.h for unique id
and edit src/core/VariableDefiner.cpp for sensor and control name
so sensor name also unique
{ "name": "mppt1 PV volt.", "uniq_id": "mppt1_pv_voltage", "dev_cla": "voltage", "unit_of_meas": "V", "dev": { "ids": "mppt1epever", "name": "mppt1", "mf": "Bettapro", "mdl": "Solar-Tracer-Blynk-V3", "sw": "v3.0.8" }, "avty_t": "aha/mppt1epever/avty_t", "stat_t": "aha/mppt1epever/mppt1_pv_voltage/stat_t" }
no duplicate again. just make sure on web config, do not use the same device name
Your solution should work but it still needs to compile the FW for each device.
As I said in the pull request, the device shouldn't be identified by its "name", we shoud provide a unique id instead, not related to its name.
I guess, the best bet are:
MQTT_HOME_ASSISTANT_DEVICE_ID
, that could be modified in the web config (like MQTT_HOME_ASSISTANT_DEVICE_NAME
), dafault value will be "" to keep it backward compatible.MQTT_HOME_ASSISTANT_DEVICE_ID
on each sensor ID to make it uniqueOr:
MQTT_HOME_ASSISTANT_DEVICE_ID
, that could be modified in the web config (like MQTT_HOME_ASSISTANT_DEVICE_NAME
), dafault value will be "" to keep it backward compatible.MQTT_HOME_ASSISTANT_DEVICE_ID
on each sensor NAME to make it uniqueThe last one is using the original library (that is a good thing) but it changes the "name" of the sensor depending on the device Id (which is not very good). But, as it keeps it limited to HA-sync shouldn't be a really bad thing.
Solved in v3.0.9 by using the new variable MQTT_HOME_ASSISTANT_DEVICE_ID (in config.h or web config)
Is your feature request related to a problem? Please describe. Hello, HA ignoring all new added sensor if using multiple device sensor because sensor unique ids already exists.
Describe the solution you'd like We can using device name in front of variable to void multiple unique id and name "name": ids + "PV volt.", "uniq_id": ids +"_pv_voltage"
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context![issue_solartracer](https://github.com/Bettapro/Solar-Tracer-Blynk-V3/assets/7876698/71966254-82f6-489b-a8cf-542eeefd765b)