Closed Wummeke closed 5 years ago
CC @mvn23
This looks like a connection issue to me. A few things you can try to confirm/troubleshoot this:
telnet 192.168.0.6 6638
Edit: make sure Home Assistant is not running.screen
or a similar program (baud rate 9600). The thermostat and boiler don't need to be connected to the gateway.In the first scenario, you should see a few lines of 9 characters each appearing roughly every second. If not, try typing PS=0
and hit enter. If the lines start with an E
there is an issue with the gateway device or config and you may want to try the troubleshooting from the OpenTherm Gateway website. If the lines don't have 9 characters each or appear garbled, there may be an issue with the ser2net config. Please configure ser2net to comply with the serial port specifications from the OpenTherm Gateway website. This is what I use in ser2net.conf
for local testing on port 8802:
127.0.0.1,8802:raw:0:/dev/otgw:9600 NONE 1STOPBIT 8DATABITS XONXOFF LOCAL -RTSCTS
In the second scenario, if the thermostat and boiler are not connected, you should see the line E00000000
appear every second IIRC. If not, try the PS=0
or PS=1
commands and post the output.
Seems like I have an issue in the combination of Home Assistant, my NodeMCU/OTGW and my Google Home mini. I just accidentally discovered that when I have my Google Home mini unplugged and reboot Home Assistant, the connection between HA and the NodeMCU/OTGW stays OK, until I plug my GHM back in. Not sure why this is happening and I am a bit puzzled, because OTmonitor (which also runs from a Docker container on the same host as Home Assistant) doesn't have this issue, it stays connected with the NodeMCU/OTGW (although it is now turned off, because I first that that was blocking HA from connecting to the NodeMCU/OTGW).
I had IP reservations on the DHCP server for all the mentioned devices. I have removed the DHCP address reservation for the Google Home Mini on my router and it seems that it solved the issue (for now).
But I have another question: is it possible that the OTGW component reconnects itself after it got disconnected? Or let it at least attempt to reconnect? Now I have to restart HA completely to achieve that.
Automatic reconnection may be added in a future release, but it is quite low on my to-do list. In it's normal config, the gateway is a serial device that may be connected through a serial-to-USB interface, so any disconnect or intermittent connection would be considered an abnormality. Using ser2net is a way to make the setup more versatile, but as you noticed it is definitely not perfect. For a more stable connection I can only recommend to use a wired network connection rather than wifi. In my production setup I have the gateway connected to a DreamPlug which is forwarding the serial connection over gigabit wired ethernet to my Home Assistant instance. This has been running stable for weeks now.
@mvn23 Hopefully you can move it up on your to-do-list a little someday. I don't have the possibility to connect the OTGW wired to my Home Assistant instance unfortunately. Thanks for the time and effort you've put in this component. Too bad I can't use at this moment.
I'll chime in here - I have an OTGW with an ESP8266 using a software serial build I made and have otmonitor talking to it for more than a year. Reasoning for that setup is in the repo description.
I had to build a wrapper script around otmonitor because I suspect otmonitor isn't queueing commands and sometimes HASS will send a command to otmonitor while it's already sending a command to the OTGW and that freezes/breaks otmonitor. So I've also scripted a restart of otmonitor in case it isn't replying to commands that are being sent.
As for the usage in HASS, I don't have a physical thermostat so my OTGW is in "standalone" mode. I send CH=1
if my HASS rules determine that there's a need to heat the house/rooms, and CH=0
when heat demand has been met. I also set the setpoint CS
, modulation MM
and occasionally hot water setpoint SW
. I've also set up a binary sensor that sends periodic PR=A
requests to determine whether if the OTGW connection is still alive.
I'd gladly dump otmonitor, but since the OTGW is really a critical component, controlling it has to be reliable and fault-tolerant. Having the heater on for too long has really bad effects :)
@WumsWatchFace this may be related, Google Home devices seem to be affected as well. However, firmware should have been updated automatically already.
@infernix your setup will not be officially supported as you're looking to replace your thermostat rather than control it. However, when I start working on the implementation of services I will take it into consideration while deciding which commands to implement.
I am also running my OTGW with a NodeMCU and am trying to connect it to Home Assistant. From my windows machine, OTmonitor works perfectly. I can ping the NodeMCU from the Hass.io docker instance. However, the component does not work. I have no Google home appliances running.
In the log the following is mentioned:
2018-10-16 22:17:04 WARNING (MainThread) [homeassistant.components.climate] Setup of platform opentherm_gw is taking over 10 seconds.
2018-10-16 22:17:06 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 352, in _async_add_entity
await entity.async_added_to_hass()
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/climate/opentherm_gw.py", line 66, in async_added_to_hass
await self.gateway.connect(self.hass.loop, self._device)
File "/usr/local/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 55, in connect
await self.get_reports()
File "/usr/local/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 170, in get_reports
OTGW_DEFAULT_TIMEOUT, loop=self.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 362, in wait_for
raise futures.TimeoutError()
concurrent.futures._base.TimeoutError
@fmslottje I have set up a docker container with hass.io just now for testing and I can't reproduce your issue so far.
It did give me the opportunity to look around in the hass.io environment a bit. Try to connect to your gateway from the command line within the docker container using nc <host> <port>
. If that produces output, then please post a part (~20-30 lines) of the output you get. If you don't get any output, even after resetting the gateway, then it is definitely a connection issue (firewall/nat/routing/etc.)
@mvn23 Hi, little bit off-topic to the problem but i am looking for a tutorial to what to buy and how to set it up. i want to control my heating with Home Assistant. Could not find it anywhere else and you seem very knowledgeable about this:)
@magin1 please direct your question through the Proper Support Channels™
Thanks @mvn23, I have installed the SSH addon and were able to nc, part of the output is as follows (truncated):
B407B0910 A701A0000 T80190000 BC01930B3 T10010A00 BD0010A00 T001B0000 R00740000 BC074FFFF AF01B0000 T000F0000 R80750000 B4075FFFF AF00F0000 T00120000 R80760000 B4076FFFF AF0120000 T80000200 B40000200 T80190000 BC01930B3 T10010A00 BD0010A00 T00110000 BC0110000 T001B0000 R00770000 BC077FFFF AF01B0000 T80190000 BC01930B3 T10010A00 BD0010A00 T80000200 B40000200
Is that the actual format or does it print each message on its own line? You can use code blocks to preserve formatting by putting a line with three backticks before and after a block of text.
sorry, each message on its own line, like this:
T90394B00
B50394B00
T80190000
B4019389E
T10010A00
BD0010A00
T100E0000
BD00E0000
T00090000
R00770000
BC077FFFF
AC0090000
T80640000
R00780000
BC0785268
A40640000
T80000200
B40000200
T80190000
B40193880
T10010A00
BD0010A00
T00110000
BC0110000
T10181407
BD0181407
T80190000
B40193880
T10010A00
BD0010A00
T90100E00
B50100E00
T9014B417
R80790000
B407958C8
A5014B417
T801C0000
B401C37B3
T80000200
B40000200
T80190000
B40193880
Ok, the connection seems to be fine, so the component 'should' work... If I write something up for you to put in custom_components and try with that, could you then provide me a debug log?
Sure, many thanks for following this up, greatly appreciated!
@fmslottje please put the contents of this repo in your custom_components folder and post a debug log to Hastebin. What this does is override the opentherm_gw climate platform in the Home Assistant release with a custom version which loads a more verbose version of the library that connects to the gateway. It is made for Home Assistant v0.80.x, but should work on earlier versions as well.
I've got a similar issue. The opentherm_gw component cannot connect to my OTGW using a TCP socket. I get the following error:
2018-10-27 09:38:51 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/opentherm_gw.py", line 75, in connect_and_subscribe await gateway.connect(hass.loop, device_path) File "/srv/homeassistant/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 52, in connect await self.get_reports() File "/srv/homeassistant/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 165, in get_reports ret = await self._wait_for_cmd(cmd, value) File "/srv/homeassistant/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 690, in _wait_for_cmd loop=self.loop) File "/usr/lib/python3.6/asyncio/tasks.py", line 362, in wait_for raise futures.TimeoutError() concurrent.futures._base.TimeoutError
To me this looks like a connection issue. The OTGW uses an ESP module loaded with ESP link. This is working for more than a year now. I'm using a python tool that connects to the ESP and publishes values to a MQTT topic. So I know the OTGW should be accessible using python (socket).
I would love to use the opentherm_gw component to get rid of third party tools. Any help would be appreciated.
@mvn23 I have some mixed success now, sometimes it works, sometimes it doesn't, so it's kind of hard to put a finger on the problem.
I found this in the log at a moment in which the climate component didn't load:
2018-10-21 16:11:00 WARNING (MainThread) [homeassistant.loader] You are using a custom component for climate.opentherm_gw which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-10-21 16:11:10 WARNING (MainThread) [homeassistant.components.climate] Setup of platform opentherm_gw is taking over 10 seconds.
2018-10-21 16:11:12 ERROR (MainThread) [custom_components.climate.pyotgw.pyotgw] Timed out waiting for command: PR, value: I. Are you connecting to the OpenTherm Gateway?
2018-10-21 16:11:22 ERROR (MainThread) [custom_components.climate.pyotgw.pyotgw] Timed out waiting for command: PR, value: L. Are you connecting to the OpenTherm Gateway?
2018-10-21 16:11:23 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 352, in _async_add_entity
await entity.async_added_to_hass()
File "/config/custom_components/climate/opentherm_gw.py", line 66, in async_added_to_hass
await self.gateway.connect(self.hass.loop, self._device)
File "/config/custom_components/climate/pyotgw/pyotgw.py", line 57, in connect
await self.get_reports()
File "/config/custom_components/climate/pyotgw/pyotgw.py", line 181, in get_reports
OTGW_GPIO_A_STATE: int(reports[OTGW_REPORT_GPIO_STATES][0]),
KeyError: 'I'
2018-10-21 16:11:33 WARNING (SyncWorker_16) [netdisco.ssdp] Error fetching description at 192.168.1.102
2018-10-21 16:12:24 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
btw, my OTGW is on 192.168.1.109 so the error on 192.168.1.102 seems unrelated
Please post a full log with log level set to debug. Run hass --debug
to enable debug logging globally or put the following in configuration.yaml to debug only the climate component:
logger:
logs:
homeassistant.components.climate: debug
This will be a long log, so please use hastebin or similar.
@silvanverschuur looks like a connection issue indeed. So far I am unable to reproduce any of these issues so it's hard to trace the real problem. Debug logs are welcome though ;)
@mvn23 I've enabled DEBUG logging for the component. This is the log:
2018-10-27 13:22:21 DEBUG (MainThread) [homeassistant.components.climate.opentherm_gw] Added device Thermostat
2018-10-27 13:22:31 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/opentherm_gw.py", line 75, in connect_and_subscribe
await gateway.connect(hass.loop, device_path)
File "/srv/homeassistant/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 52, in connect
await self.get_reports()
File "/srv/homeassistant/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 165, in get_reports
ret = await self._wait_for_cmd(cmd, value)
File "/srv/homeassistant/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 690, in _wait_for_cmd
loop=self.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 362, in wait_for
raise futures.TimeoutError()
concurrent.futures._base.TimeoutError
After this stacktrace nothing is logged anymore. I've also started hass with default logging set to debug but the results were the same (besides a lot of debug information from other components).
So it looks to me that the component completely stops when the OTGW connection cannot be established.
Sorry, I should have specified. Debug logs with the custom_component from here.
@mvn23 The debug log with the custom component adds one stack trace to the log:
2018-10-27 13:42:08 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform opentherm_gw
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/home/homeassistant/.homeassistant/custom_components/climate/opentherm_gw.py", line 40, in async_setup_platform
gateway = OpenThermGateway(config)
File "/home/homeassistant/.homeassistant/custom_components/climate/opentherm_gw.py", line 52, in __init__
self._device = config[CONF_DEVICE]
KeyError: 'device'
2018-10-27 13:42:18 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/opentherm_gw.py", line 75, in connect_and_subscribe
await gateway.connect(hass.loop, device_path)
File "/srv/homeassistant/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 52, in connect
await self.get_reports()
File "/srv/homeassistant/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 165, in get_reports
ret = await self._wait_for_cmd(cmd, value)
File "/srv/homeassistant/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 690, in _wait_for_cmd
loop=self.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 362, in wait_for
raise futures.TimeoutError()
I assume you're running 0.81 here? The custom_component was made for 0.80. I will make one for 0.81 later on. Also, please use code formatting for log dumps by putting the text between lines with three backticks, or even better, use hastebin.
Yes, I'm using 0.81. I'll wait for the 0.81 component.
I have the same issue
2018-10-29 10:40:20 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/app/homeassistant/components/opentherm_gw.py", line 75, in connect_and_subscribe
await gateway.connect(hass.loop, device_path)
File "/usr/local/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 52, in connect
await self.get_reports()
File "/usr/local/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 165, in get_reports
ret = await self._wait_for_cmd(cmd, value)
File "/usr/local/lib/python3.6/site-packages/pyotgw/pyotgw.py", line 690, in _wait_for_cmd
loop=self.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 362, in wait_for
raise futures.TimeoutError()
concurrent.futures._base.TimeoutError
Using this configuration:
logger:
default: debug
logs:
homeassistant.components.opentherm_gw: info
homeassistant.components.climate: info
opentherm_gw:
device: socket://192.168.0.159:6638
climate:
name: Thermostat
precision: 0.5
floor_temperature: False
monitored_variables:
- room_setpoint
- room_temp
- room_setpoint_ovrd
- return_water_temp
- otgw_about
The Opentherm gateway is connected using a nodemcu running ESPEasy which uses ser2net. It does work correctly with the otmonitor. I'm running Home Assistant 0.81.1 using Docker on a Synology DS218+
Yeah exact the same problem here... Same errors, hassio 0.81, OTMonitor.exe does work on ESPEasy with Ser2net....
@mvn23 i just run the debug log with custom component on 0.80 (refrained from updating for now). Hastebin log: https://hastebin.com/huqayebawu.coffeescript
I have also added another wifi access point to my setup (practically next to the OTGW) to make 100% sure that the wifi signal is ok, and at -45db RSSI that should be absolutely fine.
Many thanks for looking into this, much appreciated!
Thanks for the debug log. It is giving me some more insight into what's going on. At a certain point, the gateway stops responding to commands for ~50 seconds, but it keeps on sending reports during this time. Recent versions of the library skip over these unanswered commands with just a log entry, but never recover the missing values. Without a test setup in my dev environment, it will be nearly impossible to track down the exact issue here as there's a whole chain of tools at play (network, serial, etc). One thing I can do about this is add a retry for the failed commands - possibly with a delay - to obtain the missing values, but that feels rather hacky to me.
I'll order a NodeMCU soon to play around a bit, see what I can find.
Many thanks @mvn23, if I can help out in any way please let me know
Ok, I've been playing with a Lolin new NodeMCU v3 with ESPeasy v120 and so far it looks like it's dropping messages. I have logged the wifi data going to the device and the serial data coming out of it and there are some discrepancies. I'm not an expert on the NodeMCU and its firmware, so I can't suggest any solutions here. They may need to change something to their serial port settings (which is also used for log output btw, make sure you disable that as well with Tools>Advanced>Serial Log Level = 0) but I can't tell for sure. The logs provided by @pascalbuijs in #16739 suggest that the same issue is also present with otmonitor, but their implementation seems to ignore the missing responses. I suggest filing a bug with NodeMCU/ESPeasy as they are far more likely to find a solution for this than I am.
Hi @mvn23, i'm glad to see that the OTGW is now included in HA! Although I have some questions to the logic of its behaviour (setting temp override and returning to normal operation of the thermostat, various sensors not working for me), my connection is pretty stable over wifi. My setup: remeha sense thermostat and heater, wemos d1 mini with own concoction in Arduino, serving both MQTT and a telnet connection over Wifi. If of interest I can share the code.
Indeed, if the connection is lost, I need to restart the HA. However, I don't rely on HA for my heating...
Good to see that it's working on your setup. Which wifi chip are you using with your Arduino? (edit: nvm, just saw it's the wemos d1 mini...) I may implement an option to allow reconnecting to the gateway, either automatically on detection of a connection problem or manually through a service, as setups over a network connection seem to be used quite frequently.
For the logic behind the override and returning to manual/program operation afterwards, please refer to the documentation on the OpenTherm Gateway website, especially the treatment of Data ID 9 and the commands section (the component sends TT commands for temperature setpoint overrides). Missing sensor values are explained in the OpenTherm Gateway Hub documentation. Both topics are unrelated to this issue, please direct further support requests through the proper support channels
OK, for everyone seeing TimeoutErrors with the ESP8266 chips: please post the exact model you are using (board/chip version) and the firmware type and version you are running on it. ESPEasy is claiming OpenTherm Gateway support from version R124 onwards, so the test I ran earlier on R120 is moot.
-running Wemos D1 mini ESP8266 chip with my own firmware: OTGW_wifi.zip -running home assistant via docker. v0.81.6
on a sidenote wrt ID 9.
I am running the Nodo-shop OTGW with a NodeMCU v3, ESP8266, with ESP Easy mega-20181030
I have the Nodo-shop OTGW with a NodeMCU v2(ESP8266MOD) running ESP easy v147
Hi All, I am also trying to set up my HA with the OTGW, and I use exactly this config: https://balk.tweakblogs.net/blog/13147/opentherm-gateway-via-wifi-naar-domoticz OTGW (slightly modded) -> ESP12 (with esp-link)
If I set up telnet to the ESP I get a list of codes which look ok:
telnet 192.168.1.49
Trying 192.168.1.49...
Connected to 192.168.1.49.
Escape character is '^]'.
T80190000
BC0193A9E
T901814D1
B501814D1
T80000200
B40000200
T10011200
BD0011200
T00110000
BC0110000
T80190000
BC0193A9E
T00090000
BC0090000
T80000200
B40000200
T10011200
In the log I get this:
Nov 09 13:30:25 pi hass[5811]: 2018-11-09 13:30:25 INFO (MainThread) [homeassistant.components.climate] Setting up climate.opentherm_gw
Nov 09 13:30:25 pi hass[5811]: 2018-11-09 13:30:25 DEBUG (MainThread) [homeassistant.components.climate.opentherm_gw] Added device Thermostat
Nov 09 13:30:34 pi hass[5811]: 2018-11-09 13:30:34 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: C. Are you connecting to the OpenTherm Gateway?
Nov 09 13:30:44 pi hass[5811]: 2018-11-09 13:30:44 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: S. Are you connecting to the OpenTherm Gateway?
Nov 09 13:30:54 pi hass[5811]: 2018-11-09 13:30:54 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: A. Are you connecting to the OpenTherm Gateway?
Nov 09 13:31:04 pi hass[5811]: 2018-11-09 13:31:04 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: T. Are you connecting to the OpenTherm Gateway?
Nov 09 13:31:14 pi hass[5811]: 2018-11-09 13:31:14 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: V. Are you connecting to the OpenTherm Gateway?
Nov 09 13:31:24 pi hass[5811]: 2018-11-09 13:31:24 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: M. Are you connecting to the OpenTherm Gateway?
Nov 09 13:31:34 pi hass[5811]: 2018-11-09 13:31:34 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: P. Are you connecting to the OpenTherm Gateway?
Nov 09 13:31:44 pi hass[5811]: 2018-11-09 13:31:44 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: R. Are you connecting to the OpenTherm Gateway?
Nov 09 13:31:54 pi hass[5811]: 2018-11-09 13:31:54 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: I. Are you connecting to the OpenTherm Gateway?
Nov 09 13:32:04 pi hass[5811]: 2018-11-09 13:32:04 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: L. Are you connecting to the OpenTherm Gateway?
Nov 09 13:32:14 pi hass[5811]: 2018-11-09 13:32:14 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: B. Are you connecting to the OpenTherm Gateway?
Nov 09 13:32:24 pi hass[5811]: 2018-11-09 13:32:24 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: G. Are you connecting to the OpenTherm Gateway?
Nov 09 13:32:34 pi hass[5811]: 2018-11-09 13:32:34 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: W. Are you connecting to the OpenTherm Gateway?
Nov 09 13:32:44 pi hass[5811]: 2018-11-09 13:32:44 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: O. Are you connecting to the OpenTherm Gateway?
Nov 09 13:32:44 pi hass[5811]: 2018-11-09 13:32:44 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Nov 09 13:32:44 pi hass[5811]: Traceback (most recent call last):
Nov 09 13:32:44 pi hass[5811]: File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
Nov 09 13:32:44 pi hass[5811]: result = coro.send(None)
Nov 09 13:32:44 pi hass[5811]: File "/home/pi/opt/homeassistant/lib/python3.5/site-packages/homeassistant/components/opentherm_gw/__init__.py", line 136, in connect_and_subscribe
Nov 09 13:32:44 pi hass[5811]: await gateway.connect(hass.loop, device_path)
Nov 09 13:32:44 pi hass[5811]: File "/home/pi/opt/homeassistant/lib/python3.5/site-packages/pyotgw/pyotgw.py", line 60, in connect
Nov 09 13:32:44 pi hass[5811]: await self.get_reports()
Nov 09 13:32:44 pi hass[5811]: File "/home/pi/opt/homeassistant/lib/python3.5/site-packages/pyotgw/pyotgw.py", line 196, in get_reports
Nov 09 13:32:44 pi hass[5811]: ovrd_mode = str.upper(reports[OTGW_REPORT_SETPOINT_OVRD][0])
Nov 09 13:32:44 pi hass[5811]: TypeError: 'NoneType' object is not subscriptable
My config looks like:
opentherm_gw:
# device: socket://ESP-12-OTGW:23
device: socket://192.168.1.49:23
climate:
name: Thermostat
precision: 0.1
floor_temperature: False
monitored_variables:
- room_setpoint
- room_temp
- otgw_about
- ch_water_temp
- otgw_mode
I tried several options for the connectstring, all with the same troubles.
Any help would be appreciated! If I can be of any help in debugging or testing I would love to help! Regards, Gerben
Today I ran some more tests with ESP Easy mega-20181109 and unfortunately I can not reproduce the problems mentioned here. It's actually working fine with the following chain between Home Assistant and the OpenTherm Gateway:
Laptop/HA <-Wi-Fi-> NodeMCU <-Serial-USB-> Laptop/socat <-SSH tunnel-> Dreamplug/ser2net <-USB TTL-> OpenTherm Gateway
However, I did notice that I had to reboot the NodeMCU after every config change before it started working again. I used the following config under the devices tab:
Without restarting the NodeMCU after a config change I saw the same behavior @gdschut is seeing, because the NodeMCU would stop forwarding altogether.
I will try with esp-link next to see if I can reproduce the issues there.
EDIT: Can't reproduce it with esp-link either. Once I receive the 3.3v power supply I ordered I will test with an ESP01 as well.
That is interesting. Perhaps my HA config is not ok? What is in your config file regarding the OTGW? What do you mean with "devices tab", where can I find it? Yesterday I downloaded the OTMonitor from the OTGW website, and I can succesfully run it, so I think my chain from OTGW via ESP to WIFI is ok, as also proven by my telnet output. That is why I think my HA config to connect to OTGW by hostame or IP is wrong perhaps... If you have any thoughts on this I would like to test it. Gerben
"Devices tab" is a part of the ESP Easy UI for configuring the serial connection (where I took the screenshot). On esp-link (v2.2.3) I only had to change the baud rate for the serial connection to make it work. I have the following in my configuration.yaml for testing:
opentherm_gw:
device: socket://192.168.23.59:8810
climate:
name: Thermostat
precision: 0.5
With esp-link the port was changed to 23.
At this point I really don't have a clue why this is happening. On older ESP Easy firmware versions I have seen some discrepancies between the data being transmitted over Wi-Fi and the data coming out of the serial connection, but on the latest version ESP_Easy_mega-20181109_normal_ESP8266_4096.bin
and on esp-link v2.2.3 it all works as expected after configuring and restarting the NodeMCU.
If anybody has the option to compare Wi-Fi data to serial data and finds no differences but is still experiencing issues I might be able to do something about it, but otherwise I will need to be able to reproduce the issue first.
I doubt if it has anything to do with pyotgw, rather than with the HA configuration. Is there any possibility to get or find more logging to find out what causes the problem with the connection? Some more info on my hardware: I run HA in VENV on RaspberryPi (2B) with a lot of other stuff. My Boiler is a modern Nefit, my thermostat a Remeha Isense. My RPi is wired on ethernet, where my OTGW connects via ESP-12 on WiFi. Both RPI as HA are uptodate. I only get complaints my PIP is outdated, but even as I update I still get complaints about using an old PIP VEnv. (But I wonder if that can cause my troubles...)
My previous comment: I use OTGW from NODO-shop with NodeMCU interface. On ESPEasy R120 - otgw is working, but not with HASS (any other controller/MQTT - I can connect/use it) While trying latest esp-link or latest stable esp-link or latest ESPEasy MEGA - all of them made OTGW to restart, making both: gateway and nodemcu unusable/unstable.
current status: after updating to latest ESP Mega and configuring it properly, OTGW-hass seem to be connected. will be testing.
edit:
Timed out waiting for command: TT, value: 24.5. Are you connecting to the OpenTherm Gateway?
it seems that commands don't get to OTGW anyway.
also I can't see anything more really, cause my iSense thermostat allows only TC to be changed - any possibility to add this as option?
edit2:
tried to change outside temp (I don't have sensor on boiler, but can show it on thermostat):
Timed out waiting for command: OT, value: 8.0. Are you connecting to the OpenTherm Gateway?
normally I use (and it's working all the time): https://github.com/martenjacobs/py-otgw-mqtt via same TCP and ESPEasy
maybe there's difference the way it connects to remote hosts? pyserial is faulty or sth?
I run hass in VENV, python 3.6.6, ARM machnie
After several restarts of HA and reboot of my combined OTGW/ESP-12 unit now it works and communication between HA and OTGW is ok. I do not understand what changed, but it works.
I use otgw with nodemcu stacked on top. Several restarts didn't change anything. HASS can read values, changing them doesn't work (error as comment above)
My OTGW also crashed sometimes due to some gibberish that the esp8266 sends at boot. Perhaps this is also happening at your setup? ref: https://github.com/esp8266/Arduino/issues/3047
@joep2000 the gibberish may not be the cause, as the restart of otgw is every like 10 seconds, much after it shows. Also it doesn't happen with espeasy - since R120 till latest MEGA.
my iSense thermostat allows only TC to be changed - any possibility to add this as option?
Can you file a separate issue with the steps you've taken to confirm that TT isn't working but TC is? Support for TC commands is already present in the library so it should not be difficult to implement, but I don't want to add another option without some more background info on the root cause of the issue.
my iSense thermostat allows only TC to be changed - any possibility to add this as option?
Can you file a separate issue with the steps you've taken to confirm that TT isn't working but TC is? Support for TC commands is already present in the library so it should not be difficult to implement, but I don't want to add another option without some more background info on the root cause of the issue.
It was quite time ago when I was testing and it's something connected to thermostat issues only, so let's for now just leave this. I will test it once again with your implementation in HASS, maybe things have changed.
For now the only thing I'm missing is oppoturnity to get it working with current setup. :-) just wondering, maybe it's somehow fault of pyserial? line endings? (CR; LF etc.?), coding?
this is how OTGW+NodeMCU looks like - I don't really have control of which pins are used or unused for communication with OTGW
also, what was needed to be set on ESP side to get it working (otherwise no communication) was "WD I2C Address:" for value 38 (decimal) Didn't see that option in esp-link tho
Home Assistant release with the issue: 0.79.3
Last working Home Assistant release (if known): None
Operating environment (Hass.io/Docker/Windows/etc.): I am running Home Assistant from Docker
Component/platform: https://www.home-assistant.io/components/climate.opentherm_gw/
Description of problem: Component does not work basicly. I sometimes have to reboot Home Assistant a few times to get the component going:
and When it finally works, it stops working after a few minutes. When I try to change the temperature an error is added to the log:
My openthermgateway is connected to a nodeMCU with ESP Easy running ser2net.
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):Additional information: Here a log of a 'successful' connection after reboot and then almost imediately a crash of the component when I try to set a temperature: