jodehli / pyloxone Goto Github PK
View Code? Open in Web Editor NEWPython Loxone binding
License: Apache License 2.0
Python Loxone binding
License: Apache License 2.0
Hi,
I am using PyLoxone since some time. Now I wanted to set an input_number to define an alarm clock. The input_number can be set, but it doesn't change the value. If I disable PyLoxone (just # in front of the Loxone config lines in configuration.yaml) , the input_number works again.
Could you please take a look?
Regards,
Harald
In home assistant my sensors only show a short pulse (push button) but not the correct state of my lights.
Is it possible to retrieve the state of lights via loxone and show them in Home assitant?
Hi,
If you would like to start a wiki page in this repo, I offer to help writing a quick "hello world" on how to set this up (i.e with HACS) and how to quickly get the Loxone Demo Case working in Homeassistant.
I just got this integration up and running and am able to control things through the mini server outputs.
I received the following error in HA after installing to my custom_components directory:
Error during setup of component loxone
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 384, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/util/retry.py", line 367, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/packages/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 384, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 145, in _async_setup_component
hass, processed_config)
File "/home/homeassistant/.homeassistant/custom_components/loxone.py", line 129, in async_setup
request_code = lox_config.getJson()
File "/home/homeassistant/.homeassistant/custom_components/loxone.py", line 104, in getJson
verify=False)
File "/srv/homeassistant/lib/python3.5/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
Hi,
During startup I get an error. If I use same ip, port, username and pwd, I can access miniserver from browser (also openHAB connects).
Error message:
`2021-01-29 10:58:08 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry PyLoxone for loxone
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests_async/adapters.py", line 48, in send
response = await self.pool.request(
File "/usr/local/lib/python3.8/site-packages/http3/interfaces.py", line 49, in request
return await self.send(request, verify=verify, cert=cert, timeout=timeout)
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/connection_pool.py", line 130, in send
raise exc
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/connection_pool.py", line 120, in send
response = await connection.send(
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/connection.py", line 53, in send
await self.connect(verify=verify, cert=cert, timeout=timeout)
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/connection.py", line 81, in connect
reader, writer, protocol = await self.backend.connect(
File "/usr/local/lib/python3.8/site-packages/http3/concurrency.py", line 204, in connect
stream_reader, stream_writer = await asyncio.wait_for( # type: ignore
File "/usr/local/lib/python3.8/asyncio/tasks.py", line 494, in wait_for
return fut.result()
File "/usr/local/lib/python3.8/asyncio/streams.py", line 52, in open_connection
transport, _ = await loop.create_connection(
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 986, in create_connection
infos = await self._ensure_resolved(
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1365, in _ensure_resolved
return await loop.getaddrinfo(host, port, family=family, type=type,
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 825, in getaddrinfo
return await self.run_in_executor(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 236, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/loxone/init.py", line 122, in async_setup_entry
if not await miniserver.async_setup():
File "/config/custom_components/loxone/miniserver.py", line 118, in async_setup
request_code = await self.lox_config.getJson()
File "/config/custom_components/loxone/api.py", line 60, in getJson
api_resp = await requests.get(url_api,
File "/usr/local/lib/python3.8/site-packages/requests_async/api.py", line 11, in get
return await request("get", url, params=params, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_async/api.py", line 6, in request
return await session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_async/sessions.py", line 79, in request
resp = await self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_async/sessions.py", line 136, in send
r = await adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_async/adapters.py", line 58, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: [Errno -3] Try again`
Hi,
Love your Loxone integration into HASSIO!
I have one question about door sensors. If I put them into Lovelace they show up as an "eye icon", with device type "digital_sensor". The problem I have is, that I would like the icon to be a door-open or door-closed icon. I tried a lot so far (e.g. template, customize..), but nothing changed.
Any idea what has to be done, that the icon changes according to the state?
Thank you very much in advance!!
BR
Chris
Hi,
I am a new Home Assistant user before i used Homebridge and node red, a lot off my lights are controlled via the Loxone mini server i now have setup your integration with hacs but only my switches and sensors are showing up the lights with light controllers are not showing in home assistant can someone help me how to configure these. The Loxone lights group is empty in home assistant and i have a notification that says:The following integrations and platforms could not be set up: loxone.light please check your config
configuration.yaml file:
#Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
#Text to speech
tts:
alexa:
smart_home:
loxone:
port: 80
host: 192.168.0.30
username: ***
password: ***
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
The scenes from my Light Controller V2 are disappearing all the time. Sometimes - after creating them, and after reboot the HA server and Loxne, they are there for some minutes, but after that, they disappear.
I rebooted several times, I deletes PyLoxone, but nothing helps.
The box for creating scenes in the (GUI) configuration is set - also on config file the varibale generate_scenes is set to true.
Hey,
When i restart HA i get this error, i already tried to reinstall the plugin but no success.
Also tried to make a new account to be sure but same error
Error setting up entry PyLoxone for loxone
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 236, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/loxone/init.py", line 122, in async_setup_entry
res = await lox.async_init()
File "/config/custom_components/loxone/api.py", line 320, in async_init
_ = await self._ws.recv()
File "/usr/local/lib/python3.8/site-packages/websockets/protocol.py", line 509, in recv
await self.ensure_open()
File "/usr/local/lib/python3.8/site-packages/websockets/protocol.py", line 812, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedOK: code = 1000 (OK), reason = normally closed
After moving to the newest HA version I get an error message all entities:
Light is deprecated, modify LoxonelightcontrollerV2 to extend LightEntity
Light is deprecated, modify LoxoneColorPickerV2 to extend LightEntity
Light is deprecated, modify LoxoneDimmer to extend LightEntity
CoverDevice is deprecated, modify LoxoneGate to extend CoverEntity
CoverDevice is deprecated, modify LoxoneWindow to extend CoverEntity
CoverDevice is deprecated, modify LoxoneJalousie to extend CoverEntity
SwitchDevice is deprecated, modify LoxoneTimedSwitch to extend SwitchEntity
SwitchDevice is deprecated, modify LoxoneSwitch to extend SwitchEntity
SwitchDevice is deprecated, modify LoxoneIntercomSubControl to extend SwitchEntity
Covers still work, dimming of lights also. But switches are just working "one-way" (just switching on, off is no longer working). Would be great if PyLoxone could support the newest HA version.
Error occurs since the installation of the latest Home Assistant OS 5.8!
Logger: homeassistant.components.sensor
Source: custom_components/loxone/sensor.py:247
Integration: Sensor (documentation, issues)
First occurred: 19:57:49 (2 occurrences)
Last logged: 19:57:49
Error adding entities for domain sensor with platform loxone
Error while setting up loxone platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 316, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
sstate = self.state
File "/config/custom_components/loxone/sensor.py", line 247, in state
return self._format % self._state
TypeError: must be real number, not str
Is this still working? I tried to use it today but it keeps saying the component failed.
Maybe an integration for the intelligent room controller? :)
Nice job so far, works great!
It's possible to send commands from Loxone to HA over Virtual Out? How?
Hi @JoDehli
since I updated your PiLoxone to version 0.3.3 the communication between HASS and Loxone doesn't work.
could you be so kind and send me the link to version 0.3.2?
It worked fine with the old version.
Thanks
Vic
hi, i installed everything correctly i guess. I can see my loxone lights. but when I flip a switch it is handled as 2 pulses somehow.. It are pushbuttons in my loxone config. But it gets displayed as switches in homeassistant.
How did you fix this ?
Since Home assistant 0.109.0 they build in a check for too much I/O operations (or http calls).
I am seeing this in my log files:
2020-05-02 21:57:09 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for loxone doing I/O at custom_components/loxone/init.py, line 112: verify=False)
2020-05-02 21:57:10 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for loxone doing I/O at custom_components/loxone/init.py, line 992: response = requests.get(command, auth=(self._username, self._pasword), timeout=1)
It's related to this:
https://www.home-assistant.io/blog/2020/04/29/release-109/#detection-of-blocking-io-in-the-event-loop
I cannot understand python well, but could it be that the same http call is performed multiple times?
Could you have a look at this problem.
It's causing me to restart Home assistant 10 times and 9 out of 10 cases, Loxone fails to startup.
Hello,
I am trying to set-up PyLoxone in HA (under ProxMox) following the manual process. But, when I restart, I get the error:
Setup failed for loxone: Integration not found
Logger: homeassistant.setup
Source: setup.py:138
Any idea how to fix this issue?
Hello,
I really love your binding to Loxone, it is very promising.
Based on the instructions I successfully installed the latest version and it seems working, almost...
I can see some (only 2-3) items from Loxone project under HA, but not more.
I checked the logs and can see two related messages:
1.)
Error while setting up platform loxone
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/config/custom_components/loxone/switch.py", line 33, in async_setup_platform
room=get_room_name_from_room_uuid(loxconfig, push_button['room']),
KeyError: 'room'
2.)
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/loxone/sensor.py", line 89, in event_handler
self.schedule_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 418, in schedule_update_ha_state
self.hass.add_job(self.async_update_ha_state(force_refresh))
AttributeError: 'NoneType' object has no attribute 'add_job'
Do you have any idea what the problem could be?
Thanks in advance.
Have you considered re-opening home-assistant/core#9706 now that you seem to be back using Home Assistant (and are probably more used to git)?
Thanks Jo for nice integration,
I have updated my component from late November to current version and I found out that switching lights on was not working for me while everything else worked fine (including switching off)
I found out that in my configuration I must have this value to be "on"
PyLoxone/custom_components/loxone/light.py
Line 280 in bb83c4b
can you maybe check if that's broader issue?
thanks,
david
Is it possible to specify the Unit of Measurement for the sensors that Pyloxone provides to HA? My scenario is that I can see for instance my temperature sensor and the right values in Home Assistant, however when I try to put them on history graphs, instead of a proper line graph I get a bars graph because home assistant says that the related sensors do not have a specified unit of measure.
Is this something that I should already be able to do or a new feature required on PyLoxone?
Thanks!
I am getting the following message:
GitHub returned 404 for https://api.github.com/repos/JoDehli/PyLoxone/contents/custom_components/__init__.py/manifest.json
I assume you need to remove the "init.py" file in your "custom_components" folder.
If you can solve this problem, It would enable installing your awesome custom component using HACS.
Hi !
Thanks again for the integration. It works very well.
I just installed 1-Wire thermometer and overall it works, sensor are ok in HA.
However, for a reason, every 10 to 20 minutes, I get the value 0 for all thermometer in HA.
But I monitor the 1-wire bus on Loxone and no 0 value is reported.
I have one hypothesis but I cannot confirm yet. It looks like if the temperature does not change, there is no notification on the web socket. I tried to change the "minimal change" value to increase notification frequency. I'll see if it improves something.
From a new install of HA I am unable to add this as a new add-on repository due to a missing repository.json file. Can you add one?
Hi,
I really love this integration. Thank you for this.
I updated today to version 0.25 and after update all Loxone (light) scenes disappeared from my installation. Any idea why?
I have HA 0.114.4 installed, latest version.
Thx for any hint.
Dear developer,
Thank you very much for your integration !
Unfortunately I have this error in my HA log at every restart :
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/loxone/scene.py", line 46, in async_setup_platform async_call_later(hass, 0.5, async_call()) File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1179, in async_call_later return async_track_point_in_utc_time( File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1133, in async_track_point_in_utc_time job = action if isinstance(action, HassJob) else HassJob(action) File "/usr/src/homeassistant/homeassistant/core.py", line 174, in __init__ raise ValueError("Coroutine not allowed to be passed to HassJob") ValueError: Coroutine not allowed to be passed to HassJob
I am running HA 118.0, PyLoxone 0.2.7 (generate_scenes: true), Loxone Config 11.1.9.14
Let me know if you need more infos from my Loxone configuration.
Thanks !
'''
WARNING (MainThread) [homeassistant.helpers.service] Unable to find services.yaml for the loxone integration
'''
Any ideas how to correct this error please.
Hi !
I'm running your custom component for months now. It's great and stable.
Could you please make it an official HA integration?
Please Please Please Please Please Please Please Please :-)
Browsing manually or searching "loxone" or "PyLoxone" brings no result in HACS
HACS :
Integration version: | 0.22.2
Frontend version: | 20200229193422
Repositories: | 397
HA:
arch | armv7l |
---|---|
dev | false |
docker | true |
hassio | false |
os_name | Linux |
python_version | 3.7.6 |
version | 0.105.1 |
virtualenv | false |
Hi,
I propose the following improvements regarding Light Controller integration
Assumptions: the Loxone Light Controller v2 is configured with dimmable and rgb light circuits.
AS-IS :
For each Loxone Light Controllers v2 are created in HA :
TO-BE:
For each Loxone Light Controllers v2 are created in HA :
A)
1 group named by the Light Controller name, and inside this group :
B)
n individual lights entities (switch, colorpicker, dimmer). Not assigned to a group
Hi,
I can't seem to hook up to a Miniserver Go. I can confirm it's working over HTTP (port 80), but I can't get HA to connect to it.
My config (I also tried port: 80
, but that didn't change anything):
loxone:
port: 8080
host: 10.2.0.48
username: admin
password: admin
generate_scenes: false
The error:
2020-07-11 23:23:29 WARNING (MainThread) [homeassistant.setup] Setup of loxone is taking over 10 seconds.
2020-07-11 23:23:29 ERROR (MainThread) [homeassistant.setup] Error during setup of component loxone
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/h11/_state.py", line 249, in _fire_event_triggered_transitions
new_state = EVENT_TRIGGERED_TRANSITIONS[role][state][event_type]
KeyError: <class 'h11._events.ConnectionClosed'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 193, in _async_setup_component
result = await asyncio.wait_for(task, SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/config/custom_components/loxone/__init__.py", line 201, in async_setup
request_code = await lox_config.getJson()
File "/config/custom_components/loxone/__init__.py", line 115, in getJson
verify=False, timeout=TIMEOUT)
File "/usr/local/lib/python3.7/site-packages/requests_async/api.py", line 11, in get
return await request("get", url, params=params, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests_async/api.py", line 6, in request
return await session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests_async/sessions.py", line 79, in request
resp = await self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/site-packages/requests_async/sessions.py", line 136, in send
r = await adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests_async/adapters.py", line 55, in send
timeout=timeout,
File "/usr/local/lib/python3.7/site-packages/http3/interfaces.py", line 49, in request
return await self.send(request, verify=verify, cert=cert, timeout=timeout)
File "/usr/local/lib/python3.7/site-packages/http3/dispatch/connection_pool.py", line 130, in send
raise exc
File "/usr/local/lib/python3.7/site-packages/http3/dispatch/connection_pool.py", line 121, in send
request, verify=verify, cert=cert, timeout=timeout
File "/usr/local/lib/python3.7/site-packages/http3/dispatch/connection.py", line 59, in send
response = await self.h11_connection.send(request, timeout=timeout)
File "/usr/local/lib/python3.7/site-packages/http3/dispatch/http11.py", line 58, in send
http_version, status_code, headers = await self._receive_response(timeout)
File "/usr/local/lib/python3.7/site-packages/http3/dispatch/http11.py", line 130, in _receive_response
event = await self._receive_event(timeout)
File "/usr/local/lib/python3.7/site-packages/http3/dispatch/http11.py", line 161, in _receive_event
event = self.h11_state.next_event()
File "/usr/local/lib/python3.7/site-packages/h11/_connection.py", line 439, in next_event
exc._reraise_as_remote_protocol_error()
File "/usr/local/lib/python3.7/site-packages/h11/_util.py", line 72, in _reraise_as_remote_protocol_error
raise self
File "/usr/local/lib/python3.7/site-packages/h11/_connection.py", line 422, in next_event
self._process_event(self.their_role, event)
File "/usr/local/lib/python3.7/site-packages/h11/_connection.py", line 238, in _process_event
self._cstate.process_event(role, type(event), server_switch_event)
File "/usr/local/lib/python3.7/site-packages/h11/_state.py", line 238, in process_event
self._fire_event_triggered_transitions(role, event_type)
File "/usr/local/lib/python3.7/site-packages/h11/_state.py", line 253, in _fire_event_triggered_transitions
.format(event_type.__name__, role, self.states[role]))
h11._util.RemoteProtocolError: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE
Hi!
I'm trying to setup the PyLoxone component, but I'm running into a TimeoutError!
I'm able to access the LoxAPP3.json file using the host, port and credentials in a browser, so I guess my configuration is fine. Pinging the miniserver from the Home Assistant Raspberry Pi also succeeds.
I'm running HassOS v4.17 with Home Assistant v0.118.5 on a Raspberry Pi 4.
My configuration in configuration.yaml
loxone:
port: 50080
host: 192.168.1.10
username: HomeAssistant
password: *********
generate_scenes: true
I've enabled debug logging, this is the only relevant info I could find:
2020-12-08 23:33:43 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry PyLoxone for loxone
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/http3/concurrency.py", line 204, in connect
stream_reader, stream_writer = await asyncio.wait_for( # type: ignore
File "/usr/local/lib/python3.8/asyncio/tasks.py", line 498, in wait_for
raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests_async/adapters.py", line 48, in send
response = await self.pool.request(
File "/usr/local/lib/python3.8/site-packages/http3/interfaces.py", line 49, in request
return await self.send(request, verify=verify, cert=cert, timeout=timeout)
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/connection_pool.py", line 130, in send
raise exc
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/connection_pool.py", line 120, in send
response = await connection.send(
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/connection.py", line 53, in send
await self.connect(verify=verify, cert=cert, timeout=timeout)
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/connection.py", line 81, in connect
reader, writer, protocol = await self.backend.connect(
File "/usr/local/lib/python3.8/site-packages/http3/concurrency.py", line 209, in connect
raise ConnectTimeout()
http3.exceptions.ConnectTimeout
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 236, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/loxone/__init__.py", line 247, in async_setup_entry
request_code = await lox_config.getJson()
File "/config/custom_components/loxone/__init__.py", line 109, in getJson
version_resp = await requests.get(url_version,
File "/usr/local/lib/python3.8/site-packages/requests_async/api.py", line 11, in get
return await request("get", url, params=params, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_async/api.py", line 6, in request
return await session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_async/sessions.py", line 79, in request
resp = await self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_async/sessions.py", line 136, in send
r = await adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_async/adapters.py", line 60, in send
raise ConnectTimeout(err, request=request)
requests.exceptions.ConnectTimeout
Hi
adding the repository via HACS, I get following Message:
An error occurred while processing
Exception: HacsException
Message: GitHub returned 404 for https://api.github.com/repos/JoDehli/PyLoxone.git
Could not add this repository, make sure it is compliant with HACS.
Log says:
Log Details (ERROR)
Logger: hacs.repository.integration.JoDehli.PyLoxone.git
Source: custom_components/hacs/helpers/validate_repository.py:36
First occurred: 7:14:24 AM (3 occurrences)
Last logged: 8:53:30 AM
What am I doing wrong?
Thanks
Vic
Hi,
I propose to improve the Cover integration.
In loxone miniserver there are 6 types of objects to be mapped to Cover in HA:
In HA, there only 1 object Cover which has 10 possible values for device_class:
In current PyLoxone version:
Anyway, I suggest improving this part because it has several impacts related to voice assistant integrations (alexa, google assistant, homekit...). The vocal commands and security might be different whether it's door or a garage door or other.
As a workaround I'm using this type of entry in customize.yaml, but this is not ideal:
cover.porte_garage:
device_class: garage
Here below one mapping table proposal. I don't know if loxone API is offering all this flexibility, but I refer to loxone config capabilities
Loxone Config | device_class |
---|---|
Garage/Gate controller, animation =0: Garage door | garage |
Garage/Gate controller, animation = 1: Single Gate Opening to the left | door |
Garage/Gate controller, animation = 2: Single Gate opening to the right | door |
Garage/Gate controller, animation = 3: Gate opening to both side | door |
Garage/Gate controller, animation = 4: Folding Door opening to the left | door |
Garage/Gate controller, animation = 5: Folding Door opening to the right | door |
Skylight controller | window |
Skylight shade controller | shade |
Automatic blind controller, type = 0: Venetian Slatted Blinds | blind |
Automatic blind controller, type = 1: Roller Blinds or Shutters | blind |
Automatic blind controller, type = 2: Curtains opening to both sides | curtain |
Automatic blind controller, type = 3: Schlotterer Retrolux | shutter |
Automatic blind controller, type = 4: Curtain left | curtain |
Automatic blind controller, type = 5: Curtain right | curtain |
Automatic blind controller, type = 6: Awning | awning |
EIB blind controller | blind |
Door controller | door |
Thanks
I followed the steps, but for step 4 I can't seem to find Pyloxone under integrations..
You are doing an amazing work over the past weeks.
I can finally use home assistant and homekit.
Thank you !
An because I can't create an issue just to say "thank you", I have a small feature request.
I use light controller v2 with multiple outputs. It would be cool if you could add them as independent "lights" as well (and if possible dimmable light when applicable).
Just pulled the latest commit. It fails on the dicker version of HA due to the change from is not to :=
When editing yaml files and restarting Homeassistant the pyloxone entities are status "not available" and the icons in the gui are greyed out.
Restarting the host does not help. I only was able to recover by removing pyloxone and re-installing it....
I am running Hassio Docker version on an ubuntu.
BTW: What a great project!!!
When binding a custom sensor to a Loxone component which provides state longer than 255 characters, an exception is raised and state not refreshed as home assistant state might be maximum 255 characters.
It happens for example when listening to Fire and Water alarm, where the state provides list of latest events. But relates to all Loxone components returning pipe delimited list as state.
I suggest to check the length of the state returned by the Loxone component and if longer than 255 characters, then trim the state and log a warning, rather than keep it unhandled and exception being logged by HA without any state update.
Hi
First of all, thanks for the great library!
Occasionally, after running the integration for several days, I am getting a recursion error. See the log below.
It seems the reconnect and start functions are calling each other recursively. I'm not quite sure what's going on in this code and what triggers the reconnect, but on the surface it seems like self.start calls self.reconnect, and when self._state is set to "CONNECTED" in self.async_init self.start is called again, which checks that the state is not "STOPPING" and calls reconnect again. I tried adding an additional check to prevent the reconnect function being called when the state is "CONNECTED", unfortunately, this did not work (it prevent the recursion but after about 1.5 hours I'm getting an ConnectionClosed Exception within send_websocket_command).
As stated, I am not quite familiar with the connection / reconnection code, perhaps you have a better feeling what the problem could be?
Regards
Arjen
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/loxone/init.py", line 525, in reconnect
await self.start()
File "/config/custom_components/loxone/init.py", line 518, in start
res = await self.reconnect()
File "/config/custom_components/loxone/init.py", line 525, in reconnect
await self.start()
File "/config/custom_components/loxone/init.py", line 518, in start
res = await self.reconnect()
File "/config/custom_components/loxone/init.py", line 523, in reconnect
res = await self.async_init()
File "/config/custom_components/loxone/init.py", line 560, in async_init
resp = self.get_public_key()
File "/config/custom_components/loxone/init.py", line 943, in get_public_key
response = requests.get(command, auth=(self._username, self._pasword))
File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
six.raise_from(e, None)
File "", line 2, in raise_from
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 383, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/lib/python3.7/http/client.py", line 1336, in getresponse
response.begin()
File "/usr/local/lib/python3.7/http/client.py", line 330, in begin
self.headers = self.msg = parse_headers(self.fp)
File "/usr/local/lib/python3.7/http/client.py", line 224, in parse_headers
return email.parser.Parser(_class=_class).parsestr(hstring)
File "/usr/local/lib/python3.7/email/parser.py", line 68, in parsestr
return self.parse(StringIO(text), headersonly=headersonly)
File "/usr/local/lib/python3.7/email/parser.py", line 57, in parse
feedparser.feed(data)
File "/usr/local/lib/python3.7/email/feedparser.py", line 176, in feed
self._call_parse()
File "/usr/local/lib/python3.7/email/feedparser.py", line 180, in _call_parse
self._parse()
File "/usr/local/lib/python3.7/email/feedparser.py", line 295, in _parsegen
if self._cur.get_content_maintype() == 'message':
File "/usr/local/lib/python3.7/email/message.py", line 594, in get_content_maintype
ctype = self.get_content_type()
File "/usr/local/lib/python3.7/email/message.py", line 578, in get_content_type
value = self.get('content-type', missing)
File "/usr/local/lib/python3.7/email/message.py", line 471, in get
return self.policy.header_fetch_parse(k, v)
File "/usr/local/lib/python3.7/email/_policybase.py", line 316, in header_fetch_parse
return self._sanitize_header(name, value)
File "/usr/local/lib/python3.7/email/_policybase.py", line 287, in _sanitize_header
if _has_surrogates(value):
File "/usr/local/lib/python3.7/email/utils.py", line 57, in _has_surrogates
s.encode()
RecursionError: maximum recursion depth exceeded while calling a Python object
Buch of RuntimeError: Attribute hass is None is appearing in log
2020-11-23 14:17:26 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/loxone/sensor.py", line 212, in event_handler
self.schedule_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 422, in schedule_update_ha_state
assert self.hass is not None
AssertionError
2020-11-23 14:17:26 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/loxone/light.py", line 399, in event_handler
self.async_schedule_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 441, in async_schedule_update_ha_state
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 289, in async_write_ha_state
raise RuntimeError(f"Attribute hass is None for {self}")
RuntimeError: Attribute hass is None for <Entity Hlavní tlačítko: off>
When I checked my core log today, I discovered following error:
Traceback (most recent call last):
File "/config/custom_components/loxone/__init__.py", line 292, in loxone_discovered
sensors_analog, True, False)
File "/config/custom_components/loxone/__init__.py", line 288, in create_loxone_group
await hass.services.async_call("group", "set", command)
File "/usr/src/homeassistant/homeassistant/core.py", line 1206, in async_call
raise ServiceNotFound(domain, service) from None
homeassistant.exceptions.ServiceNotFound: Unable to find service group/set
I am pretty new to HA, so I am not sure, whether this error message was always in the logs since I installed PyLoxone, or whether it is new thing.
I am using Loxone bindings installed using HACS and I have it updated to latest version 0.2.1.
Apart from this error it seems to be working fine, but I am so far only reading data from Loxone, not sending any commands...
Hello!
First off, thanks for building this great integration!
I'm having some issues with the latest version where "dimmer" entities can no longer be controlled.
I used to just control the "actuator" to turn on/off individual lights attached to the lightingcontroller without a problem.
Previous version I was using was 2.8 I think then it was working fine, now running your latest version.
I saw there is a known issue related to the dimmer, not sure if this is the same rootcause?
Kind regards!
Hey, I agree documentation could be improved… I'm trying to integrate with a Touch Surface, I can see it and configure within Loxone Config, but I can't seem to get anything out of it inside Home Assistant… I only get the Loxone groups, but no devices… Maybe there's a step I'm missing, I tried to follow the code in __init__.py
, but couldn't find where the devices are discovered at all…
Originally posted by @Saviq in #26 (comment)
I've updated to the latest version on Github and noticed that my dimmer is showing that it is turned on, even when it is off. The brightness is showing as close to half.
In the LoxoneDimmer class, there are new statements handling the min/max values in the event_handler and brightness functions.
When I disable these statements, as it was before, all seems to be working normally:
@property
def brightness(self):
"""Return the brightness of the group lights."""
return to_hass_level(self._position)
async def event_handler(self, e):
request_update = False
if self._min_uuid in e.data:
self._min = e.data[self._min_uuid]
request_update = True
if self._max_uuid in e.data:
self._max = e.data[self._max_uuid]
request_update = True
if self._step_uuid in e.data:
self._step = e.data[self._step_uuid]
request_update = True
if self.states['position'] in e.data and isinstance(e.data[self.states['position']], (int, float)):
self._position = e.data[self.states['position']]
request_update = True
if request_update:
self.async_schedule_update_ha_state()
Is there a reason why the min/max values need to be mapped in code? It seems that the position values from Loxone already are being mapped to the Loxone range. My min and max values are 15 and 100, in home assistant the brightness is showing as 1-100. In the Loxone App the brightness values now correspond directly to the brightness values in HA.
Regards
Hi!
I try a loxone binding in Home Assistan on a Synology docker.
A fill the ip, port, username and password and i get this error in log:
Logger: homeassistant.config_entries
Source: custom_components/loxone/api.py:785
First occurred: 2:47:28 (1 occurrences)
Last logged: 2:47:28
Error setting up entry PyLoxone for loxone
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 248, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/loxone/init.py", line 131, in async_setup_entry
if not await miniserver.async_setup():
File "/config/custom_components/loxone/miniserver.py", line 128, in async_setup
res = await self.api.async_init()
File "/config/custom_components/loxone/api.py", line 347, in async_init
res = await self.acquire_token()
File "/config/custom_components/loxone/api.py", line 541, in acquire_token
key_and_salt.read_user_salt_responce(message)
File "/config/custom_components/loxone/api.py", line 785, in read_user_salt_responce
self.key = value['key']
TypeError: string indices must be integers
Please help me!
Thank You
Hey,
Why is it that i cannot give my InfoOnlyAnalog
sensors an InfoOnlyDigital
sensors a device_class
in the config.yaml file?
I would lik to see my sensors in homekit but without proper configuration they won't pop up in homekit, the temperature sensors are the only ones that work but I have humidity sensor and door contacts where I cannot get the feedback from to homekit.
Is there a work around for this?
Thanks in advance and keep up the good work!
sensor:
- platform: loxone
name: "Temprature bureau"
uuidAction: "13355200-01e4-17cd-ffff1ba65e9e54c4"
unit_of_measurement: "°C"
- platform: loxone
name: "Temprature slaapkamer Ceylan"
uuidAction: "13363370-0330-e7f1-ffff1ba65e9e54c4"
unit_of_measurement: "°C"
- platform: loxone
name: "Humidity slaapkamer Ceylan"
device_class: humidity
uuidAction: "13363370-0330-e7f5-ffff1ba65e9e54c4"
unit_of_measurement: "%"
- platform: loxone
name: "Door sensor contact garage"
device_class: door
uuidAction: "132c213e-01de-9686-ffff1ba65e9e54c4"
I am getting following exception with versions:
Hass: 0.114.4
PyLoxone: 2.5
I have tried other version of hass, but not having any luck. Can you help out with this?
2020-09-04 20:38:08 ERROR (MainThread) [homeassistant.setup] Error during setup of component loxone
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/h11/_state.py", line 249, in _fire_event_triggered_transitions
new_state = EVENT_TRIGGERED_TRANSITIONS[role][state][event_type]
KeyError: <class 'h11._events.ConnectionClosed'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 191, in _async_setup_component
result = await task
File "/config/custom_components/loxone/__init__.py", line 201, in async_setup
request_code = await lox_config.getJson()
File "/config/custom_components/loxone/__init__.py", line 113, in getJson
version_resp = await requests.get(url_version,
File "/usr/local/lib/python3.8/site-packages/requests_async/api.py", line 11, in get
return await request("get", url, params=params, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_async/api.py", line 6, in request
return await session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_async/sessions.py", line 79, in request
resp = await self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_async/sessions.py", line 136, in send
r = await adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests_async/adapters.py", line 48, in send
response = await self.pool.request(
File "/usr/local/lib/python3.8/site-packages/http3/interfaces.py", line 49, in request
return await self.send(request, verify=verify, cert=cert, timeout=timeout)
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/connection_pool.py", line 130, in send
raise exc
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/connection_pool.py", line 120, in send
response = await connection.send(
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/connection.py", line 59, in send
response = await self.h11_connection.send(request, timeout=timeout)
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/http11.py", line 58, in send
http_version, status_code, headers = await self._receive_response(timeout)
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/http11.py", line 130, in _receive_response
event = await self._receive_event(timeout)
File "/usr/local/lib/python3.8/site-packages/http3/dispatch/http11.py", line 161, in _receive_event
event = self.h11_state.next_event()
File "/usr/local/lib/python3.8/site-packages/h11/_connection.py", line 439, in next_event
exc._reraise_as_remote_protocol_error()
File "/usr/local/lib/python3.8/site-packages/h11/_util.py", line 72, in _reraise_as_remote_protocol_error
raise self
File "/usr/local/lib/python3.8/site-packages/h11/_connection.py", line 422, in next_event
self._process_event(self.their_role, event)
File "/usr/local/lib/python3.8/site-packages/h11/_connection.py", line 238, in _process_event
self._cstate.process_event(role, type(event), server_switch_event)
File "/usr/local/lib/python3.8/site-packages/h11/_state.py", line 238, in process_event
self._fire_event_triggered_transitions(role, event_type)
File "/usr/local/lib/python3.8/site-packages/h11/_state.py", line 251, in _fire_event_triggered_transitions
raise LocalProtocolError(
h11._util.RemoteProtocolError: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.