Nothing related to dsmr, only a custom component and HACS repo warning:
2020-10-18 10:50:55 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for google_geocode which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-10-18 10:51:04 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
Which does not seem that strange to me as the only reference to a line logging in the sensor I see is when handling IOError or SerialException exceptions at line 184 in sensor.py.
Mine is run over a tcp connection, not sure which exceptions might be thrown in case of errors on this connection.
Could you check in .storage folder the core.config_entries and check if there is one for dsmr? There should be at least an entry which contains a serial id for the meter.
Could you try to put everything in configuration.yaml?
Since 0.115 there is a connection validation when importing yaml. When this is unsuccessful, there will be no config entry. Strange thing is that it would log an exception when this happens, so this should be visible in the logs (unless it doesn’t validate the config)
Configuration is valid, other sensors in /config/sensors/ are included in /config/storage/,config_entries. Will try to put the dsmr configuration stanza diretcly in configuration.yaml, but do not expect much from it.
My suspicion is that there is an uncaught exception somewhere when trying to connect the create_tcp_dsmr_reader factory, see my earlier statement:
I think I can do this since I am proficient enough in Python.
I am currently not connected to my DSMR meter, but since I had issues I have created a simple daemon sending out telegrams for testing, when that works I will hook up the electronics to the DSMR again.
My DSMR does run with version 2.2 on it’s P1 port, so the default value should be fine.
At least this seems to have some effect, when my telegram generator is not running I see at least connection errors like this:
2020-10-18 15:40:09 ERROR (MainThread) [homeassistant.components.dsmr.config_flow] Error connecting to DSMR
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/dsmr/config_flow.py", line 74, in validate_connect
transport, protocol = await asyncio.create_task(reader_factory())
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1025, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1010, in create_connection
sock = await self._connect_sock(
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 924, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 494, in sock_connect
return await fut
File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 526, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.178.42', 6638)
It seems to not use the custom_component however, judging from the path in the error message. Any clue on how to force the custom_component to have preference over the one in /usr/src/homeassistant/?
I would need this to do some further issue tracking as there seems to go something wrong after sending a few telegrams from my generator.
Apart from that this indeed only seems to work when I configure this in /config/configuration.yaml, if I use include statements with a file in sensors/ folder I see no log entry at all.
Putting something in custom_components should override the built-in integration. You should get a warning as well that you are overriding the default one. Where exactly did you put it?
Maybe a bit obvious, but are you sure the daemon is working correctly? By putting it inconfiguration.yaml and using real hardware it still doesn’t work?
Yes, a simple putty session to IP and port receives data.
It does during the ha core restart the deamon sends 8 telegrams (one every 5 seconds) as soon as that is done somehow the connection seems to be dropped.
Since I do not seem to get the custom component running I am at a dead end with debugging.
I checked out the source from github of home-assistent core, made my changes in the components/dsmr folder in the checkout and created a symbolic link from /config/custom_components to the components dsmr folder like so:
ls -la /config/custom_components/dsmr
lrwxrwxrwx 1 root root 40 Oct 18 12:27 /config/custom_components/dsmr -> /root/core/homeassistant/components/dsmr
The symlinked folder looks like this:
ls -la /config/custom_components/dsmr/
total 80
drwxr-xr-x 3 root root 4096 Oct 18 12:25 .
drwxr-xr-x 966 root root 32768 Oct 18 12:24 ..
-rw-r--r-- 1 root root 1270 Oct 18 12:24 __init__.py
-rw-r--r-- 1 root root 6483 Oct 18 15:37 config_flow.py
-rw-r--r-- 1 root root 510 Oct 18 12:24 const.py
lrwxrwxrwx 1 root root 30 Oct 18 12:25 dsmr -> /config/custom_components/dsmr
-rw-r--r-- 1 root root 222 Oct 18 12:24 manifest.json
-rw-r--r-- 1 root root 12563 Oct 18 12:24 sensor.py
-rw-r--r-- 1 root root 168 Oct 18 12:24 strings.json
drwxr-xr-x 2 root root 4096 Oct 18 12:24 translations