New platform RF iNELS (eLan)

Hi,
I’m trying to develop a platform for INELS RF system with eLan gateway .

At this moment I have working prototype as custom component (code at the end of this post). However I’m not sure how to get it into shape ready for submitting = help, comments and tests are welcome.

Especially I’m not sure how to proceed with calls to the device. In doc there is a statement that this should be done in library. However creating full library (nI have never done that in python) just to preform and parse few xhttp calls semms to me a bit overkill.

Anyway here is my code:

Configuration

eLan:
url: “url of eLan”

Plaform part

“”"
Support for eLan devices manual discovery.
For more details about this component, please refer to the documentation at

“”"

import asyncio
import logging

import async_timeout
import voluptuous as vol

#from homeassistant.components.discovery import SERVICE_ELAN
SERVICE_ELAN = ‘eLan’

from homeassistant.helpers import discovery
from homeassistant.helpers.discovery import load_platform
from homeassistant.helpers import config_validation as cv

from homeassistant.const import EVENT_HOMEASSISTANT_STOP

DOMAIN = ‘eLan’

#SUBSCRIPTION_REGISTRY = None # do budoucna zde bude ws link k eLanu abychom meli upozorneni na zmeny stavu
KNOWN_DEVICES =

_LOGGER = logging.getLogger(name)

CONF_STATIC = ‘static’

CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(‘url’): cv.string,
}),
}, extra=vol.ALLOW_EXTRA)

@asyncio.coroutine
def async_setup(hass, config):
“”“Setup eLan component.”“”
conf = config.get(DOMAIN, {})
url = conf.get(‘url’)

   @asyncio.coroutine
   def eLan_discovered(service, info):
       """Run when a gateway is discovered."""
       url = info['url']
       yield from _setup_eLan(hass, config, url)

   discovery.async_listen(hass, SERVICE_ELAN, eLan_discovered)

   yield from eLan_discovered(None,{'url': url})

   return True

@asyncio.coroutine
def _setup_eLan(hass, hass_config, url):
“”“Call platform discovery for devices on particular eLan.”“”
hass.async_add_job(discovery.async_load_platform(
hass, ‘light’, DOMAIN, {‘url’: url}, hass_config))
hass.async_add_job(discovery.async_load_platform(
hass, ‘sensor’, DOMAIN, {‘url’: url}, hass_config))
return True

Light part:

“”"
Support for the eLan.
For more details about this platform, please refer to the documentation at

“”"
import asyncio
import aiohttp
import logging
import voluptuous as vol

from homeassistant.core import callback
from homeassistant.const import ATTR_BATTERY_LEVEL
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_RGB_COLOR,
SUPPORT_BRIGHTNESS, SUPPORT_RGB_COLOR, Light)
from homeassistant.components.light import PLATFORM_SCHEMA
from homeassistant.util import color as color_util
from homeassistant.helpers import config_validation as cv

#REQUIREMENTS = [‘pyelan’]

_LOGGER = logging.getLogger(name)

#MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
#MIN_TIME_BETWEEN_FORCED_SCANS = timedelta(milliseconds=100)

Validation of the user’s configuration

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(‘url’): cv.string,
})

@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
“”“Set up the eLan Light platform.”“”
if discovery_info is None:
return

   url = discovery_info['url']

   session = aiohttp.ClientSession()
   resp = yield from session.get(url+'/api/devices', timeout=3)
   device_list = yield from resp.json()
   _LOGGER.info("eLan devices")
   _LOGGER.info(device_list)

   for device in device_list:
       resp =  yield from session.get(device_list[device]['url'], timeout=3)
       info =  yield from resp.json()
       _LOGGER.info("eLan device")
       _LOGGER.info(device)
       if info['device info']['type'] == 'light':
           _LOGGER.info("eLan Light to add")
           _LOGGER.info(device)
           async_add_devices([eLanLight(device_list[device]['url'], info)])

session.close()

class eLanLight(Light):
“”“The platform class required by Home Assistant.”“”

   def __init__(self, light, info):
       """Initialize a Light."""
       _LOGGER.info("eLan light initialisation")
       _LOGGER.info(info)
       self._light = light
       self._info = info
       self._name = info['device info']['label']
       self._state = None
       self._brightness = None

       self._last_brightness = 100
       self._dimmer = False
       self._available = True
       self._features = None
       self._rgb_color = None

       if info['primary actions'][0] == 'brightness':
           self._features = SUPPORT_BRIGHTNESS
           self._dimmer = True

   @property
   def device_state_attributes(self):
       """Return the devices' state attributes."""
       attrs = {}
       return attrs

   @asyncio.coroutine
   def async_added_to_hass(self):
       """Start thread when added to hass."""
       #self._async_start_observe()

   @property
   def available(self):
       """Return True if entity is available."""
       return self._available

   @property
   def should_poll(self):
       """WS notification not implemented yet - polling is needed"""
       return True

   @property
   def supported_features(self):
       """Flag supported features."""
       return self._features

   @property
   def name(self):
       """Return the display name of this light."""
       return self._name

   @property
   def is_on(self):
       """Return true if light is on."""
       return self._state

   @property
   def brightness(self):
       """Return the brightness of the light."""
       return self._brightness

   @property
   def rgb_color(self):
       """RGB color of the light."""
       return self._rgb_color


   @asyncio.coroutine
   def update(self):
       """Fetch new state data for this light.

       This is the only method that should fetch new data for Home Assistant.
       """
       _LOGGER.info('eLan Light update')
       _LOGGER.info(self._light + '/state')
       session = aiohttp.ClientSession()
       resp = yield from session.get(self._light + '/state', timeout=3)
       state = yield from resp.json()
       _LOGGER.info(state)
       tmp = False
       if 'on' in state:
           tmp = state['on']
       if 'brightness' in state:
           self._brightness = state['brightness']
           if state['brightness'] > 0:
               tmp = True
       self._state = tmp

   @asyncio.coroutine
   def async_turn_off(self, **kwargs):
       """Instruct the light to turn off."""
       _LOGGER.info('Turning off eLan light')
       _LOGGER.info(self._light)
       session = aiohttp.ClientSession()
       if self._dimmer:
           resp = yield from session.put(self._light, json={'brightness':0})
       else:
           resp = yield from session.put(self._light, json={'on':False})
       info = yield from resp.text()
       _LOGGER.info(info)

   @asyncio.coroutine
   def async_turn_on(self, **kwargs):
       """
       Instruct the light to turn on.
       """
       _LOGGER.info('Turning on eLan light')
       _LOGGER.info(self._light)
       if ATTR_BRIGHTNESS in kwargs:
           if kwargs[ATTR_BRIGHTNESS] > 0:
               self._last_brightness = kwargs[ATTR_BRIGHTNESS]

       session = aiohttp.ClientSession()
       if self._dimmer:
           if self._last_brightness is 0:
               self._last_brightness = 100
           resp = yield from session.put(self._light, json={'brightness': self._last_brightness})
       else:
           resp =yield from session.put(self._light, json={'on': True})

       info = yield from resp.text()
       _LOGGER.info(info)

Sensor part:

“”"
Support for the eLan.
For more details about this platform, please refer to the documentation at

“”"
import asyncio
import aiohttp
import logging
import voluptuous as vol

from homeassistant.core import callback
from homeassistant.const import TEMP_CELSIUS
from homeassistant.helpers.entity import Entity
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity import Entity, async_generate_entity_id
from homeassistant.helpers.event import async_track_state_change
from homeassistant.exceptions import TemplateError

#REQUIREMENTS = [‘pyelan’]

_LOGGER = logging.getLogger(name)

#MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
#MIN_TIME_BETWEEN_FORCED_SCANS = timedelta(milliseconds=100)

Validation of the user’s configuration

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(‘url’): cv.string,
})

@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
“”“Set up the eLan thermostat platform.”“”
if discovery_info is None:
return

   url = discovery_info['url']

   session = aiohttp.ClientSession()
   resp = yield from session.get(url+'/api/devices', timeout=3)
   device_list = yield from resp.json()
   _LOGGER.info("eLan devices")
   _LOGGER.info(device_list)

   for device in device_list:
       resp =  yield from session.get(device_list[device]['url'], timeout=3)
       info =  yield from resp.json()
       _LOGGER.info("eLan device")
       _LOGGER.info(device)
       if info['device info']['type'] == 'heating':
           _LOGGER.info("eLan Thermostat to add")
           _LOGGER.info(device)
           async_add_devices([eLanThermostat(device_list[device]['url'], info, 'temperature')])
           async_add_devices([eLanThermostat(device_list[device]['url'], info, 'on')])

session.close()

