Hi,
Thanks for creating this
I’ve been trying to test it but I get the following errors when trying to switch a bulb on/off
Traceback (most recent call last):
File “/usr/lib/python3.4/asyncio/tasks.py”, line 233, in _step
result = coro.throw(exc)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/core.py”, line 1015, in _event_to_service_call
yield from service_handler.func(service_call)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/light/init.py”, line 246, in async_handle_light_service
yield from light.async_turn_on(**params)
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/homeassistant/.homeassistant/custom_components/light/magicbluelight.py”, line 84, in turn_on
_LOGGER.error(‘Could not connect to the MagicBlue %s’, bulb_mac_address)
NameError: name ‘bulb_mac_address’ is not defined
17-04-25 21:19:52 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/home/homeassistant/.homeassistant/custom_components/light/magicbluelight.py”, line 82, in turn_on
self._light.connect()
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/magicblue/magicbluelib.py”, line 49, in connect
bluetooth_adapter_nr)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/bluepy/btle.py”, line 318, in init
self.connect(deviceAddr, addrType, iface)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/bluepy/btle.py”, line 353, in connect
self._startHelper()
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/bluepy/btle.py”, line 210, in _startHelper
universal_newlines=True)
File “/usr/lib/python3.4/subprocess.py”, line 859, in init
restore_signals, start_new_session)
File “/usr/lib/python3.4/subprocess.py”, line 1457, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: ‘/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/bluepy/bluepy-helper’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.4/asyncio/tasks.py”, line 233, in _step
result = coro.throw(exc)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/core.py”, line 1015, in _event_to_service_call
yield from service_handler.func(service_call)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/light/init.py”, line 246, in async_handle_light_service
yield from light.async_turn_on(**params)
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/homeassistant/.homeassistant/custom_components/light/magicbluelight.py”, line 84, in turn_on
_LOGGER.error(‘Could not connect to the MagicBlue %s’, bulb_mac_address)
NameError: name ‘bulb_mac_address’ is not defined
if I use the following as a PI user I can turn them on/off and change the colour so they are working and I have the correct mac address.
sudo magicblueshell -c ‘set_color red’ -m F2:F1:09:E6:DE:78
sudo magicblueshell -c ‘set_color blue’ -m C1:40:5D:6E:A3:E8
My yaml config…
light:
- platform: magicbluelight
name: 'BedroomRedBot'
address: C1:40:5D:6E:A3:E8
version: 8
- platform: magicbluelight
name: 'PC'
address: F2:F1:09:E6:DE:78
version: 8