Giter Site home page Giter Site logo

comfospottwin40's People

Contributors

dependabot[bot] avatar rubenbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

comfospottwin40's Issues

Integration of a WIFI SmartControl Hub - easier?

Hello Ruben,

it might be easier to use Getair's WIFI SmartControl Hub and integrate an IoT device through it. (I'm following your work excitedly and eager to see a solution. I would love to use your work later to integrate my ComfoSpot into KNX).

Greetings,
Sven

Manufacturer (Getair)(LED-, Touch- and Wifi-Control)
https://www.getair.eu/en/control-unit/app-and-voice-control/

Customer from Getair:
Kermi: (LED-, Touch- and Wifi-Control)
https://www.kermi.de/raumklima/produkte/wohnraumlueftung/dezentrales-system/
ZewoTherm (LED-, Touch- and Wifi-Control)
https://www.zewotherm.com/de/produkte/wohnraumlueftung/dezentrale-wohnraumlueftung/lueftungsgeraete-smart-steuern.html
Zehnder: (LED- and Touch-Control)
https://www.zehnder-systems.de/produkte-und-systeme/komfortable-wohnraumlueftung/comfospot-twin40

Hardware address of waveshare adapter after reboot

I run two waveshare adapters on one raspberry pi and noticed that the assignment of the device address after a reboot is random. This is unfortunate as the assigned hardware might get swapped after a reboot.

I have no fix yet but assigning persistent device names on system level might solve this:
https://rolfblijleven.blogspot.com/2015/02/howto-persistent-device-names-on.html

Is there an easier way to connect to the serial adapter? e.g. by serial number instead of the device address?

Serial Exception: read failed

About once per week I get the following exception causing the script to stop.
I suppose this is a system error (it did not happen on my first setup on a Raspberry Pi Zero. The current setup is Raspberry Pi 5, 2x Docker container and 2x serial hardware both containers reporting to two separate MQTT broker.

Is it possible to catch this error (e.g. like that: https://forums.raspberrypi.com/viewtopic.php?t=201976#p1256252) or at least cause the container to exit that it can restart properly? Current situation is that this error does not trigger a restart. My current workaround would be to schedule a restart every day.

ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-22' coro=<Mqtt.listen() done, defined at /comfospot/comfospot40/mqtt.py:30> exception=MqttError('Disconnected during message iteration')>
Traceback (most recent call last):
  File "/comfospot/comfospot40/mqtt.py", line 32, in listen
    async for message in messages:
  File "/usr/lib/python3.11/site-packages/aiomqtt/client.py", line 684, in _generator
    raise MqttError(msg)
aiomqtt.error.MqttError: Disconnected during message iteration
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/serial/serialposix.py", line 500, in read
    raise SerialException(
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/comfospot/server.py", line 103, in <module>
    asyncio.run(
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/comfospot/server.py", line 46, in main
    state = x.result()
            ^^^^^^^^^^
  File "/comfospot/comfospot40/parser.py", line 86, in run
    self.parserdata, self.parserstate = await self.parserstate(self.parserdata)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/comfospot/comfospot40/parser.py", line 58, in search_preamble
    readbyte = await self._ser.read(1)
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/streams.py", line 693, in read
    await self._wait_for_data('read')
  File "/usr/lib/python3.11/asyncio/streams.py", line 525, in _wait_for_data
    await self._waiter
  File "/usr/lib/python3.11/site-packages/serial_asyncio/__init__.py", line 115, in _read_ready
    data = self._serial.read(self._max_read_size)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/serial/serialposix.py", line 509, in read
    raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

Thank you very much

Documentation of installation process for beginners

This is a more detailed Documentation to get the code running.
Disclaimer: currently it looks like only one sensor per bus is supported.

  1. Buy exactly the adapter as described. Others do not seem to work. (The internal jumper was already correctly set to NC in my case - so no need to open the device)
  2. I tested the code on a raspberry pi with latest os and on macOS Sonoma
  3. make sure python and pip is installed
  4. clone the repository: git clone https://github.com/rubenbe/comfospottwin40
  5. go to the project folder
  6. install the requirements: pip install -r requirements.txt
  7. install the project: python setup.py install

Now everything should be ready.

  1. launch the server: python3 server.py --mqtt 'xxx.xxx.xxx.xxx' while xxx is the IP address of the mqtt broker. in my case the mqtt plugin of IOBroker.
    I did not have success to pass a URI. I therefore had to setup the broker without username and password and stick to the default port 1883. (solved with latest update. you can define a port)
    The server then posts its state every second in the terminal:
    ❶: 🔀🏠➡️ ⏸️ 0s (100 ma)🌡️ ____C, __% ♻️ ____C, __%; ❷: 🔀🏠⏸️ ⏸️ 0s (100 ma)🌡️ ____C, __% ♻️ ____C, __%; ❸: 🔀🏠⏸️ ⏸️ 0s (100 ma)🌡️ ____C, __% ♻️ ____C, __%

You should be able to change the setting from the mqtt broker. If not make sure that all MQTT-Topics are set correctly. Empty topics "(null)" might cause issues and the server will not accept commands from MQTT).

  1. connect the waveshare adapter.
    At least for the Xwell d12 you have to switch the wires of the bus relative to the original controller. A=B and B=A
  2. get the address with ls /dev/tty* (might be different depending on system) for me it was /dev/ttyUSB0
  3. disconnect the original controller (switching off is not sufficient) and start the real test:
    python3 server.py --mqtt 'xxx.xxx.xxx.xxx' --dev /dev/ttyUSB0 --state state.json
  4. run the server as a service in order to launch directly after a reboot

Reasonable preset of MQTT topics

After I moved my installation to docker containers I almost gave up because I did not get it working. Reason for the system not working was wrong strings in the MQTT. After installation lots of settings like e.g. speed come with "(null)". If you do not change these to the expected values the server will not accept any changes from MQTT at all.

Is it possible to directly set all MQTT topics to a working preset?

Add system name as parsed argument on startup

I will go "all in" and install another 5 fans which means I need a second controller for the 2nd floor of the building.
I now run into the issue that both instances will post the same mqtt topics "comfospot40".
therefore the feature request to parse the system name as argument of server.py e.g. --name.

If I read the code right it would just be changing line 10 in "mqtt.py" ?!

Workarround would be a second mqtt adapter in IOBROKER reachable under a different port. However, last time I checked I was not able to pass a port to the mqtt IP in the form xxx.xxx.xxx.xxx:port and only the standard port was working.

Thanks for the support.

Viessmann Vitovent 050-D

Just in case this helps somebody. I’m pretty sure that this system is also compatible.
I am not able to test.

More info on installation please

Hi this looks really cool and I will try to implement this for x-well d12
Can you give some more details (I have only about a year experience with IOBroker etc.) on:

  1. why is there the dependency on home assistant? I assume an mqtt broker in IOBroker would also work?
  2. is this running on a Linux-based raspberry pi? This is my plan but I am afraid of driver issues for the required hardware…
    Thank you very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.