$implementation/reset: You can publish a true to this topic to reset the device
Thank you!!!
PD: I have implemented it, here is the code:
homie-ota.py:
# Handle deleting a device from the mqtt broker, and the local db.
@route('/device/<device_id>', method='PATCH')
@conditional_decorator('HTTP_USER' in globals() and 'HTTP_PASSWORD' in globals(), auth_basic(check))
def reset_device(device_id):
topic = "%s/%s/$implementation/reset" % (MQTT_SENSOR_PREFIX, device_id)
mqttc.publish(topic, payload='true', qos=1, retain=False)
logging.debug("Reset device: {}".format(device_id))
info = "reset configuration for %s" % (device_id)
logging.info(info)
del db[device_id]
del sensors[device_id]
return info
Hi, can you add reset option in device.tpl?
Homie implements reset option to delete all configuration for a device:
https://homieiot.github.io/homie-esp8266/docs/develop-v3/others/homie-implementation-specifics/
Thank you!!!
PD: I have implemented it, here is the code:
homie-ota.py:
device.tpl