Atag One support via Homie/MQTT thing

Hi @ArdKuijpers,

There’s been a major update to pydantic. As a matter of fact, the atag one library does not run anymore.

Traceback (most recent call last):
  File "/opt/atagone-mqtt-bridge/app.py", line 5, in <module>
    from atagmqtt.atag_interaction import main
  File "/opt/atagone-mqtt-bridge/atagmqtt/atag_interaction.py", line 8, in <module>
    from .device_atagone import DeviceAtagOne
  File "/opt/atagone-mqtt-bridge/atagmqtt/device_atagone.py", line 17, in <module>
    from .configuration import Settings
  File "/opt/atagone-mqtt-bridge/atagmqtt/configuration.py", line 4, in <module>
    from pydantic_settings import BaseSettings
ModuleNotFoundError: No module named 'pydantic_settings'

Any chance you have time to update your library?

Thanks,
Florian

I will update as soon as I have a chance. In the meantime I suppose you could install an older version of the pydantic module to get things running. Alternatively, you could use the docker image of you are familiar with docker.

Hi Ard,

tried to build the docker image on a Rpi4 without success:

 > [builder 1/5] RUN apt-get update     && apt-get install gcc=4:10.* git=1:2.* -y     && apt-get clean:
1.713 exec /bin/sh: exec format error
------
Dockerfile:6
--------------------
   5 |     FROM base as builder
   6 | >>> RUN apt-get update \
   7 | >>>     && apt-get install gcc=4:10.* git=1:2.* -y \
   8 | >>>     && apt-get clean
   9 |     COPY requirements.txt /app/requirements.txt
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update     && apt-get install gcc=4:10.* git=1:2.* -y     && apt-get clean" did not complete successfully: exit code: 1

There is no need to build it yourself. It is on the Docker hub: ATAG MQTT bridge docker.

Hi @Ltty,

I’ve updated the Dockerfile and fixed the code so it runs with a recent version of pydantic-settings. So everything should be working either directly in Python on your RPi or in a self built Docker container.

1 Like

Amazing, thank you. Sorry for being such a pain in the ass :smiley:

Hi @ArdKuijpers,

I’m recently seeing the following warnings in OpenHab

2024-01-19 11:54:19.392 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command 'manual' from channel 'mqtt:homie300:2a29288b20:atagone:centralheating#mode' not supported by type 'TextValue': Value manual not within range
2024-01-19 11:54:19.398 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command 'manual' from channel 'mqtt:homie300:2a29288b20:atagone:controls#ch_2Dmode' not supported by type 'TextValue': Value manual not within range

Any idea what this means?

Thx,
Florian

Hi @Ltty,

I have no idea and cannot reproduce that. Those channels work fine here. What version of Openhab are you running?

I found the issue, can’t explain the root cause though.

What I see in the mqtt format is that available values are: manual,automatic,vacation,extend,fireplace
In Openhab I however see Auto,away,Extend,Manual,boost in the channel configuration.

I updated the channel configuration to match the mqtt format and the warning is gone.

Hey @ArdKuijpers,

is the library also intended to update the ATAG One unit (e.g. changing target temperature, changing the mode) and if so, how because changing the mode do vacation or fireplace requires additional parameters like the duration.

Thanks,
Florian

Yes, you can set the target temperature for both central heating and domestic hot water. You can also set the central heating mode (manual, automatic, vacation, extend, fireplace). However setting the additional parameters is not supported. This is because the underlying python library pyatag has no support for this.

Thanks, figured it out via the control channel. However, changing any values triggers an exception.

Error when trying to change the mode:

