Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

[WIP] Homie v3.0.0 #47

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open

Conversation

bodiroga
Copy link
Contributor

@bodiroga bodiroga commented Oct 7, 2018

Hi @jalmeroth!

This PR is a WIP to update the library to the latest Homie version: 3.0.0. https://github.com/homieiot/convention

Even if it is WIP, I have updated all the example files to the new API and in my preliminary test everything works fine 👍 But I would like to know for opinion about the new class names and functions. Don't hesitate to suggest or criticize whatever you want 😝

Best regards,

Aitor

@jalmeroth
Copy link
Owner

Hi Aitor,

wow impressive work, once again! Have you seen my efforts in dev from 8 months ago? It might makes more sense to merge your changes here.

Let me know what you think.

Best regards,
Jan

@bodiroga
Copy link
Contributor Author

bodiroga commented Oct 19, 2018

Hi Jan (@jalmeroth)!

Sorry, but I'm not sure if I have understood what you mean. Do you want me to make my changes against your dev branch? I don't know if that's going to be easy 😞 Anyway, we should talk about how to handle this situation: what Homie version should we support in the library? Homie v2? Homie v3? Both at the same time? What's the best way to deal it? Two repositories and two libraries (homie-python and homie3-python)? Everything in the same repository? What about the "pip" installation process? How can that be managed?

I think that I will wait until we decide something about this before changing anything in the PR 😉

Best regards!

Aitor

@bodiroga
Copy link
Contributor Author

Hi @jalmeroth!

I have made a new commit to update the library to Homie 3.0.1 (they have introduced a new "$retained" attribute to the properties to make them stateless) and have added two new examples.

Let me know how do you want to address the different versions of the library (Homie 2 and Homie 3) and looking forward to seeing the library marked as stable 😉

Best regards

Aitor

@esdeboer
Copy link

esdeboer commented Jan 5, 2019

Hi @bodiroga,

Shouldn't the isValidFormat check in helper.py check for none for everything except enum and color, as the format is not required for the other datatypes? (or is it because of my old python 3.4 on my pi that I get a WARNING:homie.property:'None' is not a valid format for float)

Regards,
Eric

@stefanroellin
Copy link

I have tested the branch and have found the following issues:

  1. in the 3.0 specification "$online" is not used anymore, however there are still updates to this topic. Should probably be replaced with "$state".
  2. during startup there is a warning that the deviceId is invalid, (since it is set to "None" in __init__)
  3. personally I am not interested in the "signal" topic. Hence a possibility to exclude it would be good.

Thanks for your work!

@rafdaems
Copy link

Thank you very much for this fork.
My openhab installations seems to autodetect mqtt subscribers created by your framework.

One question:
I don't understand the implementation of "settable".
see: https://homieiot.github.io/specification/
under 6.4.1 properties.

pls advise ?

@ababilone
Copy link

Hi there,

Any news on this subject ? I'm also working on an OpenHAB 2.4 integration and this 3.0 binding is just what It needs. The work done by @bodiroga looks awesome.

Do you plan to merge it someday ?

Thanks for any feedback!

@bodiroga
Copy link
Contributor Author

Hi guys!

Shouldn't the isValidFormat check in helper.py check for none for everything except enum and color, as the format is not required for the other datatypes?

Fixed @esdeboer!

  1. in the 3.0 specification "$online" is not used anymore, however there are still updates to this topic. Should probably be replaced with "$state".

Fixed @stefanroellin!

  1. during startup there is a warning that the deviceId is invalid, (since it is set to "None" in init)

Fixed!

  1. personally I am not interested in the "signal" topic. Hence a possibility to exclude it would be good.

Yeah, you are right, but as Homie 4 is going to completely remove the "stats" information, I'm going to keep it for now. It doesn't cause any harm and someone can find it useful 😉

pls advise ?

Hi @rafdaems! Could you please be more specific? I need to know first what is what you don't understand? 👍

Please, test the new changes and report if you find any error! Thanks for you help! 👍

Best regards,

Aitor

@esdeboer
Copy link

Thanks for the fixes Aitor, looks good.
I don't get the deviceId warning anymore and I can add properties with a datatype without format.

@Kixunil
Copy link

Kixunil commented Mar 31, 2019

Hi, thanks a lot for this code! I used it for solight-homie and it works with OpenHAB. It's very nice how easily I could create a plugin for OpenHAB using this code.

@stedon81
Copy link

stedon81 commented Apr 6, 2019

Hi,
I experienced some hang up issues with this homie implementation in this branch. Is it possible, that this library is not thread-safe? From my code, it looks like different threads would block each other if they try to do update or read operations at the same time.
Regards,
stedon81

@stedon81
Copy link

stedon81 commented Apr 6, 2019

OK, I found the answer - it's not homie, but the underlying paho mqtt library which is not thread safe:
eclipse-paho/paho.mqtt.java#453 (comment)
Nevermind, sorry to have bothered :-)

@mjcumming
Copy link

I have put together a python library for Homie 3 that I would like some feedback on. You can get it here

https://pypi.org/project/Homie3/

Mike

@yozik04
Copy link

yozik04 commented May 7, 2019

I think this pull request needs to land to a separate repo and produce a separate pip package.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants