A la découverte de Homie
Version 2.0.0
Documentation: https://homieiot.github.io/homie-esp8266/docs/stable/
Version 2.0.0
Documentation: https://homieiot.github.io/homie-esp8266/docs/stable/
Il faut se connecter sur le Wifi du homie.
Si la page du homie s’ouvre avec le message
1 |
UI bundle not loaded. See Configuration API usage: http://marvinroger.github.io/homie-esp8266/ |
Il faut envoyer le fichier config.json au module homie fraichement flashé.
Fichier config.json:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
{ "name": "homie 1", "device_id": "homie-1", "device_stats_interval": 60, "wifi": { "ssid": "SSID", "password": "PWD" }, "mqtt": { "host": "mqtt.host.com", "port": 1883, "base_topic": "homies/", "auth": true, "username": "user", "password": "pwd" }, "ota": { "enabled": true }, "settings": { "percentage": 55 } } |
1 |
curl -X PUT http://192.168.123.1/config --header <span class="s2">"Content-Type: application/json"</span> -d @config.json |
Comme on ne peux pas renvoyer un nouveau fichier au homie, il faut faire les modification via mqtt.
Il suffit d’envoyer les changements partiel du fichier json comme payload du message (devices)/(name)/$implementation/config/set
Par exemple pour changer le nom du homie et le base_topic, on enverra:
1 2 3 4 5 6 |
{ "name": "Nouveau nom", "mqtt": { "base_topic": "homies/" } } |