Apr 25 09:32:56 openhabian atagone2mqtt[2474522]:     self.mqtt_subscription_handlers[topic](topic, payload)
Apr 25 09:32:56 openhabian atagone2mqtt[2474522]:   File "/opt/atagone2mqtt/.venv/lib/python3.12/site-packages/homie/node/property/property_base.py",>
Apr 25 09:32:56 openhabian atagone2mqtt[2474522]:     self.process_set_message(topic, payload)
Apr 25 09:32:56 openhabian atagone2mqtt[2474522]:   File "/opt/atagone2mqtt/.venv/lib/python3.12/site-packages/homie/node/property/property_base.py",>
Apr 25 09:32:56 openhabian atagone2mqtt[2474522]:     self.set_value(value)  # call function to actually change the value
Apr 25 09:32:56 openhabian atagone2mqtt[2474522]:     ^^^^^^^^^^^^^^^^^^^^^
Apr 25 09:32:56 openhabian atagone2mqtt[2474522]:   File "/opt/atagone2mqtt/atagmqtt/device_atagone.py", line 210, in set_ch_mode
Apr 25 09:32:56 openhabian atagone2mqtt[2474522]:     self._async_to_sync(self._async_set_ch_mode(value))
Apr 25 09:32:56 openhabian atagone2mqtt[2474522]:     ^^^^^^^^^^^^^^^^^^^
Apr 25 09:32:56 openhabian atagone2mqtt[2474522]: AttributeError: 'DeviceAtagOne' object has no attribute '_async_to_sync'

Error when trying to change target temperature:

2025-04-25 09:47:28,119 [INFO] atagmqtt.device_atagone - Setting target CH temperature from 19.5 to 18.0 °C
2025-04-25 09:47:28,119 [ERROR] homie.mqtt.mqtt_base - on_message error There is no current event loop in thread 'Thread-1 (_thread_main)'.
Traceback (most recent call last):
  File "/opt/atagone2mqtt/.venv/lib/python3.12/site-packages/homie/mqtt/mqtt_base.py", line 91, in _on_message
    device.mqtt_on_message(topic, payload, retain == 1, qos)
  File "/opt/atagone2mqtt/.venv/lib/python3.12/site-packages/homie/device_base.py", line 300, in mqtt_on_message
    self.mqtt_subscription_handlers[topic](topic, payload)
  File "/opt/atagone2mqtt/.venv/lib/python3.12/site-packages/homie/node/property/property_base.py", line 218, in set_message_handler
    self.process_set_message(topic, payload)
  File "/opt/atagone2mqtt/.venv/lib/python3.12/site-packages/homie/node/property/property_base.py", line 226, in process_set_message
    self.set_value(value)  # call function to actually change the value
    ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/atagone2mqtt/atagmqtt/device_atagone.py", line 176, in set_ch_target_temperature
    _async_to_sync(self._async_set_ch_target_temperature(value))
  File "/opt/atagone2mqtt/atagmqtt/device_atagone.py", line 268, in _async_to_sync
    loop = asyncio.get_event_loop()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/openhabian/.pyenv/versions/3.12.0/lib/python3.12/asyncio/events.py", line 698, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'Thread-1 (_thread_main)'.

Any idea what I am missing?

@ltty You missed nothing. I apparently missed two bugs when I refactored the code recently :blush:. They are fixed now. See the github repo for the latest version.

1 Like

Hey @ArdKuijpers, trust you are fine. Since one of the latest updates, I see some weird spikes in the graph. Just wondering if you have a clue where they come from. I can confirm that the target water temp does not drop to 10.

I know someone with an ATAG boiler who would love to interface it to OH but we’re not sure what the model number is for the thermostat that we would need to install. Can anyone tell me what we need to get? Google gives me links to the Atag OneZone manual but I can’t find a link to buy one in the UK.

Could someone post a screenshot of what their Atag MQTT thing looks like please? I’ve looked at the code of the atagone2mqtt app and it looks like it provides the channels I’m interested in but I can’t tell whether the flame value is an on/off (the boiler is flame is on or it’s not) or it’s a modulation percentage, i.e. the boiler is producing heat at x% of its total capacity.

I’d like to implement weather compensation for the central heating so I’d like to be able to set the CH water setpoint and the DHW setpoint and also view the CH return temperature and the burner power.

Here is a screenshot from my MQTT Explorer where you see the topics …/burner/modulation and …/centralheating/status:

The burner/modulation is an integer that should reflect the % (integer betwen 0-100) of the burner capacity that is currently used. The centralheating/status is a boolean that reflects whether the burner is currently being used for the central heating.

You say you are trying to implement weather compensation, but as I understand, the AtagOne thermostat can/does already do that if you configure Operating mode: Weather dependent in the Atag One portal/app:

1 Like

Thank you very much for your reply :+1:t2: