Closed jfmcarreira closed 2 years ago
Added device information in order to allow Home Assistant to create a new device under MQTT integration.
Moreover, each sensor should have a unique_id which was added too. This was tested with BHOnfre and BHPzem.
I have some concerts regarding the device information. This is how it is built:
void createDevJson(const JsonObject &root) { JsonObject dev_object = root.createNestedObject("dev"); JsonArray array = dev_object.createNestedArray("ids"); array.add( String( getAtualConfig().chipId ) ); dev_object["name"] = String( getAtualConfig().nodeId ); dev_object["model"] = "BHOnfre EasyIot7"; dev_object["sw"] = String( getAtualConfig().firmware ); dev_object["mf"] = "Bruno Horta"; }
It would be interested if the field "model" could be able to differentiate between BH models, but I did not find any reference inside the code.
Added device information in order to allow Home Assistant to create a new device under MQTT integration.
Moreover, each sensor should have a unique_id which was added too. This was tested with BHOnfre and BHPzem.
I have some concerts regarding the device information. This is how it is built:
It would be interested if the field "model" could be able to differentiate between BH models, but I did not find any reference inside the code.