class eLanThermostat(Entity):
“”“The platform class required by Home Assistant.”“”

   def __init__(self, thermostat, info, var):
       """Initialize a thermostat."""
       _LOGGER.info("eLan thermostat initialisation")
       _LOGGER.info(info)
       self._thermostat = thermostat
       self._var = 'temperature'
       self._info = info
       self._state = None
       self._name = info['device info']['label']
       self._temperatureIN = None
       self._temperatureOUT = None
       self._on = None
       self._locked = None
       self._units = None
       if var is 'temperature':
           self._name = info['device info']['label'] + '-T'
           self._var = var
           self._units = TEMP_CELSIUS

       if var is 'temperature OUT':
           self._name = info['device info']['label'] + '-T OUT'
           self._var = var
           self._units = TEMP_CELSIUS

       if var is 'temperature IN':
           self._name = info['device info']['label'] + '-T IN'
           self._var = var
           self._units = TEMP_CELSIUS

       if var is 'on':
           self._name = info['device info']['label'] + '-ON'
           self._var = var

       self._available = True


   @asyncio.coroutine
   def async_added_to_hass(self):
       """Start thread when added to hass."""
       #self._async_start_observe()

   @property
   def available(self):
       """Return True if entity is available."""
       return self._available

   @property
   def should_poll(self):
       """WS notification not implemented yet - polling is needed"""
       return True

   @property
   def name(self):
       """Return the display name of this thermostat."""
       return self._name

   @property
   def state(self):
       """Return the state of the sensor."""
       return self._state

   @property
   def unit_of_measurement(self):
       """Return the unit of measurement."""
       return self._units

   @asyncio.coroutine
   def update(self):
       """Fetch new state data for this thermostat.

       This is the only method that should fetch new data for Home Assistant.
       """
       _LOGGER.info('eLan thermostat update')
       _LOGGER.info(self._thermostat + '/state')
       session = aiohttp.ClientSession()
       resp = yield from session.get(self._thermostat + '/state', timeout=3)
       state = yield from resp.json()
       _LOGGER.info(state)
       if 'temperature IN' in state:
           self._temperatureIN = state['temperature IN']
       if 'temperature OUT' in state:
           self._temperatureOUT = state['temperature OUT']
       if 'on' in state:
           self._on = state['on']
       if 'locked' in state:
           self._locked = state['locked']

       if self._var is 'temperature':
           if self._temperatureIN and (self._temperatureIN>-99):
               self._state = self._temperatureIN
           if self._temperatureOUT and (self._temperatureOUT>-99):
               self._state = self._temperatureOUT

       if self._var is 'temperature OUT':
           if self._temperatureOUT and (self._temperatureOUT>-99):
               self._state = self._temperatureOUT

       if self._var is 'temperature IN':
           if self._temperatureIN and (self._temperatureIN>-99):
               self._state = self._temperatureIN

       if self._var is 'on':
           self._state = self._on

       _LOGGER.info(self._state)
1 Like

Hi Zdar

Did you succeed with this project?

I’m quite new to Home Assistant, but have experience with coding and been working with automation for some time. My latest project is my RF INELS installation. I can controll my lights using curl with scripts, and I can read status, but I would like to get it in to a more dynamic approach.

I hope you have time to give an update on your project.

Thanks

Danny

Hi,
I had a proof of concept but there was problem with asyncio and homeassitant after some changes in HA codebase. After analysing the problem I decided for a bit different approach.
At the moment I have python script connecting eLan (RF inels) to MQTT. I have it running for some time as Hassio addon. It works quit nicely including autodiscovery. If you are interested I’m happy to share code. But beware - it needs some rewrite (there is sequential loop for tasks which needs to be converted in workers or multiprocess)

Jiri

Hi Jiri

Thanks for your quick answer

I owuld appreciate if you will share the code. I expect it to save me a lot of time:-)

Thanks for the help.

Danny

For those interested - MQTT gateway for RF iNELS (via eLAN-RF-003)

Hello. I am a novice user of Hass .io. I tried to use your addon elan2mqtt, after installation it does not start, my knowledge is not enough to solve the problem. Help me please.

Log:

Summary

Downloading https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl
Collecting chardet<4.0,>=2.0 (from -r requirements.txt (line 6))
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
Collecting multidict==4.5.2 (from -r requirements.txt (line 7))
Downloading https://files.pythonhosted.org/packages/7f/8f/b3c8c5b062309e854ce5b726fc101195fbaa881d306ffa5c2ba19efa3af2/multidict-4.5.2.tar.gz (105kB)
Collecting async_timeout<4.0,>=3.0 (from -r requirements.txt (line 8))
Downloading https://files.pythonhosted.org/packages/e1/1e/5a4441be21b0726c4464f3f23c8b19628372f606755a9d2e46c187e65ec4/async_timeout-3.0.1-py3-none-any.whl
Collecting yarl<2.0,>=1.0 (from -r requirements.txt (line 9))
Downloading https://files.pythonhosted.org/packages/d6/67/6e2507586eb1cfa6d55540845b0cd05b4b77c414f6bca8b00b45483b976e/yarl-1.4.2.tar.gz (163kB)
Collecting docopt (from hbmqtt->-r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/a2/55/8f8cab2afd404cf578136ef2cc5dfb50baa1761b68c9da1fb1e4eed343c9/docopt-0.6.2.tar.gz
Collecting websockets (from hbmqtt->-r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/e9/2b/cf738670bb96eb25cb2caf5294e38a9dc3891a6bcd8e3a51770dbc517c65/websockets-8.1.tar.gz (58kB)
Collecting pyyaml (from hbmqtt->-r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/3d/d9/ea9816aea31beeadccd03f1f8b625ecf8f645bd66744484d162d84803ce5/PyYAML-5.3.tar.gz (268kB)
Collecting transitions (from hbmqtt->-r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/02/85/aaa9ad0391d33d2af02450d9db2ee3fe5d4cd2834e8481a0c409861032f2/transitions-0.7.2-py2.py3-none-any.whl (55kB)
Collecting passlib (from hbmqtt->-r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/11/b8/e9a78f3033228013ba8564adad8d0031bf9d39ea3acc3cdb9d55fabeb4ba/passlib-1.7.2-py2.py3-none-any.whl (507kB)
Collecting idna>=2.0 (from yarl<2.0,>=1.0->-r requirements.txt (line 9))
Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
Collecting six (from transitions->hbmqtt->-r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Installing collected packages: argparse, docopt, websockets, pyyaml, six, transitions, passlib, hbmqtt, attrs, chardet, multidict, async-timeout, idna, yarl
Running setup.py install for docopt: started
Running setup.py install for docopt: finished with status ‘done’
Running setup.py install for websockets: started
Running setup.py install for websockets: finished with status ‘done’
Running setup.py install for pyyaml: started
Running setup.py install for pyyaml: finished with status ‘done’
Running setup.py install for multidict: started
Running setup.py install for multidict: finished with status ‘done’
Running setup.py install for yarl: started
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.8 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-_we07mtf/yarl/setup.py’"’"’; file=’"’"’/tmp/pip-install-_we07mtf/yarl/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /tmp/pip-record-4a3kicuw/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-_we07mtf/yarl/
Complete output (40 lines):
**********************
* Accellerated build *
**********************
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.8
creating build/lib.linux-armv7l-3.8/yarl
copying yarl/init.py -> build/lib.linux-armv7l-3.8/yarl
copying yarl/quoting.py -> build/lib.linux-armv7l-3.8/yarl
running egg_info
writing yarl.egg-info/PKG-INFO
Running setup.py install for yarl: finished with status ‘error’
writing dependency_links to yarl.egg-info/dependency_links.txt
writing requirements to yarl.egg-info/requires.txt
writing top-level names to yarl.egg-info/top_level.txt
reading manifest file ‘yarl.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
warning: no previously-included files matching ‘.pyc’ found anywhere in distribution
warning: no previously-included files matching '
.cache’ found anywhere in distribution
warning: no previously-included files found matching ‘yarl/_quoting.html’
warning: no previously-included files found matching ‘yarl/_quoting..so’
warning: no previously-included files found matching ‘yarl/_quoting.pyd’
warning: no previously-included files found matching 'yarl/_quoting.
.pyd’
no previously-included directories found matching ‘docs/_build’
writing manifest file ‘yarl.egg-info/SOURCES.txt’
copying yarl/init.pyi -> build/lib.linux-armv7l-3.8/yarl
copying yarl/_quoting.c -> build/lib.linux-armv7l-3.8/yarl
copying yarl/_quoting.pyx -> build/lib.linux-armv7l-3.8/yarl
copying yarl/py.typed -> build/lib.linux-armv7l-3.8/yarl
running build_ext
building ‘yarl._quoting’ extension
creating build/temp.linux-armv7l-3.8
creating build/temp.linux-armv7l-3.8/yarl
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.8 -c yarl/_quoting.c -o build/temp.linux-armv7l-3.8/yarl/_quoting.o
yarl/_quoting.c:4:10: fatal error: Python.h: No such file or directory
4 | #include “Python.h”
| ^~~~~~~~~~
compilation terminated.
error: command ‘gcc’ failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.8 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-_we07mtf/yarl/setup.py’"’"’; file=’"’"’/tmp/pip-install-_we07mtf/yarl/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /tmp/pip-record-4a3kicuw/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.
Starting gateway
http://192.168.0.10 mqtt://mqtt:[email protected]
Traceback (most recent call last):
File “socket_listener.py”, line 18, in
import aiohttp
File “/elan2mqtt-1.3.0/aiohttp/init.py”, line 6, in
from .client import BaseConnector as BaseConnector
File “/elan2mqtt-1.3.0/aiohttp/client.py”, line 33, in
from yarl import URL
ModuleNotFoundError: No module named ‘yarl’
Traceback (most recent call last):
File “main_worker.py”, line 25, in
import aiohttp
File “/elan2mqtt-1.3.0/aiohttp/init.py”, line 6, in
from .client import BaseConnector as BaseConnector
File “/elan2mqtt-1.3.0/aiohttp/client.py”, line 33, in
from yarl import URL
ModuleNotFoundError: No module named ‘yarl’

@teolnmax
It is a dependency issue. I have pushed fix into git.

Please redownload and reinstall the add-on. If you use HACS you have to completly remove add-on and then install it to force new download from git.

The other solution is to fix requirements.txt and rebuild it locally.

1 Like

Hello. Today I tried again with Elan2mqtt 1.4. Of the 10 devices connected to elan, only 7 of them are visible. I can’t control them, I only see the status of the device with a delay of 10-30 seconds.

Log elan2mqtt:

Summary

[2020-01-23 23:44:48,747] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,749] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,750] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,752] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,754] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,755] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,757] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,759] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,760] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,762] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,764] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,772] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,774] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:44:48,859] {socket_listener.py:212} ERROR - Something went wrong. But don’t worry we will start over again.
Traceback (most recent call last):
File “socket_listener.py”, line 210, in
asyncio.get_event_loop().run_until_complete(main())
File “/usr/lib/python3.8/asyncio/base_events.py”, line 612, in run_until_complete
return future.result()
File “socket_listener.py”, line 106, in main
mac = str(info[‘device info’][‘address’])
KeyError: ‘address’
[2020-01-23 23:44:48,862] {socket_listener.py:215} ERROR - But at first take some break. Sleeping for 30 s
[2020-01-23 23:44:49,440] {main_worker.py:404} ERROR - Something went wrong. But don’t worry we will start over again.
Traceback (most recent call last):
File “main_worker.py”, line 402, in
asyncio.get_event_loop().run_until_complete(main())
File “/usr/lib/python3.8/asyncio/base_events.py”, line 612, in run_until_complete
return future.result()
File “main_worker.py”, line 272, in main
mac = str(info[‘device info’][‘address’])
KeyError: ‘address’
[2020-01-23 23:44:49,442] {main_worker.py:407} ERROR - But at first take some break. Sleeping for 30 s
[2020-01-23 23:45:18,940] {base_events.py:1703} ERROR - Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x74a45910>
[2020-01-23 23:45:19,074] {handler.py:431} WARNING - ClientProtocolHandler Unhandled exception in reader coro: IncompleteReadError(‘0 bytes read on a total of 1 expected bytes’)
[2020-01-23 23:45:19,076] {handler.py:431} WARNING - ClientProtocolHandler Unhandled exception in reader coro: IncompleteReadError(‘0 bytes read on a total of 1 expected bytes’)
[2020-01-23 23:45:19,081] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:45:19,082] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:45:19,635] {base_events.py:1703} ERROR - Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x74971c28>
[2020-01-23 23:45:19,665] {handler.py:431} WARNING - ClientProtocolHandler Unhandled exception in reader coro: IncompleteReadError(‘0 bytes read on a total of 1 expected bytes’)
[2020-01-23 23:45:19,669] {client.py:443} WARNING - Disconnected from broker
[2020-01-23 23:45:19,993] {socket_listener.py:212} ERROR - Something went wrong. But don’t worry we will start over again.
Traceback (most recent call last):
File “socket_listener.py”, line 210, in
asyncio.get_event_loop().run_until_complete(main())
File “/usr/lib/python3.8/asyncio/base_events.py”, line 612, in run_until_complete
return future.result()
File “socket_listener.py”, line 106, in main
mac = str(info[‘device info’][‘address’])
KeyError: ‘address’
[2020-01-23 23:45:19,995] {socket_listener.py:215} ERROR - But at first take some break. Sleeping for 30 s
[2020-01-23 23:45:20,682] {main_worker.py:404} ERROR - Something went wrong. But don’t worry we will start over again.
Traceback (most recent call last):
File “main_worker.py”, line 402, in
asyncio.get_event_loop().run_until_complete(main())
File “/usr/lib/python3.8/asyncio/base_events.py”, line 612, in run_until_complete
return future.result()
File “main_worker.py”, line 272, in main
mac = str(info[‘device info’][‘address’])
KeyError: ‘address’
[2020-01-23 23:45:20,685] {main_worker.py:407} ERROR - But at first take some break. Sleeping for 30 s

