aglehmann / pyEcovent

Python library for Vents / Blauberg energy recovery ventilators
MIT License
22 stars 12 forks source link

Python Version #6

Open mhbosch opened 4 years ago

mhbosch commented 4 years ago

Hello,

i have found this helpfull programm for openhab and can make first actions. But i wonder about "python_requires='>=3.6.7'," Openhab use at time a version less than 3.6.7. But i can use the library without errors. How is 3.6.7 necessary for installation (autoinstall with PIP3 make a break)?

With regards,

Michael H. Bosch

aglehmann commented 4 years ago

Hi Michael, The reason why version requirements has been set to >=3.6.7 is because I am lazy. I didn’t test the code with any other (older or newer) versions of Python, so I simply set it to the version I used while developing and that Home Assistant was using at that time. Is this causing any issues for you with openhab?

mhbosch commented 4 years ago

Hello Aleksander,

thanks for the response and Happy Easter.

The Problem is only in the installprocess. The openhab integrate an older version on Python3 (3.5.3). I cant install with pip3. I have install it handmade and use the Fan.py to learn about it. Sorry, im a Python newbie, i can read lot of the source, but not all.

In future, i want to receive the status (i dont know, is there auto update or only by trigger). So i will set in openhab command e.g. its the humidity to high, start the vent, but at night only slow and when outside to cold with heating., A Dream is the mqtt integration. I will test many new inspiration.

With regards,

Michael

Am Mo., 13. Apr. 2020 um 12:07 Uhr schrieb Aleksander Lehmann < notifications@github.com>:

Hi Michael, The reason why version requirements has been set to >=3.6.7 is because I am lazy. I didn’t test it for any other (older or newer) versions of Python, so I simply set it to the version I used while developing and that Home Assistant was using at that time. Is this causing any issues for you with openhab?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aglehmann/pyEcovent/issues/6#issuecomment-612838720, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD7K4JWM5HSK4MW3OWIMGWTRMLP7PANCNFSM4MF77NYQ .

aglehmann commented 4 years ago

Hi, The python library probably works fine with python 3.5.3, I'll see I get the time to test it out. That said, it seems that most integrations (maybe all) for OpenHab are Java based, so it might be easier just to re-write the entire thing in Java to make i OpenHab native compatible. (or switch to Home Assistant, which is really awesome)

The fan do not send out any status messages, you need to pull that from the device. There is a specific hex code you need to send to the fan to make it return all current values. The "update" function does exactly this. In Home Assistant this is handled by HA it self by setting this: @property def should_poll(self): """Enable polling of the device.""" return True

MQTT integration might be a future feature, but since I'm using Home Assistant and their implementation of a "MQTT Fan" does not support fan modes I don't think I'll be working on that in the near future.

Let me know if you you have questions and I'll answer as best as I can.

Regards, Aleksander

mhbosch commented 4 years ago

Hi Aleksander,

i have a very very First version of a mqtt Bridge for your Script. At this time, i make tried to make it stable for polling (it works, 15 second). I test with the proof of concept for timeouts (how many timeouts, update every cycle or only by datachanges etc.) In a second steps i will include the other way, to make changes on the vent.

When you are interested, i will send you the "snippet" or later a (for me stable) version. Perhaps we can merge the codes, and include more settings (e.g. the NightMode or PartyMode, warnings). All this information a prepares, but not include in your script (but i really love it).

Best wishes, be healthy,

Michael

Am Mi., 15. Apr. 2020 um 16:52 Uhr schrieb Aleksander Lehmann < notifications@github.com>:

Hi, The python library probably works fine with python 3.5.3, I'll see I get the time to test it out. That said, it seems that most integrations (maybe all) for OpenHab are Java based, so it might be easier just to re-write the entire thing in Java to make i OpenHab native compatible. (or switch to Home Assistant, which is really awesome)

The fan do not send out any status messages, you need to pull that from the device. There is a specific hex code you need to send to the fan to make it return all current values. The "update" function does exactly this. In Home Assistant this is handled by HA it self by setting this: @Property https://github.com/Property def should_poll(self): """Enable polling of the device.""" return True

MQTT integration might be a future feature, but since I'm using Home Assistant and their implementation of a "MQTT Fan" does not support fan modes I don't think I'll be working on that in the near future.

Let me know if you you have questions and I'll answer as best as I can.

Regards, Aleksander

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aglehmann/pyEcovent/issues/6#issuecomment-614087329, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD7K4JVYI3QFIIY2B2TR4DDRMXC37ANCNFSM4MF77NYQ .

mhbosch commented 4 years ago

Hi Aleksander,

i have finish a first beta. You will find it under: https://github.com/mhbosch/vent_to_mqtt

Am Mi., 15. Apr. 2020 um 17:51 Uhr schrieb Michael H. Bosch < poststelle@michael-h-bosch.de>:

Hi Aleksander,

i have a very very First version of a mqtt Bridge for your Script. At this time, i make tried to make it stable for polling (it works, 15 second). I test with the proof of concept for timeouts (how many timeouts, update every cycle or only by datachanges etc.) In a second steps i will include the other way, to make changes on the vent.

When you are interested, i will send you the "snippet" or later a (for me stable) version. Perhaps we can merge the codes, and include more settings (e.g. the NightMode or PartyMode, warnings). All this information a prepares, but not include in your script (but i really love it).

Best wishes, be healthy,

Michael

