[Framework] Homie for ESP8266

@marvinroger
Hey Marvin, it’s been a little while since I setup any new “nodes”… Your documentation now seems to refer to V2… Is the release imminent?

Not imminent but close, I’d say. I expect the v2 to be ready by christmas. :slight_smile:

1 Like

HI @marvinroger - im just trying to get started and i too was thrown by the docs saying to download v2…but the link to
here https://github.com/marvinroger/homie-esp8266/releases has the latest being 1.5.0 (April 24). I see from just above that v2 isnt yet ready…

So is 1.5.0 the correct current release version?
(That seems old based off all the activity around your framework…)

Cheers,
Greg

Hi!

Indeed, the online docs are for the v2, which is not yet released. The latest stable version is 1.5.0.
I know this is kind of confusing, and further releases won’t be that messy.

The docs for the 1.5.0 is available here: https://github.com/marvinroger/homie-esp8266/blob/v1.5.0/docs/index.md

And yes, the v2 is is development since 6 months, mainly because I had to develop the asynchronous MQTT client.

Have a good day!

Hi! I just wanted to ask if there is already a plan when to release V2. I want to start developing something but I could wait a bit more…

I already use the V2 for some weeks. Works great.
I assume that new commits only contain bugfixes.

Since you can update OTA, you can easily move to the final version once it’s there.

1 Like

I presume you mean that you are using some snapshot of the V2 branch, as I don’t think there are any V2 releases yet, or have I missed something?

Indeed, cloned from github and build my sketch.

I didn’t test the OTA though. But as I don’t see any showstopping issues I assume it will work. My ESP are not mounted in some critical application or hard to reach location.

Hi Bert,
thats great to hear… but how do I build it? Or may I ask if you would upload your build?

Cheers!

No problem. I’ve recently put my makings on github.

The code is running on a Wemos D1 mini with 2 a3213 hall sensors directly connected to the gpio pins. power for the hall sensors is also taken from the board (3v3).

I tested the homie-ota server from JPMens yesterday. Worked like a charm.

(I feel sorry for my poor Raspberry Pi: I’ve got so many different servers running…)

1 Like

Hi there,

thank you for the great job on homie firmware.

@marvin, when do you think the Vers. 2 is ready for use.
I try to understand how to use and hopefully I can give something back to the community.
Actually I’m a bit confused with the dependencies.

have fun!

I didnt realize I could just clone it and it will work… (probably because I saw the Makefile). Thanks for the tip and the example and server! I will start working on it :slight_smile:

I don’t know if this is the right thread for it.

Today I got my first Sonoff Smart Switch, immediately I flashed it, nothing worked so far. No switching …

The reason is, there a new switches delivered and the pinout had changed.
You can find out what version you have, if you have 5 pins in the middle where you connect your FDTI adapter, then you have the new version:

You need to change the Pins in the arduino sketch.
----snip—
const int PIN_RELAY = 12;
const int PIN_LED = 13;
const int PIN_BUTTON = 0;
----snap----

have fun!

Heiko

Hello @marvinroger,
I did not read the whole 253 messages this thread holds till now. Sorry if you answered to the following before. :slight_smile:

I’ve developed a rather complex system using homie as the networking basis and everything is working like a charm. I believe to have everything working following the ideas of homie and the homie convention.

My question is actually aimed at the homie convention. I was a bit confused to find a lot of examples but no concrete definitions of possible node $type’s and units. I am also missing the capability to announce a value range for both outgoing and incoming topics. I have the feeling standardizations like these would be the most interesting part about a convention around IoTs on MQTT. Currently a discovery service will be told about nodes and properties but how these can be interacted with is not clearly defined.

Of course I could be wrong, let me define two examples and which data I think should be made available to a discovery service:

A node of the type “temperature” has one non-settable property with the name “temperature” and the unit “degree celcius”. The range of this property is between -50 and +250 in natural numbers.

A node of the type “switch-measurable” has one settable property “on”, which is unit-less and has the two allowed values “true” and “false”. The node also has a non-settable property “power” with the unit “Watt” and the range of float.

In the current homie convention I’m missing the possibility to set the unit and domain/value range for one property. What’s your opinion on this matter? If you prefer, I can move this message over to the homie convention issue tracker.

Best wishes! Thomas

@ThomDietrich It’s the obvious next step. There’s already a issue on GitHub: https://github.com/marvinroger/homie/issues/12

I only hope that they ESP6266 Arduino keeps existing as a lot of effort is put into the esp32. But that’s off topic.

OpenHab 2

I have my MQTT broker up and running just fine. I have my wemos d1 connected and fast flashing light just waiting on the broker to connect. pretty crazy i got that far!

now i want to have the d1 trip a relay and report back in my openhab sitemap that its on or off. so in other words a switch to trip the relay in the sitemap. i read through the posts but not sure i am seeing what i am trying to do. not for sure what pin i should use on the d1 either.

any help would be much appreciated!

thanks!

It doesn’t matter which GPIO pin you use for the relay, as long it’s not the LED, RST and maybe the TX/RX pins.

But what do you mean by fast flashing? Does your board connect to your broker or not? (Lately I’ve run into some troubles myself)

Triggering your relay is by writing a callback function which switches the output pin. The callback function is referred to in the node.property.settable statement. I don’t know if the framework is publishing the new values automatically. But if it’s not, you can easily program is yourself.
You should find a working example in the readme docs of the framework.

Bridging to Openhab is by making a new switch item with a mqtt channel containing the topic your homie-node is listening on.

Thanks Bert, that jives with what i have been researching. Will see if I can make that happen in the next few days! not much of a coder but hopefully i can hack something!

I have not tried to connect it to the broker. guess i need to find a simple script to test that part out. from what i have read, the fast blinking is telling me it is ready to connect to a broker. will see if i can work through that first and test it.

thanks!

Mind that connecting to the broker is something that the framework does for you. No need to worry about that!
Just put in the details (ip, port,…) and off you go.

For the record: untill I received my ESP8266 devices a few weeks ago, I didn’t had any Arduino/MCU experience whatsoever, besides some basis theoretical education years ago.

And now I’ve got these little devices for my garage door, electricity and gas meter,…
My next project is to control my Viessmann boiler using the esp.

I use a relay on an ESP8266 to control one of my garage doors with OpenHab

Here is the item:

Switch SmallGarageDoorSwitch "Small Garage Door" (Garages, gMyOpenHAB) ["Lighting"] { mqtt=">[mqtt:sm_garage/relay1:command:ON:OPEN],>[mqtt:sm_garage/relay1:command:OFF:CLOSE]" }

And here is the sitmeap:

Switch item=SmallGarageDoorSwitch icon="garagedoor-closed" label="Small Garage Door Closed" visibility=[SMALL__GARAGE_STATUS=="CLOSED"] mappings=[ON="Open"]
Switch item=SmallGarageDoorSwitch icon="garagedoor-open" label="Small Garage Door Open" visibility=[SMALL__GARAGE_STATUS=="OPEN"] mappings=[OFF="Close"]

Hope this helps!