[Framework] Homie for ESP8266

Oh man, I just tested this out and it’s amazing. I purchased an ES8266 probably a year ago and never touched it but now that I found use for it I dug it out of the box. Was a pain to get it programmed but I have it working and this opens up SOO many possibilities because they are so cheap.

1 Like

Hi Bert,

i have two questions concerning your utility meter application:

  • Is there any way to set the counter start value for the totals counter?
  • Would you share the schematics how to connect the a3213 with the ESP, i.e. which pin to connect where?

Thanks!

You can find my updated sketch on github (I moved from Arduino tp Platformio: you’ll have to rename to .ino to use in Arduino IDE): https://github.com/bertmelis/homie-gasmeter
I recently updated the firmware to use a telnet interface for remote monitoring.

  1. you can set the total by MQTT using the …/set topic as described in the Homie convention. I publish the correct starting value using MyMQTT on my Android phone.
    The callback function is bool SetCounter(const HomieRange& range, const String& value).
  2. I haven’t made any schematic yet ,but it is very straightforward: the A3213 has three pins: Vdd, GND and Vout. I’ve connected Vdd to 3.3V, GND to GND and Vout to an arbitrary GPIO pin but not the “special function pins” link TX/RX/ADC…
    The pin used has to be defined in the sketch.

I’m using a Wemos D1 mini by the way: just soldered header pins to the board and plugged into a breadboard. Then soldered some wires to the A3213 (and isolated using shrinktube) and also plugged into the breadboard.
All is powered by a USB charger using the USB port on the Wemos.

Hello there,

I have the following setup. Python script on a raspberry to control all my esp8266.
Communication is done via homie. I would like to automatically update the list of homie devices with my python script.
Therefore, I would like to broadcast the device ID from the esp8266 via the broadcast channel, which the python script subscribes to. However, I cannot find an example how to use the broadcast channel on the esp8266. I can only find examples how to subscribe an event to the broadcast chanell on the esp8266. Can someone help me?

Best regards,
Beli.

@Beli I’m not quite following. The broadcast channel on the ESP is only for receiving I think. And If you want an up-to-date list of the on your raspi, you can subscribe to the base topic and count the number of online devices (using the “online” topic).

Anyone had some luck getting the Sonof POW working properly with Homie? The postman dropped off a couple today so I’m keen to get them up and running.

Is it possible to add 4 temperature sensor to the homie based esp8266?
How must i setup homie?

Is it possible to use the button of the sonoff when internet is disconnected? Now the led is blinking when disconnected, but I want to still use the button for the relay…

@marvinroger
Would it be possible to release a machine readable version of your mqtt convention (xml / xsd / json), preferable xml? It should contain at least all possible topics with a name and description in English, the state and command endpoints and the value type (boolean, enum, int, float, string) and the value range. If possible there should be means to internationalize names and descriptions.

Some details on why I’d like to have this:

After my changes to the eclipse smarthome / openhab io.transport.mqtt bundle have been accepted (https://github.com/eclipse/smarthome/issues/3695), I’d like to write the following two Openhab 2.0 bindings:

  1. A simple Mqtt broker configuration binding, so that Mqtt broker can be finally configured via PaperUI, including auto discovery, without fiddling with textual configuration (textual configured mqtt brokers stay valid though). I plan to include an embedded Mqtt Broker as well (https://github.com/andsel/moquette), so some people might not even need to install a separate broker.
  2. A homie binding, that defines thinks for all specified topics. For this binding I need a machine readable version of the specification.

Help is welcome, especially for reviewing the code to make the merge process go faster, for translating the bindings and for writing the readme’s to include some nice usage examples.

Cheers, David

1 Like

I need help!! :frowning:

I’m migrating my server to one raspberry pi, and I have several sensors using homie. I need to switch the configuration file, using OTA.

I tried to publish one message to:
homie/MyRoofNode/$implementation/config/set

The new configuration json file:
{"name":"The Roof node","device_id":"MyRoofNode","wifi":{"ssid":"MY_NETWORK","password": "MY_PASSWORD",},"mqtt":{"host":"192.168.1.100","port":1883,"auth": true,"username": "openhabian","password":"*******"},"ota":{"enabled":true}}

I receive one response immediately after publishing the new json, in the same topic with one blank message.

The node doesn’t switch to the new broker, and continues to publish the updates to my current broker…

Some one can explain me what i’m doing wrong?

Thanks,
Regards,
Jaime

Well… after publishing one message to homie/MyRoofNode/$implementation/reset my node started in configuration mode and I configured the node again using the GUI.

I’m actually having the exact same problem, I know I was able to use $implementation/config/set a long time ago when I initially deployed mine to change the names as I set them out but now I want to reconfigure the mqtt credentials and i’m just getting a blank reply in the same topic and no change in behavior. In my case, i’m publishing the following to the devices/node-id/$implementation/config/set topic with mqttspy (i’ve changed the root topic from homie to devices):{“mqtt”:{“auth”: true,“username”: “openhabian”,“password”:"*******"}} . Any help? I’d rather not visit and reconfigure every node from scratch if I can avoid it