Log mosquitto:

Summary

1579823258: Client hbmqtt/PyoDQAQoFiTEAUP] has exceeded timeout, disconnecting.
1579823258: Client hbmqtt/Utj5nc^Ugbl^7GM has exceeded timeout, disconnecting.
1579823258: Client hbmqtt/gp8rrQIM:_>XEYS has exceeded timeout, disconnecting. 1579823258: Client hbmqtt/57F@TB5P4z41LM[] has exceeded timeout, disconnecting. 1579823258: Client hbmqtt/=VoW5AXSpQ2x[Usg has exceeded timeout, disconnecting. 1579823258: Client hbmqtt/ujPyvG3@?bnX]q2Q has exceeded timeout, disconnecting. 1579823258: Client hbmqtt/pIG2Hi1yc:Kj7fQl has exceeded timeout, disconnecting. 1579823258: Client hbmqtt/C]?=5^AD;lLTINq; has exceeded timeout, disconnecting. 1579823258: Client hbmqtt/YMmTxH[kKxU\q<NN has exceeded timeout, disconnecting. 1579823258: Client hbmqtt/?gGxCj=]FWb9Luq has exceeded timeout, disconnecting.
1579823258: Client hbmqtt/aaZMWsT^3k@=wVz[ has exceeded timeout, disconnecting.
1579823258: Client hbmqtt/BH9VsHuBH:ZKR@7H has exceeded timeout, disconnecting.
1579823258: Client hbmqtt/:1Obloi@\hOl2k8 has exceeded timeout, disconnecting. 1579823258: Client hbmqtt/lrRNa<_@Z0>65I2O has exceeded timeout, disconnecting. 1579823258: Client hbmqtt/rXedw^z@AHaAWS4 has exceeded timeout, disconnecting.
1579823258: Client hbmqtt/si1iwJaiuZ?Y_8Ck has exceeded timeout, disconnecting.
1579823258: Client hbmqtt/aKw9O?2xVl:kdtgP has exceeded timeout, disconnecting.
1579823258: Client hbmqtt/RYjuk9r<du1:FO6= has exceeded timeout, disconnecting.
1579823258: Client hbmqtt/ztyh[7lpU>Hk[@mQ has exceeded timeout, disconnecting.
1579823258: Client hbmqtt/Qe6e:dBIsIoyak<= has exceeded timeout, disconnecting.
1579823258: Client hbmqtt/P
:zlWx6P6At@[>K has exceeded timeout, disconnecting.
1579823258: Client hbmqtt/ofR`Cr^M?94XTjiG has exceeded timeout, disconnecting.
1579823259: Client hbmqtt/[RQpg=3D?>Pflu^J has exceeded timeout, disconnecting.
1579823275: New connection from 172.30.32.1 on port 1883.
1579823275: New client connected from 172.30.32.1 as hbmqtt/4eqbdl390OxAO6lk (p2, c1, k9, u’mqtt’).
1579823276: New connection from 172.30.32.1 on port 1883.
1579823276: New connection from 172.30.32.1 on port 1883.
1579823276: New connection from 172.30.32.1 on port 1883.
1579823276: New connection from 172.30.32.1 on port 1883.
1579823276: New client connected from 172.30.32.1 as hbmqtt/FOxVCZVGqfv<:n] (p2, c1, k9, u’mqtt’).
1579823276: New client connected from 172.30.32.1 as hbmqtt/D1u6sI6F5d^2dUzm (p2, c1, k9, u’mqtt’).
1579823276: New client connected from 172.30.32.1 as hbmqtt/rawyeavx0042U\w< (p2, c1, k9, u’mqtt’).
1579823276: New client connected from 172.30.32.1 as hbmqtt/otvK_xA;Y6fiQ0ot (p2, c1, k9, u’mqtt’).
1579823289: Client hbmqtt/4eqbdl390OxAO6lk has exceeded timeout, disconnecting.
1579823289: Client hbmqtt/D1u6sI6F5d^2dUzm has exceeded timeout, disconnecting.
1579823289: Client hbmqtt/rawyeavx0042U\w< has exceeded timeout, disconnecting.
1579823289: Client hbmqtt/otvK_xA;Y6fiQ0ot has exceeded timeout, disconnecting.
1579823290: Client hbmqtt/FOxVCZVGqfv<
:n] has exceeded timeout, disconnecting.

Why is this happening:
ERROR - But at first take some break. Sleeping for 30 s?

Hi,
there is something in device list provided by eLan box and it causes elan2mqtt to fail. Could you please switch to DEBUG mode (log_level debug) and send me a log?
Or you can you chrome developer console, connect to the box and do the capture it there? I need device list provided by the box (/api/devices) and also if you can provide device definitions from subsequent requests it would help immensly.

Use PM if you do not share it openly

Thanks for your help.
Log_level debug:

Summary

[2020-01-24 07:09:03,859] {main_worker.py:64} INFO - Primary action of light is ON
[2020-01-24 07:09:03,861] {main_worker.py:85} INFO - Discovery published for http://192.168.0.10/api/devices/26615 {“schema”: “basic”, “name”: “\u0421\u0432\u0435\u0442 \u043a\u043e\u0440\u0438\u0434\u043e\u0440”, “unique_id”: “eLan-233568”, “device”: {“name”: “\u0421\u0432\u0435\u0442 \u043a\u043e\u0440\u0438\u0434\u043e\u0440”, “identifiers”: “eLan-light-233568”, “connections”: [[“mac”, “233568”]], “mf”: “Elko EP”, “mdl”: “RFSAI-61B”}, “command_topic”: “eLan/233568/command”, “state_topic”: “eLan/233568/status”, “payload_off”: “{“on”:false}”, “payload_on”: “{“on”:true}”, “state_value_template”: “{%- if value_json.on -%}{“on”:true}{%- else -%}{“on”:false}{%- endif -%}”}
[2020-01-24 07:09:03,862] {main_worker.py:48} INFO - Getting and publishing status for http://192.168.0.10/api/devices/26615
[2020-01-24 07:09:03,868] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: -out-> PublishPacket(ts=2020-01-24 07:09:03.861001, fixed=MQTTFixedHeader(length=606, flags=0x0), variable=PublishVariableHeader(topic=homeassistant/light/233568/config, packet_id=None), payload=PublishPayload(data='bytearray(b\'{"schema": "basic", "name": "\\\\u0421\\\\u0432\\\\u0435\\\\u0442 \\\\u043a\\\\u043e\\\\u0440\\\\u0438\\\\u0434\\\\u043e\\\\u0440", "unique_id": "eLan-233568", "device": {"name": "\\\\u0421\\\\u0432\\\\u0435\\\\u0442 \\\\u043a\\\\u043e\\\\u0440\\\\u0438\\\\u0434\\\\u043e\\\\u0440", "identifiers": "eLan-light-233568", "connections": [["mac", "233568"]], "mf": "Elko EP", "mdl": "RFSAI-61B"}, "command_topic": "eLan/233568/command", "state_topic": "eLan/233568/status", "payload_off": "{\\\\"on\\\\":false}", "payload_on": "{\\\\"on\\\\":true}", "state_value_template": "{%- if value_json.on -%}{\\\\"on\\\\":true}{%- else -%}{\\\\"on\\\\":false}{%- endif -%}"}\')')) [2020-01-24 07:09:03,884] {socket_listener.py:46} INFO - Status published for http://192.168.0.10/api/devices/32393 {'on': False, 'delay': False, 'automat': False, 'locked': False, 'delayed off: set time': 0, 'delayed on: set time': 0} [2020-01-24 07:09:03,889] {logging.py:44} DEBUG - hbmqtt/P2CNZo6N0hyapjnM -out-> PublishPacket(ts=2020-01-24 07:09:03.883775, fixed=MQTTFixedHeader(length=139, flags=0x0), variable=PublishVariableHeader(topic=eLan/235719/status, packet_id=None), payload=PublishPayload(data='bytearray(b\'{"on": false, "delay": false, "automat": false, "locked": false, "delayed off: set time": 0, "delayed on: set time": 0}\')')) [2020-01-24 07:09:03,897] {main_worker.py:53} INFO - Status published for http://192.168.0.10/api/devices/26615 {'on': False, 'delay': False, 'automat': False, 'locked': False, 'delayed off: set time': 0, 'delayed on: set time': 0} [2020-01-24 07:09:03,907] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: -out-> PublishPacket(ts=2020-01-24 07:09:03.896473, fixed=MQTTFixedHeader(length=139, flags=0x0), variable=PublishVariableHeader(topic=eLan/233568/status, packet_id=None), payload=PublishPayload(data=‘bytearray(b’{“on”: false, “delay”: false, “automat”: false, “locked”: false, “delayed off: set time”: 0, “delayed on: set time”: 0}’)’))
[2020-01-24 07:09:03,914] {socket_listener.py:110} INFO - Setting up http://192.168.0.10/api/devices/26369
[2020-01-24 07:09:03,914] {socket_listener.py:126} INFO - Subscribing to control topic eLan/231060/command
[2020-01-24 07:09:03,917] {logging.py:44} DEBUG - hbmqtt/P2CNZo6N0hyapjnM -out-> SubscribePacket(ts=2020-01-24 07:09:03.916404, fixed=MQTTFixedHeader(length=24, flags=0x2), variable=PacketIdVariableHeader(packet_id=6), payload=SubscribePayload(topics=[(‘eLan/231060/command’, 1)]))
[2020-01-24 07:09:03,927] {main_worker.py:276} INFO - Setting up http://192.168.0.10/api/devices/32393
[2020-01-24 07:09:03,928] {main_worker.py:291} INFO - Subscribing to control topic eLan/235719/command
[2020-01-24 07:09:03,930] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: -out-> SubscribePacket(ts=2020-01-24 07:09:03.929359, fixed=MQTTFixedHeader(length=24, flags=0x2), variable=PacketIdVariableHeader(packet_id=5), payload=SubscribePayload(topics=[('eLan/235719/command', 1)])) [2020-01-24 07:09:03,952] {logging.py:34} DEBUG - hbmqtt/P2CNZo6N0hyapjnM <-in-- SubackPacket(ts=2020-01-24 07:09:03.951439, fixed=MQTTFixedHeader(length=3, flags=0x0), variable=PacketIdVariableHeader(packet_id=6), payload=SubackPayload(return_codes=[1])) [2020-01-24 07:09:03,953] {socket_listener.py:128} INFO - Subscribed to eLan/231060/command [2020-01-24 07:09:03,954] {socket_listener.py:41} INFO - Getting and publishing status for http://192.168.0.10/api/devices/26369 [2020-01-24 07:09:03,955] {logging.py:34} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: <-in-- SubackPacket(ts=2020-01-24 07:09:03.954511, fixed=MQTTFixedHeader(length=3, flags=0x0), variable=PacketIdVariableHeader(packet_id=5), payload=SubackPayload(return_codes=[1]))
[2020-01-24 07:09:03,956] {main_worker.py:293} INFO - Subscribed to eLan/235719/command
[2020-01-24 07:09:03,957] {main_worker.py:59} INFO - Publishing discovery for http://192.168.0.10/api/devices/32393
[2020-01-24 07:09:03,957] {main_worker.py:61} INFO - {‘address’: 235719, ‘label’: ‘Kitchen1’, ‘type’: ‘light’, ‘product type’: ‘RFSA-62B’}
[2020-01-24 07:09:03,958] {main_worker.py:64} INFO - Primary action of light is ON
[2020-01-24 07:09:03,960] {main_worker.py:85} INFO - Discovery published for http://192.168.0.10/api/devices/32393 {“schema”: “basic”, “name”: “Kitchen1”, “unique_id”: “eLan-235719”, “device”: {“name”: “Kitchen1”, “identifiers”: “eLan-light-235719”, “connections”: [[“mac”, “235719”]], “mf”: “Elko EP”, “mdl”: “RFSA-62B”}, “command_topic”: “eLan/235719/command”, “state_topic”: “eLan/235719/status”, “payload_off”: “{“on”:false}”, “payload_on”: “{“on”:true}”, “state_value_template”: “{%- if value_json.on -%}{“on”:true}{%- else -%}{“on”:false}{%- endif -%}”}
[2020-01-24 07:09:03,960] {main_worker.py:48} INFO - Getting and publishing status for http://192.168.0.10/api/devices/32393
[2020-01-24 07:09:03,966] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: -out-> PublishPacket(ts=2020-01-24 07:09:03.959343, fixed=MQTTFixedHeader(length=487, flags=0x0), variable=PublishVariableHeader(topic=homeassistant/light/235719/config, packet_id=None), payload=PublishPayload(data='bytearray(b\'{"schema": "basic", "name": "Kitchen1", "unique_id": "eLan-235719", "device": {"name": "Kitchen1", "identifiers": "eLan-light-235719", "connections": [["mac", "235719"]], "mf": "Elko EP", "mdl": "RFSA-62B"}, "command_topic": "eLan/235719/command", "state_topic": "eLan/235719/status", "payload_off": "{\\\\"on\\\\":false}", "payload_on": "{\\\\"on\\\\":true}", "state_value_template": "{%- if value_json.on -%}{\\\\"on\\\\":true}{%- else -%}{\\\\"on\\\\":false}{%- endif -%}"}\')')) [2020-01-24 07:09:03,999] {socket_listener.py:46} INFO - Status published for http://192.168.0.10/api/devices/26369 {'on': False, 'delay': False, 'automat': False, 'locked': False, 'delayed off: set time': 0, 'delayed on: set time': 0} [2020-01-24 07:09:04,005] {main_worker.py:53} INFO - Status published for http://192.168.0.10/api/devices/32393 {'on': False, 'delay': False, 'automat': False, 'locked': False, 'delayed off: set time': 0, 'delayed on: set time': 0} [2020-01-24 07:09:04,006] {logging.py:44} DEBUG - hbmqtt/P2CNZo6N0hyapjnM -out-> PublishPacket(ts=2020-01-24 07:09:03.999035, fixed=MQTTFixedHeader(length=139, flags=0x0), variable=PublishVariableHeader(topic=eLan/231060/status, packet_id=None), payload=PublishPayload(data='bytearray(b\'{"on": false, "delay": false, "automat": false, "locked": false, "delayed off: set time": 0, "delayed on: set time": 0}\')')) [2020-01-24 07:09:04,012] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: -out-> PublishPacket(ts=2020-01-24 07:09:04.004919, fixed=MQTTFixedHeader(length=139, flags=0x0), variable=PublishVariableHeader(topic=eLan/235719/status, packet_id=None), payload=PublishPayload(data=‘bytearray(b’{“on”: false, “delay”: false, “automat”: false, “locked”: false, “delayed off: set time”: 0, “delayed on: set time”: 0}’)’))
[2020-01-24 07:09:04,028] {socket_listener.py:110} INFO - Setting up http://192.168.0.10/api/devices/24170
[2020-01-24 07:09:04,029] {socket_listener.py:126} INFO - Subscribing to control topic eLan/235718/command
[2020-01-24 07:09:04,032] {logging.py:44} DEBUG - hbmqtt/P2CNZo6N0hyapjnM -out-> SubscribePacket(ts=2020-01-24 07:09:04.030970, fixed=MQTTFixedHeader(length=24, flags=0x2), variable=PacketIdVariableHeader(packet_id=7), payload=SubscribePayload(topics=[(‘eLan/235718/command’, 1)]))
[2020-01-24 07:09:04,047] {main_worker.py:276} INFO - Setting up http://192.168.0.10/api/devices/26369
[2020-01-24 07:09:04,048] {main_worker.py:291} INFO - Subscribing to control topic eLan/231060/command
[2020-01-24 07:09:04,050] {logging.py:34} DEBUG - hbmqtt/P2CNZo6N0hyapjnM <-in-- SubackPacket(ts=2020-01-24 07:09:04.049154, fixed=MQTTFixedHeader(length=3, flags=0x0), variable=PacketIdVariableHeader(packet_id=7), payload=SubackPayload(return_codes=[1]))
[2020-01-24 07:09:04,051] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: -out-> SubscribePacket(ts=2020-01-24 07:09:04.050038, fixed=MQTTFixedHeader(length=24, flags=0x2), variable=PacketIdVariableHeader(packet_id=6), payload=SubscribePayload(topics=[('eLan/231060/command', 1)])) [2020-01-24 07:09:04,051] {socket_listener.py:128} INFO - Subscribed to eLan/235718/command [2020-01-24 07:09:04,052] {socket_listener.py:41} INFO - Getting and publishing status for http://192.168.0.10/api/devices/24170 [2020-01-24 07:09:04,054] {logging.py:34} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: <-in-- SubackPacket(ts=2020-01-24 07:09:04.053649, fixed=MQTTFixedHeader(length=3, flags=0x0), variable=PacketIdVariableHeader(packet_id=6), payload=SubackPayload(return_codes=[1]))
[2020-01-24 07:09:04,055] {main_worker.py:293} INFO - Subscribed to eLan/231060/command
[2020-01-24 07:09:04,056] {main_worker.py:59} INFO - Publishing discovery for http://192.168.0.10/api/devices/26369
[2020-01-24 07:09:04,057] {main_worker.py:61} INFO - {‘type’: ‘light’, ‘product type’: ‘RFSA-62B’, ‘address’: 231060, ‘label’: ‘Свет спальня’}
[2020-01-24 07:09:04,057] {main_worker.py:64} INFO - Primary action of light is ON
[2020-01-24 07:09:04,060] {main_worker.py:85} INFO - Discovery published for http://192.168.0.10/api/devices/26369 {“schema”: “basic”, “name”: “\u0421\u0432\u0435\u0442 \u0441\u043f\u0430\u043b\u044c\u043d\u044f”, “unique_id”: “eLan-231060”, “device”: {“name”: “\u0421\u0432\u0435\u0442 \u0441\u043f\u0430\u043b\u044c\u043d\u044f”, “identifiers”: “eLan-light-231060”, “connections”: [[“mac”, “231060”]], “mf”: “Elko EP”, “mdl”: “RFSA-62B”}, “command_topic”: “eLan/231060/command”, “state_topic”: “eLan/231060/status”, “payload_off”: “{“on”:false}”, “payload_on”: “{“on”:true}”, “state_value_template”: “{%- if value_json.on -%}{“on”:true}{%- else -%}{“on”:false}{%- endif -%}”}
[2020-01-24 07:09:04,061] {main_worker.py:48} INFO - Getting and publishing status for http://192.168.0.10/api/devices/26369
[2020-01-24 07:09:04,067] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: -out-> PublishPacket(ts=2020-01-24 07:09:04.059496, fixed=MQTTFixedHeader(length=605, flags=0x0), variable=PublishVariableHeader(topic=homeassistant/light/231060/config, packet_id=None), payload=PublishPayload(data='bytearray(b\'{"schema": "basic", "name": "\\\\u0421\\\\u0432\\\\u0435\\\\u0442 \\\\u0441\\\\u043f\\\\u0430\\\\u043b\\\\u044c\\\\u043d\\\\u044f", "unique_id": "eLan-231060", "device": {"name": "\\\\u0421\\\\u0432\\\\u0435\\\\u0442 \\\\u0441\\\\u043f\\\\u0430\\\\u043b\\\\u044c\\\\u043d\\\\u044f", "identifiers": "eLan-light-231060", "connections": [["mac", "231060"]], "mf": "Elko EP", "mdl": "RFSA-62B"}, "command_topic": "eLan/231060/command", "state_topic": "eLan/231060/status", "payload_off": "{\\\\"on\\\\":false}", "payload_on": "{\\\\"on\\\\":true}", "state_value_template": "{%- if value_json.on -%}{\\\\"on\\\\":true}{%- else -%}{\\\\"on\\\\":false}{%- endif -%}"}\')')) [2020-01-24 07:09:04,082] {socket_listener.py:46} INFO - Status published for http://192.168.0.10/api/devices/24170 {'on': False, 'delay': False, 'automat': False, 'locked': False, 'delayed off: set time': 0, 'delayed on: set time': 0} [2020-01-24 07:09:04,088] {logging.py:44} DEBUG - hbmqtt/P2CNZo6N0hyapjnM -out-> PublishPacket(ts=2020-01-24 07:09:04.082356, fixed=MQTTFixedHeader(length=139, flags=0x0), variable=PublishVariableHeader(topic=eLan/235718/status, packet_id=None), payload=PublishPayload(data='bytearray(b\'{"on": false, "delay": false, "automat": false, "locked": false, "delayed off: set time": 0, "delayed on: set time": 0}\')')) [2020-01-24 07:09:04,103] {main_worker.py:53} INFO - Status published for http://192.168.0.10/api/devices/26369 {'on': False, 'delay': False, 'automat': False, 'locked': False, 'delayed off: set time': 0, 'delayed on: set time': 0} [2020-01-24 07:09:04,109] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: -out-> PublishPacket(ts=2020-01-24 07:09:04.103248, fixed=MQTTFixedHeader(length=139, flags=0x0), variable=PublishVariableHeader(topic=eLan/231060/status, packet_id=None), payload=PublishPayload(data=‘bytearray(b’{“on”: false, “delay”: false, “automat”: false, “locked”: false, “delayed off: set time”: 0, “delayed on: set time”: 0}’)’))
[2020-01-24 07:09:04,116] {socket_listener.py:110} INFO - Setting up http://192.168.0.10/api/devices/56319
[2020-01-24 07:09:04,117] {socket_listener.py:126} INFO - Subscribing to control topic eLan/113936/command
[2020-01-24 07:09:04,120] {logging.py:44} DEBUG - hbmqtt/P2CNZo6N0hyapjnM -out-> SubscribePacket(ts=2020-01-24 07:09:04.119442, fixed=MQTTFixedHeader(length=24, flags=0x2), variable=PacketIdVariableHeader(packet_id=8), payload=SubscribePayload(topics=[(‘eLan/113936/command’, 1)]))
[2020-01-24 07:09:04,133] {main_worker.py:276} INFO - Setting up http://192.168.0.10/api/devices/24170
[2020-01-24 07:09:04,133] {main_worker.py:291} INFO - Subscribing to control topic eLan/235718/command
[2020-01-24 07:09:04,136] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: -out-> SubscribePacket(ts=2020-01-24 07:09:04.135710, fixed=MQTTFixedHeader(length=24, flags=0x2), variable=PacketIdVariableHeader(packet_id=7), payload=SubscribePayload(topics=[('eLan/235718/command', 1)])) [2020-01-24 07:09:04,152] {logging.py:34} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: <-in-- SubackPacket(ts=2020-01-24 07:09:04.151797, fixed=MQTTFixedHeader(length=3, flags=0x0), variable=PacketIdVariableHeader(packet_id=7), payload=SubackPayload(return_codes=[1]))
[2020-01-24 07:09:04,153] {logging.py:34} DEBUG - hbmqtt/P2CNZo6N0hyapjnM <-in-- SubackPacket(ts=2020-01-24 07:09:04.152342, fixed=MQTTFixedHeader(length=3, flags=0x0), variable=PacketIdVariableHeader(packet_id=8), payload=SubackPayload(return_codes=[1]))
[2020-01-24 07:09:04,154] {main_worker.py:293} INFO - Subscribed to eLan/235718/command
[2020-01-24 07:09:04,154] {socket_listener.py:128} INFO - Subscribed to eLan/113936/command
[2020-01-24 07:09:04,154] {socket_listener.py:41} INFO - Getting and publishing status for http://192.168.0.10/api/devices/56319
[2020-01-24 07:09:04,155] {main_worker.py:59} INFO - Publishing discovery for http://192.168.0.10/api/devices/24170
[2020-01-24 07:09:04,155] {main_worker.py:61} INFO - {‘address’: 235718, ‘label’: ‘Kitchen2’, ‘type’: ‘light’, ‘product type’: ‘RFSA-62B’}
[2020-01-24 07:09:04,156] {main_worker.py:64} INFO - Primary action of light is ON
[2020-01-24 07:09:04,160] {main_worker.py:85} INFO - Discovery published for http://192.168.0.10/api/devices/24170 {“schema”: “basic”, “name”: “Kitchen2”, “unique_id”: “eLan-235718”, “device”: {“name”: “Kitchen2”, “identifiers”: “eLan-light-235718”, “connections”: [[“mac”, “235718”]], “mf”: “Elko EP”, “mdl”: “RFSA-62B”}, “command_topic”: “eLan/235718/command”, “state_topic”: “eLan/235718/status”, “payload_off”: “{“on”:false}”, “payload_on”: “{“on”:true}”, “state_value_template”: “{%- if value_json.on -%}{“on”:true}{%- else -%}{“on”:false}{%- endif -%}”}
[2020-01-24 07:09:04,161] {main_worker.py:48} INFO - Getting and publishing status for http://192.168.0.10/api/devices/24170
[2020-01-24 07:09:04,168] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: -out-> PublishPacket(ts=2020-01-24 07:09:04.158311, fixed=MQTTFixedHeader(length=487, flags=0x0), variable=PublishVariableHeader(topic=homeassistant/light/235718/config, packet_id=None), payload=PublishPayload(data='bytearray(b\'{"schema": "basic", "name": "Kitchen2", "unique_id": "eLan-235718", "device": {"name": "Kitchen2", "identifiers": "eLan-light-235718", "connections": [["mac", "235718"]], "mf": "Elko EP", "mdl": "RFSA-62B"}, "command_topic": "eLan/235718/command", "state_topic": "eLan/235718/status", "payload_off": "{\\\\"on\\\\":false}", "payload_on": "{\\\\"on\\\\":true}", "state_value_template": "{%- if value_json.on -%}{\\\\"on\\\\":true}{%- else -%}{\\\\"on\\\\":false}{%- endif -%}"}\')')) [2020-01-24 07:09:04,182] {socket_listener.py:46} INFO - Status published for http://192.168.0.10/api/devices/56319 {'temperature OUT': 17.3, 'temperature IN': 19.8, 'on': False, 'locked': False} [2020-01-24 07:09:04,187] {logging.py:44} DEBUG - hbmqtt/P2CNZo6N0hyapjnM -out-> PublishPacket(ts=2020-01-24 07:09:04.182232, fixed=MQTTFixedHeader(length=99, flags=0x0), variable=PublishVariableHeader(topic=eLan/113936/status, packet_id=None), payload=PublishPayload(data='bytearray(b\'{"temperature OUT": 17.3, "temperature IN": 19.8, "on": false, "locked": false}\')')) [2020-01-24 07:09:04,203] {main_worker.py:53} INFO - Status published for http://192.168.0.10/api/devices/24170 {'on': False, 'delay': False, 'automat': False, 'locked': False, 'delayed off: set time': 0, 'delayed on: set time': 0} [2020-01-24 07:09:04,209] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: -out-> PublishPacket(ts=2020-01-24 07:09:04.203070, fixed=MQTTFixedHeader(length=139, flags=0x0), variable=PublishVariableHeader(topic=eLan/235718/status, packet_id=None), payload=PublishPayload(data=‘bytearray(b’{“on”: false, “delay”: false, “automat”: false, “locked”: false, “delayed off: set time”: 0, “delayed on: set time”: 0}’)’))
[2020-01-24 07:09:04,225] {socket_listener.py:212} ERROR - Something went wrong. But don’t worry we will start over again.
Traceback (most recent call last):
File “socket_listener.py”, line 210, in
asyncio.get_event_loop().run_until_complete(main())
File “/usr/lib/python3.8/asyncio/base_events.py”, line 612, in run_until_complete
return future.result()
File “socket_listener.py”, line 106, in main
mac = str(info[‘device info’][‘address’])
KeyError: ‘address’
[2020-01-24 07:09:04,230] {socket_listener.py:215} ERROR - But at first take some break. Sleeping for 30 s
[2020-01-24 07:09:04,243] {main_worker.py:276} INFO - Setting up http://192.168.0.10/api/devices/56319
[2020-01-24 07:09:04,244] {main_worker.py:291} INFO - Subscribing to control topic eLan/113936/command
[2020-01-24 07:09:04,248] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: -out-> SubscribePacket(ts=2020-01-24 07:09:04.246490, fixed=MQTTFixedHeader(length=24, flags=0x2), variable=PacketIdVariableHeader(packet_id=8), payload=SubscribePayload(topics=[('eLan/113936/command', 1)])) [2020-01-24 07:09:04,252] {logging.py:34} DEBUG - hbmqtt/Eq\Y7L?gpmr:hL: <-in-- SubackPacket(ts=2020-01-24 07:09:04.251172, fixed=MQTTFixedHeader(length=3, flags=0x0), variable=PacketIdVariableHeader(packet_id=8), payload=SubackPayload(return_codes=[1]))
[2020-01-24 07:09:04,254] {main_worker.py:293} INFO - Subscribed to eLan/113936/command
[2020-01-24 07:09:04,255] {main_worker.py:59} INFO - Publishing discovery for http://192.168.0.10/api/devices/56319
[2020-01-24 07:09:04,256] {main_worker.py:48} INFO - Getting and publishing status for http://192.168.0.10/api/devices/56319
[2020-01-24 07:09:04,286] {main_worker.py:53} INFO - Status published for http://192.168.0.10/api/devices/56319 {‘temperature OUT’: 17.3, ‘temperature IN’: 19.8, ‘on’: False, ‘locked’: False}
[2020-01-24 07:09:04,295] {logging.py:44} DEBUG - hbmqtt/Eq\Y7L?g`pmr:hL: -out-> PublishPacket(ts=2020-01-24 07:09:04.285912, fixed=MQTTFixedHeader(length=99, flags=0x0), variable=PublishVariableHeader(topic=eLan/113936/status, packet_id=None), payload=PublishPayload(data=‘bytearray(b’{“temperature OUT”: 17.3, “temperature IN”: 19.8, “on”: false, “locked”: false}’)’))
[2020-01-24 07:09:04,328] {main_worker.py:404} ERROR - Something went wrong. But don’t worry we will start over again.
Traceback (most recent call last):
File “main_worker.py”, line 402, in
asyncio.get_event_loop().run_until_complete(main())
File “/usr/lib/python3.8/asyncio/base_events.py”, line 612, in run_until_complete
return future.result()
File “main_worker.py”, line 272, in main
mac = str(info[‘device info’][‘address’])
KeyError: ‘address’
[2020-01-24 07:09:04,336] {main_worker.py:407} ERROR - But at first take some break. Sleeping for 30 s

the device causing the failure is probably the thermostat RFSTI-11 / g?
I’ll post the list of devices later.

Hi,
could you please upgrade to new version in GIT?

The device causing problem is not in you log output (log is too short). You can identify it by loking into device list printed immediately after add-on start. The device which causes problems is probably after Kitchen2.

Anyway there is a new version in GIT. Run it with notice or info level and it should print out “bad” device after start in the log.

log new ver 1.5:

Summary

[2020-01-24 08:32:49,932] {client.py:440} DEBUG - Watch broker disconnection
[2020-01-24 08:32:49,936] {socket_listener.py:84} INFO - Authenticating to eLAN
[2020-01-24 08:32:49,961] {main_worker.py:217} INFO - Are we already authenticated? E.g. API check
[2020-01-24 08:32:49,968] {socket_listener.py:91} INFO - Getting eLan device list
[2020-01-24 08:32:49,984] {main_worker.py:227} INFO - Authenticating to eLAN
[2020-01-24 08:32:50,026] {socket_listener.py:99} INFO - Devices defined in eLan:
{‘44856’: {‘url’: ‘http://192.168.0.10/api/devices/44856’}, ‘26369’: {‘url’: ‘http://192.168.0.10/api/devices/26369’}, ‘26615’: {‘url’: ‘http://192.168.0.10/api/devices/26615’}, ‘39849’: {‘url’: ‘http://192.168.0.10/api/devices/39849’}, ‘32393’: {‘url’: ‘http://192.168.0.10/api/devices/32393’}, ‘56319’: {‘url’: ‘http://192.168.0.10/api/devices/56319’}, ‘24170’: {‘url’: ‘http://192.168.0.10/api/devices/24170’}, ‘08396’: {‘url’: ‘http://192.168.0.10/api/devices/08396’}, ‘01034’: {‘url’: ‘http://192.168.0.10/api/devices/01034’}, ‘54635’: {‘url’: ‘http://192.168.0.10/api/devices/54635’}, ‘45502’: {‘url’: ‘http://192.168.0.10/api/devices/45502’}}
[2020-01-24 08:32:50,031] {main_worker.py:234} INFO - Getting eLan device list
[2020-01-24 08:32:50,048] {socket_listener.py:212} ERROR - Something went wrong. But don’t worry we will start over again.
Traceback (most recent call last):
File “socket_listener.py”, line 210, in
asyncio.get_event_loop().run_until_complete(main())
File “/usr/lib/python3.8/asyncio/base_events.py”, line 612, in run_until_complete
return future.result()
File “socket_listener.py”, line 103, in main
info = await resp.json()
File “/elan2mqtt-1.5.0/aiohttp/client_reqrep.py”, line 1026, in json
raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message=‘Attempt to decode JSON with unexpected mimetype: ‘, url=URL(‘http://192.168.0.10/api/devices/44856’)
[2020-01-24 08:32:50,050] {socket_listener.py:215} ERROR - But at first take some break. Sleeping for 30 s
[2020-01-24 08:32:50,092] {main_worker.py:260} INFO - Getting eLan device list
[2020-01-24 08:32:50,152] {main_worker.py:264} INFO - Devices defined in eLan:
{‘44856’: {‘url’: ‘http://192.168.0.10/api/devices/44856’}, ‘26369’: {‘url’: ‘http://192.168.0.10/api/devices/26369’}, ‘26615’: {‘url’: ‘http://192.168.0.10/api/devices/26615’}, ‘39849’: {‘url’: ‘http://192.168.0.10/api/devices/39849’}, ‘32393’: {‘url’: ‘http://192.168.0.10/api/devices/32393’}, ‘56319’: {‘url’: ‘http://192.168.0.10/api/devices/56319’}, ‘24170’: {‘url’: ‘http://192.168.0.10/api/devices/24170’}, ‘08396’: {‘url’: ‘http://192.168.0.10/api/devices/08396’}, ‘01034’: {‘url’: ‘http://192.168.0.10/api/devices/01034’}, ‘54635’: {‘url’: ‘http://192.168.0.10/api/devices/54635’}, ‘45502’: {‘url’: ‘http://192.168.0.10/api/devices/45502’}}
[2020-01-24 08:32:50,173] {main_worker.py:278} INFO - Setting up http://192.168.0.10/api/devices/44856
[2020-01-24 08:32:50,174] {main_worker.py:293} INFO - Subscribing to control topic eLan/222930/command
[2020-01-24 08:32:50,176] {logging.py:44} DEBUG - hbmqtt/>fAGodQBvHJ7426 -out-> SubscribePacket(ts=2020-01-24 08:32:50.175375, fixed=MQTTFixedHeader(length=24, flags=0x2), variable=PacketIdVariableHeader(packet_id=1), payload=SubscribePayload(topics=[('eLan/222930/command', 1)])) [2020-01-24 08:32:50,193] {logging.py:34} DEBUG - hbmqtt/>fAGodQBvHJ7426 <-in-- SubackPacket(ts=2020-01-24 08:32:50.192331, fixed=MQTTFixedHeader(length=3, flags=0x0), variable=PacketIdVariableHeader(packet_id=1), payload=SubackPayload(return_codes=[1]))
[2020-01-24 08:32:50,195] {main_worker.py:295} INFO - Subscribed to eLan/222930/command
[2020-01-24 08:32:50,196] {main_worker.py:58} INFO - Publishing discovery for http://192.168.0.10/api/devices/44856
[2020-01-24 08:32:50,198] {main_worker.py:60} INFO - {‘address’: 222930, ‘label’: ‘Workroom’, ‘type’: ‘light’, ‘product type’: ‘RFSA-61B’}
[2020-01-24 08:32:50,198] {main_worker.py:63} INFO - Primary action of light is ON
[2020-01-24 08:32:50,202] {main_worker.py:84} INFO - Discovery published for http://192.168.0.10/api/devices/44856 {“schema”: “basic”, “name”: “Workroom”, “unique_id”: “eLan-222930”, “device”: {“name”: “Workroom”, “identifiers”: “eLan-light-222930”, “connections”: [[“mac”, “222930”]], “mf”: “Elko EP”, “mdl”: “RFSA-61B”}, “command_topic”: “eLan/222930/command”, “state_topic”: “eLan/222930/status”, “payload_off”: “{“on”:false}”, “payload_on”: “{“on”:true}”, “state_value_template”: “{%- if value_json.on -%}{“on”:true}{%- else -%}{“on”:false}{%- endif -%}”}
[2020-01-24 08:32:50,203] {main_worker.py:47} INFO - Getting and publishing status for http://192.168.0.10/api/devices/44856
[2020-01-24 08:32:50,213] {logging.py:44} DEBUG - hbmqtt/>fAGodQBvHJ7426 -out-> PublishPacket(ts=2020-01-24 08:32:50.201049, fixed=MQTTFixedHeader(length=487, flags=0x0), variable=PublishVariableHeader(topic=homeassistant/light/222930/config, packet_id=None), payload=PublishPayload(data='bytearray(b\'{"schema": "basic", "name": "Workroom", "unique_id": "eLan-222930", "device": {"name": "Workroom", "identifiers": "eLan-light-222930", "connections": [["mac", "222930"]], "mf": "Elko EP", "mdl": "RFSA-61B"}, "command_topic": "eLan/222930/command", "state_topic": "eLan/222930/status", "payload_off": "{\\\\"on\\\\":false}", "payload_on": "{\\\\"on\\\\":true}", "state_value_template": "{%- if value_json.on -%}{\\\\"on\\\\":true}{%- else -%}{\\\\"on\\\\":false}{%- endif -%}"}\')')) [2020-01-24 08:32:50,231] {main_worker.py:52} INFO - Status published for http://192.168.0.10/api/devices/44856 {'on': False, 'delay': False, 'automat': False, 'locked': False, 'delayed off: set time': 0, 'delayed on: set time': 0} [2020-01-24 08:32:50,236] {logging.py:44} DEBUG - hbmqtt/>fAGodQBvHJ7426 -out-> PublishPacket(ts=2020-01-24 08:32:50.230555, fixed=MQTTFixedHeader(length=139, flags=0x0), variable=PublishVariableHeader(topic=eLan/222930/status, packet_id=None), payload=PublishPayload(data=‘bytearray(b’{“on”: false, “delay”: false, “automat”: false, “locked”: false, “delayed off: set time”: 0, “delayed on: set time”: 0}’)’))
[2020-01-24 08:32:50,253] {main_worker.py:278} INFO - Setting up http://192.168.0.10/api/devices/26369
[2020-01-24 08:32:50,253] {main_worker.py:293} INFO - Subscribing to control topic eLan/231060/command
[2020-01-24 08:32:50,255] {logging.py:44} DEBUG - hbmqtt/>fAGodQBvHJ7426 -out-> SubscribePacket(ts=2020-01-24 08:32:50.255138, fixed=MQTTFixedHeader(length=24, flags=0x2), variable=PacketIdVariableHeader(packet_id=2), payload=SubscribePayload(topics=[('eLan/231060/command', 1)])) [2020-01-24 08:32:50,292] {logging.py:34} DEBUG - hbmqtt/>fAGodQBvHJ7426 <-in-- SubackPacket(ts=2020-01-24 08:32:50.291324, fixed=MQTTFixedHeader(length=3, flags=0x0), variable=PacketIdVariableHeader(packet_id=2), payload=SubackPayload(return_codes=[1]))
[2020-01-24 08:32:50,293] {main_worker.py:295} INFO - Subscribed to eLan/231060/command
[2020-01-24 08:32:50,293] {main_worker.py:58} INFO - Publishing discovery for http://192.168.0.10/api/devices/26369
[2020-01-24 08:32:50,294] {main_worker.py:60} INFO - {‘address’: 231060, ‘label’: ‘Bedroom1’, ‘type’: ‘light’, ‘product type’: ‘RFSA-62B’}
[2020-01-24 08:32:50,294] {main_worker.py:63} INFO - Primary action of light is ON
[2020-01-24 08:32:50,296] {main_worker.py:84} INFO - Discovery published for http://192.168.0.10/api/devices/26369 {“schema”: “basic”, “name”: “Bedroom1”, “unique_id”: “eLan-231060”, “device”: {“name”: “Bedroom1”, “identifiers”: “eLan-light-231060”, “connections”: [[“mac”, “231060”]], “mf”: “Elko EP”, “mdl”: “RFSA-62B”}, “command_topic”: “eLan/231060/command”, “state_topic”: “eLan/231060/status”, “payload_off”: “{“on”:false}”, “payload_on”: “{“on”:true}”, “state_value_template”: “{%- if value_json.on -%}{“on”:true}{%- else -%}{“on”:false}{%- endif -%}”}
[2020-01-24 08:32:50,297] {main_worker.py:47} INFO - Getting and publishing status for http://192.168.0.10/api/devices/26369
[2020-01-24 08:32:50,302] {logging.py:44} DEBUG - hbmqtt/>fAGodQBvHJ7426 -out-> PublishPacket(ts=2020-01-24 08:32:50.295645, fixed=MQTTFixedHeader(length=487, flags=0x0), variable=PublishVariableHeader(topic=homeassistant/light/231060/config, packet_id=None), payload=PublishPayload(data='bytearray(b\'{"schema": "basic", "name": "Bedroom1", "unique_id": "eLan-231060", "device": {"name": "Bedroom1", "identifiers": "eLan-light-231060", "connections": [["mac", "231060"]], "mf": "Elko EP", "mdl": "RFSA-62B"}, "command_topic": "eLan/231060/command", "state_topic": "eLan/231060/status", "payload_off": "{\\\\"on\\\\":false}", "payload_on": "{\\\\"on\\\\":true}", "state_value_template": "{%- if value_json.on -%}{\\\\"on\\\\":true}{%- else -%}{\\\\"on\\\\":false}{%- endif -%}"}\')')) [2020-01-24 08:32:50,319] {main_worker.py:52} INFO - Status published for http://192.168.0.10/api/devices/26369 {'on': False, 'delay': False, 'automat': False, 'locked': False, 'delayed off: set time': 0, 'delayed on: set time': 0} [2020-01-24 08:32:50,324] {logging.py:44} DEBUG - hbmqtt/>fAGodQBvHJ7426 -out-> PublishPacket(ts=2020-01-24 08:32:50.319036, fixed=MQTTFixedHeader(length=139, flags=0x0), variable=PublishVariableHeader(topic=eLan/231060/status, packet_id=None), payload=PublishPayload(data=‘bytearray(b’{“on”: false, “delay”: false, “automat”: false, “locked”: false, “delayed off: set time”: 0, “delayed on: set time”: 0}’)’))
[2020-01-24 08:32:50,342] {main_worker.py:278} INFO - Setting up http://192.168.0.10/api/devices/26615
[2020-01-24 08:32:50,342] {main_worker.py:293} INFO - Subscribing to control topic eLan/233568/command
[2020-01-24 08:32:50,344] {logging.py:44} DEBUG - hbmqtt/>fAGodQBvHJ7426 -out-> SubscribePacket(ts=2020-01-24 08:32:50.344018, fixed=MQTTFixedHeader(length=24, flags=0x2), variable=PacketIdVariableHeader(packet_id=3), payload=SubscribePayload(topics=[('eLan/233568/command', 1)])) [2020-01-24 08:32:50,380] {logging.py:34} DEBUG - hbmqtt/>fAGodQBvHJ7426 <-in-- SubackPacket(ts=2020-01-24 08:32:50.380133, fixed=MQTTFixedHeader(length=3, flags=0x0), variable=PacketIdVariableHeader(packet_id=3), payload=SubackPayload(return_codes=[1]))
[2020-01-24 08:32:50,382] {main_worker.py:295} INFO - Subscribed to eLan/233568/command
[2020-01-24 08:32:50,382] {main_worker.py:58} INFO - Publishing discovery for http://192.168.0.10/api/devices/26615
[2020-01-24 08:32:50,382] {main_worker.py:60} INFO - {‘address’: 233568, ‘label’: ‘Koridor’, ‘type’: ‘light’, ‘product type’: ‘RFSAI-61B’}
[2020-01-24 08:32:50,383] {main_worker.py:63} INFO - Primary action of light is ON
[2020-01-24 08:32:50,385] {main_worker.py:84} INFO - Discovery published for http://192.168.0.10/api/devices/26615 {“schema”: “basic”, “name”: “Koridor”, “unique_id”: “eLan-233568”, “device”: {“name”: “Koridor”, “identifiers”: “eLan-light-233568”, “connections”: [[“mac”, “233568”]], “mf”: “Elko EP”, “mdl”: “RFSAI-61B”}, “command_topic”: “eLan/233568/command”, “state_topic”: “eLan/233568/status”, “payload_off”: “{“on”:false}”, “payload_on”: “{“on”:true}”, “state_value_template”: “{%- if value_json.on -%}{“on”:true}{%- else -%}{“on”:false}{%- endif -%}”}
[2020-01-24 08:32:50,385] {main_worker.py:47} INFO - Getting and publishing status for http://192.168.0.10/api/devices/26615
[2020-01-24 08:32:50,391] {logging.py:44} DEBUG - hbmqtt/>fAGodQBvHJ7426 -out-> PublishPacket(ts=2020-01-24 08:32:50.384550, fixed=MQTTFixedHeader(length=486, flags=0x0), variable=PublishVariableHeader(topic=homeassistant/light/233568/config, packet_id=None), payload=PublishPayload(data='bytearray(b\'{"schema": "basic", "name": "Koridor", "unique_id": "eLan-233568", "device": {"name": "Koridor", "identifiers": "eLan-light-233568", "connections": [["mac", "233568"]], "mf": "Elko EP", "mdl": "RFSAI-61B"}, "command_topic": "eLan/233568/command", "state_topic": "eLan/233568/status", "payload_off": "{\\\\"on\\\\":false}", "payload_on": "{\\\\"on\\\\":true}", "state_value_template": "{%- if value_json.on -%}{\\\\"on\\\\":true}{%- else -%}{\\\\"on\\\\":false}{%- endif -%}"}\')')) [2020-01-24 08:32:50,409] {main_worker.py:52} INFO - Status published for http://192.168.0.10/api/devices/26615 {'on': False, 'delay': False, 'automat': False, 'locked': False, 'delayed off: set time': 0, 'delayed on: set time': 0} [2020-01-24 08:32:50,416] {logging.py:44} DEBUG - hbmqtt/>fAGodQBvHJ7426 -out-> PublishPacket(ts=2020-01-24 08:32:50.409175, fixed=MQTTFixedHeader(length=139, flags=0x0), variable=PublishVariableHeader(topic=eLan/233568/status, packet_id=None), payload=PublishPayload(data=‘bytearray(b’{“on”: false, “delay”: false, “automat”: false, “locked”: false, “delayed off: set time”: 0, “delayed on: set time”: 0}’)’))
[2020-01-24 08:32:50,435] {main_worker.py:406} ERROR - Something went wrong. But don’t worry we will start over again.
Traceback (most recent call last):
File “main_worker.py”, line 404, in
asyncio.get_event_loop().run_until_complete(main())
File “/usr/lib/python3.8/asyncio/base_events.py”, line 612, in run_until_complete
return future.result()
File “main_worker.py”, line 275, in main
logger.error("There is no MAC for device " + device_list[device])
TypeError: can only concatenate str (not “dict”) to str
[2020-01-24 08:32:50,436] {main_worker.py:409} ERROR - But at first take some break. Sleeping for 30 s

If this information is not enough, I can give more later. I will also try to remove devices from Elan one by one to understand which device is not working.

Hi,
do not bother removing devices one by one. This time it is “my” fault - I forgot to add string conversion to log output. Just reinstall (sorry again) from git (same version but updated files). Hopefully it will print what is needed.

The device which is causing problem is probably this one

http://192.168.0.10/api/devices/39849

for some reason MAC address is not provided. If you are using chrome please open developer console (F12) then go to elan pages and log-in. In chrome in console network tab there should appear request for this device. If you could post JSON content of reply it should help.

Excellent. All lighting control devices are defined and working.
http://192.168.0.10/api/devices/39849 this is the setting for a thermostat for underfloor heating (http://192.168.0.10/api/devices/56319 it is directly a thermostat) .
I think this is what you need
39849:

Summary
  1. {id: “39849”,…}

    id: “39849”
    device info: {label: “FloorWorkroom”, product type: “HeatCoolArea”, type: “temperature regulation area”}
    label: “FloorWorkroom”
    product type: “HeatCoolArea”
    type: “temperature regulation area”
    actions info: {mode: {type: “int”, min: 1, max: 4, step: 1},…}
    mode: {type: “int”, min: 1, max: 4, step: 1}
    type: “int”
    min: 1
    max: 4
    step: 1
    correction: {type: “number”, min: -5, max: 5, step: 0.5}
    type: “number”
    min: -5
    max: 5
    step: 0.5
    device action: {type: “object”}
    type: “object”
    controll: {type: “int”, min: 1, max: 4, step: 1}
    type: “int”
    min: 1
    max: 4
    step: 1
    power: {type: “int”, min: 0, max: 2, step: 1}
    type: “int”
    min: 0
    max: 2
    step: 1
    primary actions: []
    secondary actions: [“power”, “correction”, “mode”]
    0: “power”
    1: “correction”
    2: “mode”
    settings: {}
    schedule: “14679”
    schedule2: “14679”
    temperature sensor: {56319: “combi”}
    56319: “combi”
    MaxTemp: 26
    heating devices: [{id: “56319”, central source: true}]
    0: {id: “56319”, central source: true}
    id: “56319”
    central source: true
    cooling devices: []

56319

Summary

{id: “56319”,…}

id: “56319”
device info: {address: 113936, label: “TempWorkroom”, type: “thermometer”, product type: “RFSTI-11G”}

 address: 113936
 label: "TempWorkroom"
 type: "thermometer"
 product type: "RFSTI-11G"

actions info: {safe on: {type: “bool”}}

 safe on: {type: "bool"}

   type: "bool"

primary actions: []
secondary actions: []
settings: {}
offset: 0
offset2: 0

The door detector also did not appear in the list of devices:

Summary
  1. {id: “01034”,…}
    id: “01034”
    device info: {address: 180001, label: “Door”, type: “window detector”, product type: “RFWD-100”}
    address: 180001
    label: “Door”
    type: “window detector”
    product type: “RFWD-100”
    actions info: {automat: {type: “bool”}, deactivate: {type: null}, disarm: {type: “bool”}}
    automat: {type: “bool”}
    deactivate: {type: null}
    disarm: {type: “bool”}
    primary actions: [“deactivate”, “disarm”]
    0: “deactivate”
    1: “disarm”
    secondary actions: [“automat”]
    0: “automat”
    settings: {disarm: false}
    disarm: false

What devices does elan2mktt support now?

Supported devices - this is tricky question.

All devices are present and should be controllable over MQTT as elan2mqtt simply passes all messages both ways with no check. However that means you have to manually define them in HA configuration as template mqtt devices. From that point of view all devices are supported.

What you are more interested in is which devices are supported for autodiscovery. At the moment these are supported:

  • lights = device type set to light or dimmed light in eLan
  • thermostats = device type set to heating in eLan

I have been able to test those devices: RFSA-66M, RFDA-11B, RFSTI-11G (as heating in eLan)

For the others you have to go manual way.

If you can send me their messages for:

  • device info
  • status info
  • action commands + reply messages

I can try to add them to autodiscovery

Hello. Thank you so much for your help.
In version 1.6, all my devices were automatically added to the Home Assistant, now I see the state of the RFSTI-11g thermostat and the RFWD-100 door sensor.
If there is a template for manually adding devices, please share.
Thanks again for your work!

To manually add devices you have to follow HA documentation for MQTT integration

For example:




but there are others…

You may take look into main_worker.py where definitions are created. They are not in format required for HA config files but can give you some hints.

What is important for you is that elan2mqtt creates two topics for each device:

  • Status messages are using topic /eLan/device_mac_address/status
  • Command messages are using topic /eLan/device_mac_address/command

Device_mac_adress is the adress printed on each device (without : ) and is part of device URL seen in the web console.

If you create config for new device please share it. I’ll try to add it to autodiscovery.


For RFWD-100 I just guessed format of status message. Plese test it and if you could share full status message from it it would help. I beleive it reports more information.

1 Like

RFWD-100 from chrome developer console:

Summary

RFWD-100/state (closed door):

{alarm: true, detect: false, tamper: “closed”, automat: false, battery: true, disarm: false}
alarm: true
detect: false
tamper: “closed”
automat: false
battery: true
disarm: false

RFWD-100/state (open door):

{alarm: true, detect: true, tamper: “closed”, automat: false, battery: true, disarm: false}
alarm: true
detect: true
tamper: “closed”
automat: false
battery: true
disarm: false

Now the door sensor does not display a change in state, it is always in the off state, regardless of whether the door is open or closed.
Hope this information helps.

Yes. It helps. New version is in GIT. Hopefully it is right this time.

Hello, i’m a newbie in Home assistant, so tried to manually add RF actor, but it doesn’t work. Could you help me to figure out what is wrong? Thanks.

switch:
  - platform: mqtt
    name: Zavlaha_V1
    unique_id: eLan-211020
    state_topic: eLan/211020/status
    command_topic: eLan/211020/command
    json_attributes_topic: eLan/211020/status
    payload_off: '{"on":false}'
    payload_on: '{"on":true}'
    value_template: '{%- if value_json.on -%}{"on":true}{%- else -%}{"on":false}{%- endif -%}'
    device:
      name: Zavlaha_V1
      identifiers: eLan-switch-211020
      connections:
        - - mac
          - '211020'
      manufacturer: Elko EP
      model: RFSA-66M