Am Mi., 15. Apr. 2020 um 16:52 Uhr schrieb Aleksander Lehmann < notifications@github.com>:

Hi, The python library probably works fine with python 3.5.3, I'll see I get the time to test it out. That said, it seems that most integrations (maybe all) for OpenHab are Java based, so it might be easier just to re-write the entire thing in Java to make i OpenHab native compatible. (or switch to Home Assistant, which is really awesome)

The fan do not send out any status messages, you need to pull that from the device. There is a specific hex code you need to send to the fan to make it return all current values. The "update" function does exactly this. In Home Assistant this is handled by HA it self by setting this: @Property https://github.com/Property def should_poll(self): """Enable polling of the device.""" return True

MQTT integration might be a future feature, but since I'm using Home Assistant and their implementation of a "MQTT Fan" does not support fan modes I don't think I'll be working on that in the near future.

Let me know if you you have questions and I'll answer as best as I can.

Regards, Aleksander

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aglehmann/pyEcovent/issues/6#issuecomment-614087329, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD7K4JVYI3QFIIY2B2TR4DDRMXC37ANCNFSM4MF77NYQ .

gavlexx commented 4 years ago

Hi, Aleksander,

MQTT integration might be a future feature, but since I'm using Home Assistant and their implementation of a "MQTT Fan" does not support fan modes I don't think I'll be working on that in the near future.

How do you use your code with Home Assistant?

gavlexx commented 4 years ago

Hi, Michael

i have finish a first beta. You will find it under: https://github.com/mhbosch/vent_to_mqtt

Can you write a bit how to use your MQTT bridge with Home Assistant? A bit more than already described in readme on GitHub, pls.

mhbosch commented 4 years ago

Hi Aleks,

i dont use the bridge with Home Asisstant (google, right?). The Bridge is only a converter, to realize a connection to other Homesystem via MQTT. I use Openhab. Openhab have a connector to Google Home Assistent (i try it maybe later, when i have s stable system with all my items). But many other System can make a connect to MQTT.

1) My script send a polling to the vent and became the status. 2) The Status will it send (if will be a change) to the MQTT. 3) The MQTT send the status to all system, who have a descripe to the Vent status. 4) The MQTT have a command topic, when a other system send a command on this topic, the vent Script receive it and will send the change to the vent.

It will work for me. At this time a have two little issue.

1) The Script will dont accept changes from other system like Wifi App or IR Remote 2) if the MQTT Broker down, i lost the command channel.

I hope, this information will help you!

aglehmann commented 4 years ago

Hi, Aleksander,

MQTT integration might be a future feature, but since I'm using Home Assistant and their implementation of a "MQTT Fan" does not support fan modes I don't think I'll be working on that in the near future.

How do you use your code with Home Assistant?

I use it in form of a custom component as described here: https://github.com/aglehmann/home_assistant_ecovent

aglehmann commented 4 years ago

Hi Aleksander, i have finish a first beta. You will find it under: https://github.com/mhbosch/vent_to_mqtt Am Mi., 15. Apr. 2020 um 17:51 Uhr schrieb Michael H. Bosch < poststelle@michael-h-bosch.de>: Hi Aleksander, i have a very very First version of a mqtt Bridge for your Script. At this time, i make tried to make it stable for polling (it works, 15 second). I test with the proof of concept for timeouts (how many timeouts, update every cycle or only by datachanges etc.) In a second steps i will include the other way, to make changes on the vent. When you are interested, i will send you the "snippet" or later a (for me stable) version. Perhaps we can merge the codes, and include more settings (e.g. the NightMode or PartyMode, warnings). All this information a prepares, but not include in your script (but i really love it). Best wishes, be healthy, Michael Am Mi., 15. Apr. 2020 um 16:52 Uhr schrieb Aleksander Lehmann < @.***>: > Hi, > The python library probably works fine with python 3.5.3, I'll see I get > the time to test it out. That said, it seems that most integrations (maybe > all) for OpenHab are Java based, so it might be easier just to re-write the > entire thing in Java to make i OpenHab native compatible. (or switch to > Home Assistant, which is really awesome) > > The fan do not send out any status messages, you need to pull that from > the device. There is a specific hex code you need to send to the fan to > make it return all current values. The "update" function does exactly this. > In Home Assistant this is handled by HA it self by setting this: > @Property https://github.com/Property > def should_poll(self): > """Enable polling of the device.""" > return True > > MQTT integration might be a future feature, but since I'm using Home > Assistant and their implementation of a "MQTT Fan" does not support fan > modes I don't think I'll be working on that in the near future. > > Let me know if you you have questions and I'll answer as best as I can. > > Regards, > Aleksander > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <#6 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/AD7K4JVYI3QFIIY2B2TR4DDRMXC37ANCNFSM4MF77NYQ > . >

Cool! It looks good.

I am no programmer by any means but wouldn't it be easier for you to just import the library, create a "Fan" object and use that instead of replicating the code? It's pretty much the same as I have shown in the readme. Or do you have special requirments? I havent thoroughly reviewed your code but it seems you havent added any of functionality missing from my library.

mhbosch commented 4 years ago

Hey,

i dont use all the library. When i use the library, it will often close/open the port to the vent, because the script poll the Vent evers 5 seconds. In my script the port is alltime open for connecting. I use part of your script, to control the connection und parsing.

I see, Home Assistent is not google Home ;-) I use Openhab, but my code make a mqtt bridge, so you can use it with Home Assistent.