homie-esp8266 icon indicating copy to clipboard operation
homie-esp8266 copied to clipboard

Homie 3.0

Open timpur opened this issue 6 years ago • 31 comments

Open to any one.

Like to discuss what you think homie 3.0 will be, new feature, more tools, ext. What would you like to see.

Some of my thoughts.

  • Under to hood (core changed).
    • New event bus.
    • New task manager.
    • Possibly a add-on aritecture. So you can enable and disable parts of homie core as you need them.
  • Conform to Homie 3.0 (TBA)
  • Add-ons
    • Battery management
    • Node types
  • Compatibility with esp32???(not sure about this yet)

Let's talk.

Your ideas

Core

  • Streamline the usage of JSON
  • Task Management
    • For Node loops (https://github.com/marvinroger/homie/issues/53)(#257)

Add-ons

  • Battery (readbattery level, sleep intervals etc)
  • Debugging (Push debug output over internet, accept external commands etc)
  • FileSystem (Push/Pull files to the SPIFFS over MQTT)
  • Webserver in normal mode (For advanced user configuration)
  • Other IoT protocols implementations (Philips Hue, Alexa, Google Iot, ThingSpeak)

Node Manager (lib of nodes)

  • Note Types: Switch, Dimmer, etc.
  • Util Nodes HeartBeat, ConfigMode, etc.

timpur avatar Jan 02 '18 06:01 timpur

Streamline the usage of JSON. Currently the $properties topic is comma seperated, but the $implementation/config topic is JSON. I don't care which one it is. I just want it to be streamlined.

Task management is a big plus. Some sort of repository of nodes which you can easily pull from and quickly modify. (Read X sensor on pin Y every Z seconds)

Core addons sounds great if the implementation can be kept clean Add on ideas

  • Battery (readbattery level, sleep intervals etc)
  • Debugging (Push debug output over internet, accept external commands etc)
  • FileSystem (Push/Pull files to the SPIFFS over MQTT)
  • Webserver in normal mode (For advanced user configuration)
  • Other IoT protocols implementations (Philips Hue, Alexa, Google Iot, ThingSpeak)

I know these things could be implemented as nodes. I just feel like they would belong better as "add-on" modules that provide offical functionality in line with the Homie protocol.

furyfire avatar Jan 02 '18 12:01 furyfire

Is SSL support a possibility for this?

hamishfagg avatar Jan 02 '18 20:01 hamishfagg

@furyfire love it. Thank you for your comment. Yes I think we might use json more and your right we should pick a standard format for these things.

@IVData see #458 ( it's coming )

timpur avatar Jan 02 '18 20:01 timpur

Regarding Add-Ons/Nodes:

I think most addons will be somehow a HomieNode. So, most work for addons will be to establish a add-on database and an offiicial process how to add the addons there.

For some cases a extension of the Homie API to support "Add-Ons" will be necessary, e.g. access to write "device properties" for the Battery add-on or more level of property information, e.g. for the FileSystem.

Regarding Debug: I have a LoggerNode that could be a good starting point for a debug add-on. Until now, it is not directly used by Homie, but it will be easy to adapt, especially if there would be a specific way to set a debug-functions inside homie. (Or just subclass the Node also from Serial).

euphi avatar Jan 02 '18 21:01 euphi

@euphi good points, im trying to get in touch with @marvinroger to discus and architecture of these ideas. Might start designing how this might all work. Will start uploading docs and milestone plan soon and a task list and we can all contribute to this next major version.

also found this #87

also keep looking at the main message as ill be updating it as you guys add things

timpur avatar Jan 02 '18 23:01 timpur

Yeah I agree a collection of addons would be amazing. I had to scour the internet and GitHub to find any custom nodes I could, and I actually did find a good few of them. Plus it wouldn't be that difficult to write some basic nodes either, and I wouldn't mind sharing mine as well.

Here's some of the nodes I found on GitHub: https://github.com/yves-ledermann/homie-esp8266-supplements/tree/master/src/Nodes https://github.com/luebbe/homie-node-collection/tree/master/src

tripflex avatar Jan 03 '18 15:01 tripflex

When (if?) going that direction maybe create An organization github-account to manage all the contributors/maintainers/...

bertmelis avatar Jan 03 '18 16:01 bertmelis

@tripflex @bertmelis Sounds good 👍

timpur avatar Jan 03 '18 21:01 timpur

Question to all.

Homie Internal Node for sensors and controls.

Should homie use nodes or a node for internal things like the stats (wifi signal ...) and other control points like reset and restart and any other we add? Call it homie-internals Node ?? This would allow for auto discovery of all the internal sensors and controls. Also means as more are added over time, they can just be auto discovered, which is what we want for our Home Automation software.

This should only be done to sensors and controls, not everything in the internals make sense to move to a node.

Thoughts.

timpur avatar Jan 03 '18 22:01 timpur

Not using Homie heavily at the moment, as a noob I'm wondering what are possible use cases for internals.

Speaking about OO code, I'd keep private what should me only mine and public what is for everyone. Internals looks like private, as such not accessible as-is. Could that be actually through some kind of getters setters? For stuff having clear use cases, exposing that just like any other node looks pretty sane.

amayii0 avatar Jan 03 '18 22:01 amayii0

I just was just thinking, did we want to use a node for device sensors and controls (Part of homie) which are built-in? This would mean these sensors are discoverable and not assumed to be part of any spec....

Currently Internal sensors and controls (Part of homie) are assumed part of a spec and not discoverable....

??

timpur avatar Jan 12 '18 02:01 timpur

$stats/... yes, probably also $online, they are not meta-data but measurement values.

ingoogni avatar Jan 14 '18 17:01 ingoogni

Yeah for $stats and other measurement values. Not sure about the $online ($online will change with new convention)

timpur avatar Jan 14 '18 21:01 timpur

Forgot to look at the redesign branch, from that I would add $state, it is not meta-data per se.

(In my simple Homie-applications I publish the state of the state-machine on a node)

ingoogni avatar Jan 14 '18 22:01 ingoogni

The reason why $online changed, is to know for sure when all "discovery data" has been sent.

So it is not a measurement value, but important part of the homie convention.

Edit by @timpur: deleted duplicate comment.

euphi avatar Jan 15 '18 17:01 euphi

Please have a quick look at #473

timpur avatar Jan 18 '18 20:01 timpur

I absolutely like the idea about additions for battery-powered sensors. Especially an integrated option for deep sleep would be great.

flozsc avatar Jan 19 '18 22:01 flozsc

Yes I think adons will be a nice adition. And it might allow us to create a homie core version which is platform dependant and maybe add-ons can be shared for many platforms like esp8266 and esp32 ....

timpur avatar Jan 19 '18 23:01 timpur

From my point of view the support for ESP32 is importent and the addon and more lib of nodes is not necessary. The ESP32 is on the same price level and so much more equipment what for many IOT things required is.

hexxter avatar Apr 05 '18 19:04 hexxter

Hmm, what you guys think of developing homie 3.0 in a RTOS framework? The system could be ported more easily than a bare-metal. Just a thought hehe

edilcn avatar May 25 '18 18:05 edilcn

@paumito, i like the idea, but i think its more important that we stick to arduino framework for the users sake ...

I believe the Arduino framework isn't built on the OS SDK, which means we'll have to choose...

timpur avatar May 25 '18 23:05 timpur

Uhmmm... So, I was doing some research about the compatibility of the Arduino Framework and FreeRTOS. I've found this projects:

  • https://create.arduino.cc/projecthub/feilipu/using-freertos-multi-tasking-in-arduino-ebc3cc

  • https://exploreembedded.com/wiki/Setting_Up_FreeRTOS_on_Arduino

  • http://esp-idf.readthedocs.io/en/latest/get-started/windows-setup.html (toolchain)

  • https://www.espressif.com/en/media_overview/news/espressifs-esp32-support-amazon-freertos

edilcn avatar May 29 '18 02:05 edilcn

Sorry, those are for arm and the esp32, there is no way to use Arduino and rtos for esp8266

timpur avatar May 29 '18 06:05 timpur

Hi @timpur!

Is there any homie-esp8266 branch that is compatible with the Homie 3.0.0 convention? I'm not talking about the homie-esp8266 3.0 library version, I just need the current library features but compatible with Homie 3.0 convention.

Thanks for your hard work and best regards,

Aitor

bodiroga avatar Oct 15 '18 10:10 bodiroga

Hi again @timpur!

I have created a branch in my own fork repository and I have adapted the library to comply to the latest Homie 3.0.0 version. I have done this for my own personal use, but I will be more than happy to make a PR and contribute back to the amazing work that you and @marvinroger have done! Here you have a link to my repository branch:

https://github.com/bodiroga/homie-esp8266/tree/develop-v3

Do you want me to make a PR against the 'develop' branch of the repository?

Many thanks again for all your help and best regards,

Aitor

bodiroga avatar Oct 19 '18 12:10 bodiroga

Hi @bodiroga Thank you for your work. Works fine with the Openhab 2.4 Snapshot-MQTT binding (saw you there too).

MT

MajorTwip avatar Oct 27 '18 15:10 MajorTwip

Hi @bodiroga Please, open a PR. I’ll take a look and merge. :)

marvinroger avatar Oct 29 '18 08:10 marvinroger

Hi @marvinroger!

Reading more carefully the Homie 3.0 specification, I have realized that my implementation of Node Arrays is wrong :disappointed: The array definition has changed significantly, so I need to adapt the library first before submitting the PR. Let's see if the changes are easy, because my C++ skills are very basic :+1:

Best regards,

Aitor

bodiroga avatar Oct 29 '18 11:10 bodiroga

It's me again @marvinroger :wink:

Is it true that in the Homie 3.0 version the Node is what can be an array, whereas in the 2.0.1 version it was a property field? The array definition is the worst explained thing in Homie, I should open an issue in the convention repository to improve the documentation (https://homieiot.github.io/spec-core-latest/#arrays). Argh, and the callback mechanism for the settable attribute must be changed also. Step by step.

Let's start clarifying if the _range attribute and isRange() method should be moved from the Property class to the HomieNode class :+1:

bodiroga avatar Oct 29 '18 12:10 bodiroga

@bodiroga it is true. It just felt more natural to have node arrays, rather than properties arrays. 😉

marvinroger avatar Oct 29 '18 15:10 marvinroger