Considering that the possibility to have more than one Max! Cube in the same network/house is real
i think that would be important to let Hassio integrate multiple Max! Cube configuration.
I’ve now 2 cubes in my house so i can provide testing. If it’s neccessary i can install even more.
Of course i’ve integrated in Hassio 1 cube and it’s working very fine.
I take it you’ve already tried adding two cubes, either like this:
maxcube:
- host: 192.168.xxx.xxx
- host: 192.168.xxx.xxx
Or:
maxcube 1:
host: 192.168.xxx.xxx
maxcube 2:
host: 192.168.xxx.xxx
Yes sure i’ve tryed both methods with no success
Two maxcube instances are sharing the same namespace:
https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/maxcube.py#L50
That’s why multiple maxcubes aren’t supported at the moment. I wil try to implement a solution.
I fixed the issue. Please try to install (just copy) the custom component into your custom_components directory and give it a try: https://github.com/syssi/maxcube
This configuration should be possible now:
maxcube 1:
host: 192.168.xxx.xxx
maxcube 2:
host: 192.168.xxx.xxx
I’ve tryed now:
1 - binary_sensor (folder) climate (folder) and maxcube.py inside custom_components
2 - changed configuration with the one you suggest:
maxcube 1:
host: 192.168.86.133
maxcube 2:
host: 192.168.86.52
3 - restarted Hass
But i recieve a config validatin error:
Testing configuration at /config
Fatal error while loading config: ‘maxcube’
Failed config
General Errors:
- ‘maxcube’
Successful config (partial)
A pity. I will implement the format above tonight:
maxcube:
- host: 192.168.xxx.xxx
- host: 192.168.xxx.xxx
Please update the custom component and give it a try with the new configuration schema:
maxcube:
gateways:
- host: 192.168.86.133
port: 62910
- host: 192.168.86.52
port: 62910
The port is optional.
Ok so, i’ve uploaded new files in custom_components and new configurations as you wrote me:
maxcube:
gateways:
- host: 192.168.86.133
port: 62910
- host: 192.168.86.52
port: 62910
I’ve these error on log:
2018-03-27 00:57:47 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.binary_sensor.maxcube. Make sure all dependencies are installed
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/loader.py", line 142, in get_component
module = importlib.import_module(path)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/config/custom_components/binary_sensor/maxcube.py", line 10, in <module>
from homeassistant.components.maxcube import DATA_KEY
ImportError: cannot import name 'DATA_KEY'
2018-03-27 00:57:47 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.climate.maxcube. Make sure all dependencies are installed
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/loader.py", line 142, in get_component
module = importlib.import_module(path)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/config/custom_components/climate/maxcube.py", line 13, in <module>
from homeassistant.components.maxcube import DATA_KEY
ImportError: cannot import name 'DATA_KEY'
2018-03-27 00:57:47 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform maxcube
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 82, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/homeassistant/components/binary_sensor/maxcube.py", line 18, in setup_platform
cube = hass.data[MAXCUBE_HANDLE].cube
AttributeError: 'dict' object has no attribute 'cube'
2018-03-27 00:57:47 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform maxcube
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 82, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/maxcube.py", line 27, in setup_platform
cube = hass.data[MAXCUBE_HANDLE].cube
AttributeError: 'dict' object has no attribute 'cube'
Fixed.
Ok. Uploaded your new script
Now in the log
2018-03-27 16:05:24 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform maxcube
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 82, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/binary_sensor/maxcube.py", line 23, in setup_platform
for device in cube.devices:
AttributeError: 'str' object has no attribute 'devices'
2018-03-27 16:05:24 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform maxcube
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 82, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/climate/maxcube.py", line 32, in setup_platform
for device in cube.devices:
AttributeError: 'str' object has no attribute 'devices'
Sorry for the amount of round trips. Wait a second.
Please update the custom component again. The issue is fixed.
Don’t worry i’m happy to contribute
now the log is this
2018-03-27 17:12:33 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform maxcube
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 82, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 245, in result
raise self._exception
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/binary_sensor/maxcube.py”, line 23, in setup_platform
for device in cube.devices:
AttributeError: ‘MaxCubeHandle’ object has no attribute ‘devices’
2018-03-27 17:12:33 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform maxcube
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 82, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 245, in result
raise self._exception
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/climate/maxcube.py”, line 32, in setup_platform
for device in cube.devices:
AttributeError: ‘MaxCubeHandle’ object has no attribute ‘devices’
Fixed.
Done. New error here
2018-03-27 21:41:16 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform maxcube
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 82, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 245, in result
raise self._exception
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/binary_sensor/maxcube.py”, line 25, in setup_platform
cube.room_by_id(device.room_id).name, device.name)
NameError: name ‘cube’ is not defined
2018-03-27 21:41:16 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform maxcube
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 82, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 245, in result
raise self._exception
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/climate/maxcube.py”, line 34, in setup_platform
cube.room_by_id(device.room_id).name, device.name)
NameError: name ‘cube’ is not defined
Fixed, too.
Ok now the log is:
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
2018-03-27 22:27:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
state = self.state
File "/usr/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 461, in state
if self.current_operation:
File "/config/custom_components/climate/maxcube.py", line 99, in current_operation
device = self._cubehandle.cube.device_by_rf(self._rf_address)
AttributeError: 'MaxThermostat' object has no attribute 'cube'
Fixed.
Yeah!! Great job syssi!! Everything is working. I will test thermostat in both cubes now but it seem ok.
What to do now? If everything is fine, this soution could be implementend in one of the next Home Assistant release, right?