Upgrade guide from v1 to v2
This is an upgrade guide to upgrade your Homie devices from v1 to v2.
The Homie convention has been revised to v2 to be more extensible and introspectable. Be sure to check it out.
API changes in the sketch¶
Homie.setFirmware(name, version)must be replaced by
Homie.setBrand(brand)must be replaced by
Homie.registerNode()must be removed, nodes are now automagically registered
- If you've enabled Serial logging,
Serial.begin()must be called explicitely in your sketch
- Remove the
HOMIE_OTA_MODEin your event handler, if you have one
Homie.setNodeProperty()signature changed completely. If you had
Homie.setNodeProperty(node, "property", "value", true), the new equivalent syntax is
Homie.setNodeProperty(node, "property").setRetained(true).send("value"). Note the
setRetained()is not even required as messages are retained by default.