Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KNX sensor value not updating #8342

Closed
marcoelgordo opened this issue Jul 4, 2017 · 65 comments
Closed

KNX sensor value not updating #8342

marcoelgordo opened this issue Jul 4, 2017 · 65 comments

Comments

@marcoelgordo
Copy link

marcoelgordo commented Jul 4, 2017

Hass V0.48 with Python 3 running on Ubuntu 14.04
Apologies if I'm not posting in the right format, this is my first time :-)

Since updating to V0.48 my KNX temperature sensors are no longer updating. I seem to be able to switch KNX lights on and off though

Error message found in the log
"/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/sensor/knx.py", line 146, in update
    value = self.convert(self._data)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/sensor/knx.py", line 164, in convert_float
    return knx2_to_float(raw_value)
  File "/home/homeassistant/.homeassistant/deps/knxip/conversion.py", line 35, in knx2_to_float
    raise KNXException("Can only convert a 2 Byte object to float")
knxip.core.KNXException: Can only convert a 2 Byte object to float no error
@ghost
Copy link

ghost commented Jul 5, 2017

It might have to do with a concurrency problem. I'm not sure why this started happening now. There is some work on the underlying KNX library to make it thread-safe and I hope to include the new version in 0.49.

@Helldin
Copy link

Helldin commented Jul 18, 2017

Hass 0.49 on Debian
Something new about this? The sensor worked in 0.47

2017-07-18 08:02:03 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.entre fails Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state yield from self.hass.async_add_job(self.update) 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 "/usr/local/lib/python3.4/dist-packages/homeassistant/components/sensor/knx.py", line 146, in update value = self.convert(self._data) File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/sensor/knx.py", line 164, in convert_float return knx2_to_float(raw_value) File "/usr/local/lib/python3.4/dist-packages/knxip/conversion.py", line 35, in knx2_to_float raise KNXException("Can only convert a 2 Byte object to float") knxip.core.KNXException: Can only convert a 2 Byte object to float no error

@marcoelgordo
Copy link
Author

Hi after updating to Hass 0.49 on Ubuntu, the issue is still there.
As stated above by Helldin the temperature sensor was working on Hass v0.47
Thank you indeed, it is a great platform

@ghost
Copy link

ghost commented Jul 19, 2017

Can you try to edit knx.py and set the version of pknx to 0.5. This is the latest version and should further improve stability in multithreaded applications.

@marcoelgordo
Copy link
Author

Hi. Could you point me to the "how to page" or tell me how I could do that? I'm no developer, merely an IT enthusiast. Thank you :-)

@Helldin
Copy link

Helldin commented Jul 19, 2017

@open-homeautomation
Hi
i have update python to 3,6 and run homeassistant in dev and change knx.py to 0.5
I have some sensors that work sometimes and some that do not give any value at all.

Dimmer function for knx seems broken too.
Both me and a friend have a problem with the dimmer, If i choose 10% and I get about 50% brightness and If choose 50%, so I get about 10% brightness, 100% is 100% brightness

@Helldin
Copy link

Helldin commented Jul 19, 2017

@marcoelgordo
sudo nano /usr/local/lib/python3.6/site-packages/homeassistant/components/knx.py

Support for KNX components.

For more details about this component, please refer to the documentation at
https://home-assistant.io/components/knx/
"""
import logging

import voluptuous as vol

import homeassistant.helpers.config_validation as cv
from homeassistant.const import (
    EVENT_HOMEASSISTANT_STOP, CONF_HOST, CONF_PORT)
from homeassistant.helpers.entity import Entity

REQUIREMENTS = ['knxip==0.5']    <----- HERE-------------------------

_LOGGER = logging.getLogger(__name__)

DEFAULT_HOST = '0.0.0.0'
DEFAULT_PORT = 3671
DOMAIN = 'knx'

EVENT_KNX_FRAME_RECEIVED = 'knx_frame_received'
EVENT_KNX_FRAME_SEND = 'knx_frame_send'

KNXTUNNEL = None
CONF_LISTEN = "listen"

@marcoelgordo
Copy link
Author

Thank you Helldin
So on Python3.4, Ubuntu 14.04 and Hass v0.49 updating knx.py the knip requirement from 0.4 to 0.5 has no effect.
The temperature sensor values do not update.
Thank you again for Hass, great platform

@ghost
Copy link

ghost commented Jul 19, 2017

Did you restart HASS after editing the file?

@marcoelgordo
Copy link
Author

yes

@ghost
Copy link

ghost commented Jul 19, 2017

What kind of sensor is this? What other KNX components have you configured?

@Helldin
Copy link

Helldin commented Jul 19, 2017

# Temp
   - platform: knx
     type: temperature
     name: entre
     address: 3/1/5   <-----not working
   - platform: knx
     type: temperature
     name: vrom
     address: 3/1/6   <-----not working
   - platform: knx
     type: temperature
     name: tute
     address: 3/5/0   <----- working
   - platform: knx
     type: temperature
     name: badrum
     address: 3/1/7   <-----not working
   - platform: knx
     type: temperature
     name: hall
     address: 3/1/0   <-----not working
   - platform: knx
     type: temperature
     name: tank_topp
     address: 3/1/15   <----- working
   - platform: knx
     type: temperature
     name: tank_mitt
     address: 3/1/16   <----- working
   - platform: knx
     type: temperature
     name: tank_bott
     address: 3/1/17   <----- working
   - platform: knx
     type: temperature
     name: tank_sol
     address: 3/1/9   <----- working
   - platform: knx
     type: temperature
     name: tofloor
     address: 3/1/13   <----- working
   - platform: knx
     type: temperature
     name: fromfloor
     address: 3/1/14   <----- working

#Ljus
   - platform: knx
     name: badrum_lux
     type: illuminance
     address: 1/5/2   <----- working




#floor heating
   - platform: knx
     name: percent_golv_max
     type: percentage
     address: 3/3/8   <----- working
   - platform: knx
     name: percent_golv_vrom
     type: percentage
     address: 3/3/6   <----- working
   - platform: knx
     name: percent_golv_hall
     type: percentage
     address: 3/3/5   <----- working
   - platform: knx
     name: percent_golv_badrum
     type: percentage
     address: 3/3/7   <----- working
   - platform: knx
     name: percent_golv_sovrum
     type: percentage
     address: 3/3/4   <----- working

switch

#fontän----------------
  - platform: knx
    name: fontan
    address: 1/1/18
#    state_address: 1/4/18
#golvvärmepump------------------
  - platform: knx
    name: pump_golv
    address: 3/4/8
#    state_address: 3/4/10
#Ute-------------------------
  - platform: knx
    name: Entre_Ute
    address: 1/0/11
#    state_address: 1/0/11
#Hall----------------------------
  - platform: knx
    address: 1/1/0
#    state_address: 1/4/0
    name: Hall

Light

#Hall spottar DIM---------
  - platform: knx
    address: 1/1/4
#    state_address: 1/4/6
    brightness_address: 1/3/13
    brightness_state_address: 1/2/3
    name: Hall_Spottar
#Badrum  DIM-------------
  - platform: knx
    address: 1/1/3
#    state_address: 1/4/3
    brightness_address: 1/3/2
    brightness_state_address: 1/2/2
    name: badrum_spottar

#Altantak DIM--------
  - platform: knx
    name: altantak
    address: 1/1/5
    brightness_address: 1/3/3
    brightness_state_address: 1/2/4
#    state_address: 1/4/7

@ghost
Copy link

ghost commented Jul 19, 2017

What kind of KNX interface are you using?

@Helldin
Copy link

Helldin commented Jul 19, 2017

Abb ipr/s 2.1 gatway
knx function in hass uses tunnel instead of Router connection, I can not check the diagnostics in ETS

@ghost
Copy link

ghost commented Jul 19, 2017

You should be able to use the group address monitor in ETS. DO you see HASS accessing this address?

@marcoelgordo
Copy link
Author

I have GIRA 5133 for the lights and temp connected to an Actuator and connected iKNIX (v2) to operate. My server is running EIBD Daemon.
As said above lights can be actionned by Hass and Hass used to read the values in V0.47.
The original message (above) seem to state the issue is with converting the values.

Thank you again
Regards,

M

@Helldin
Copy link

Helldin commented Jul 19, 2017

IPR/S 2.1 only have 1 tunnel so i cant connect to group monitor in ets then hass i running

@ghost
Copy link

ghost commented Jul 19, 2017

@Helldin This happens with all your sensors?

@Helldin
Copy link

Helldin commented Jul 19, 2017

No in last post i have point out witch sensors work or not working

@ghost
Copy link

ghost commented Jul 19, 2017

@Helldin Sorry, this question was for @marcoelgordo
It seems there are two different problems here

@marcoelgordo Does this problem happen with all your sensors?

@marcoelgordo
Copy link
Author

I have only have 2 temperature sensors and it happens to both sensors. As for Helldin I cannot connect to ETS when HAL is working.
The addresses (format 1/1/1) are correct

@marcoelgordo
Copy link
Author

Hi, after further tests, when I action a switch manually, the status of the switch is not shown in Hass anymore. I can action the switch via Hass however without an issue.
I'm using the old EIB daemon though https://www.auto.tuwien.ac.at/~mkoegler/eib/ could that be the source of my issues?

@ghost
Copy link

ghost commented Jul 20, 2017

Is is a switch or a light? Lights have been changed quite a lot in the latest releases.

@marcoelgordo
Copy link
Author

Yes lights.

@ghost
Copy link

ghost commented Jul 20, 2017

Please replace the sensor/knx.py by this version:
https://github.com/open-homeautomation/home-assistant/blob/sensorfix/homeassistant/components/sensor/knx.py

This won't fix the problem, but provide better logging

@Helldin
Copy link

Helldin commented Jul 20, 2017

updated sensor/knx.py

2017-07-20 15:32:25 ERROR (SyncWorker_4) [homeassistant.components.sensor.knx] Can't convert b'\x00' to float (Can only convert a 2 Byte object to float no error)
2017-07-20 15:32:25 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.entre fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
    yield from self.hass.async_add_job(self.update)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 331, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
    future.result()
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 244, in result
    raise self._exception
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/knx.py", line 147, in update
    if self._minimum_value <= value <= self._maximum_value:
TypeError: '<=' not supported between instances of 'float' and 'NoneType'

@ghost
Copy link

ghost commented Jul 20, 2017

This looks like your sensor returns one byte, but you configured a float sensor. Are you sure the configured group address is correct? Please check with ETS that the read on this address really returns a 2byte float.

@Helldin
Copy link

Helldin commented Jul 20, 2017

ets return this

#	Tid	Service	Flaggor 	Prio	Källadress	Källnamn	Måladress	Målnamn	Rout	Typ	DPT	Info
1	2017-07-20 16:15:31,956	Starta										Inspelning startades, Värd=DESKTOP-R4BUK65, Anslutning=ABB IP-Router IPR/S, Mode=LinkLayer
2	2017-07-20 16:15:31,952	Anslutningshändelse										Anslutning upprättad
3	2017-07-20 16:15:32,652	från buss		Low	1.1.8	Room controller display compact module 4-gang	3/1/7	Badrum värme aktuell temperatur	6	GroupValueWrite	  9.001 temperature (°C)	0C B1 | 24,02 °C
4	2017-07-20 16:15:38,329	från buss		Low	1.1.16	6320/38-..-500 triton 3/6fach MF/IR/RTR	3/5/0	TEMP UTE	6	GroupValueWrite	  9.001 temperature (°C)	0E A9 | 34,1 °C
5	2017-07-20 16:15:50,995	från buss		Low	1.1.12	Heizungsaktor 6fach Triac, 24V	3/3/8	Styrstorhet MAX	6	GroupValueWrite	  5.001 percentage (0..100%)	$00 | 0 %
6	2017-07-20 16:16:00,411	från buss		Low	1.1.16	6320/38-..-500 triton 3/6fach MF/IR/RTR	3/5/0	TEMP UTE	6	GroupValueWrite	  9.001 temperature (°C)	0E A9 | 34,1 °C
7	2017-07-20 16:16:05,955	från buss		Low	1.1.11	Temperature controller / sensor 6-fold AP	3/1/15	Tank Topp	6	GroupValueWrite	  9.001 temperature (°C)	17 CD | 79,88 °C
8	2017-07-20 16:16:05,974	från buss		Low	1.1.2	LM/S1.1 Logic Module,MDRC	1/4/5	Dusch status	6	GroupValueWrite	  1.001 switch	$01 | Till
9	2017-07-20 16:16:06,955	från buss		Low	1.1.11	Temperature controller / sensor 6-fold AP	3/1/13	Golvvärme Till	6	GroupValueWrite	  9.001 temperature (°C)	0D 91 | 28,5 °C
10	2017-07-20 16:16:07,956	från buss		Low	1.1.11	Temperature controller / sensor 6-fold AP	3/1/14	Golvvärme Från	6	GroupValueWrite	  9.001 temperature (°C)	0D 5F | 27,5 °C
11	2017-07-20 16:16:08,955	från buss		Low	1.1.11	Temperature controller / sensor 6-fold AP	3/1/17	Tank Botten	6	GroupValueWrite	  9.001 temperature (°C)	17 9B | 77,88 °C
12	2017-07-20 16:16:09,955	från buss		Low	1.1.11	Temperature controller / sensor 6-fold AP	3/1/9	Solvärme	6	GroupValueWrite	  9.001 temperature (°C)	17 C1 | 79,4 °C
13	2017-07-20 16:16:10,954	från buss		Low	1.1.11	Temperature controller / sensor 6-fold AP	3/1/16	Tank Mitten	6	GroupValueWrite	  9.001 temperature (°C)	17 C6 | 79,6 °C
14	2017-07-20 16:16:17,326	från buss		Low	1.1.10	Room controller display compact module 2-gang	3/1/5	Entre värme aktuell temperatur	6	GroupValueWrite	  9.001 temperature (°C)	0D 04 | 25,68 °C
15	2017-07-20 16:16:17,501	från buss		Low	1.1.10	Room controller display compact module 2-gang	3/3/5	Entre Våning styrstorhet	6	GroupValueWrite	  5.001 percentage (0..100%)	$00 | 0 %
16	2017-07-20 16:16:21,571	från buss		Low	1.1.13	Room controller display compact module 2-gang	3/1/0	Hall värme aktuell temperatur	6	GroupValueWrite	  9.001 temperature (°C)	0D 15 | 26,02 °C
17	2017-07-20 16:16:21,738	från buss		Low	1.1.13	Room controller display compact module 2-gang	3/3/4	JC Våning styrstorhet	6	GroupValueWrite	  5.001 percentage (0..100%)	$00 | 0 %
18	2017-07-20 16:16:32,553	från buss		Low	1.1.16	6320/38-..-500 triton 3/6fach MF/IR/RTR	3/5/0	TEMP UTE	6	GroupValueWrite	  9.001 temperature (°C)	0E AE | 34,2 °C
19	2017-07-20 16:16:50,950	från buss		Low	1.1.2	LM/S1.1 Logic Module,MDRC	3/4/8	Pump Till/Från	6	GroupValueWrite	  1.001 switch	$00 | Från
20	2017-07-20 16:17:17,325	från buss		Low	1.1.10	Room controller display compact module 2-gang	3/1/5	Entre värme aktuell temperatur	6	GroupValueWrite	  9.001 temperature (°C)	0D 05 | 25,7 °C
21	2017-07-20 16:17:21,564	från buss		Low	1.1.13	Room controller display compact module 2-gang	3/1/0	Hall värme aktuell temperatur	6	GroupValueWrite	  9.001 temperature (°C)	0D 15 | 26,02 °C
22	2017-07-20 16:17:33,052	från buss		Low	1.1.8	Room controller display compact module 4-gang	3/3/7	Badrum Våning styrstorhet	6	GroupValueWrite	  5.001 percentage (0..100%)	$00 | 0 %
23	2017-07-20 16:17:39,007	från buss		Low	1.1.16	6320/38-..-500 triton 3/6fach MF/IR/RTR	3/5/0	TEMP UTE	6	GroupValueWrite	  9.001 temperature (°C)	0E B3 | 34,3 °C
24	2017-07-20 16:17:58,003	från buss		Low	1.1.15	Room controller display compact module 2-gang	3/3/6	Vardagsrum Våning styrstorhet	6	GroupValueWrite	  5.001 percentage (0..100%)	$00 | 0 %
25	2017-07-20 16:18:01,163	från buss		Low	1.1.16	6320/38-..-500 triton 3/6fach MF/IR/RTR	3/5/0	TEMP UTE	6	GroupValueWrite	  9.001 temperature (°C)	0E B3 | 34,3 °C
26	2017-07-20 16:18:05,943	från buss		Low	1.1.11	Temperature controller / sensor 6-fold AP	3/1/15	Tank Topp	6	GroupValueWrite	  9.001 temperature (°C)	17 CD | 79,88 °C
27	2017-07-20 16:18:05,962	från buss		Low	1.1.2	LM/S1.1 Logic Module,MDRC	1/4/5	Dusch status	6	GroupValueWrite	  1.001 switch	$01 | Till
28	2017-07-20 16:18:06,944	från buss		Low	1.1.11	Temperature controller / sensor 6-fold AP	3/1/13	Golvvärme Till	6	GroupValueWrite	  9.001 temperature (°C)	0D 8C | 28,4 °C
29	2017-07-20 16:18:07,943	från buss		Low	1.1.11	Temperature controller / sensor 6-fold AP	3/1/14	Golvvärme Från	6	GroupValueWrite	  9.001 temperature (°C)	0D 5F | 27,5 °C
30	2017-07-20 16:18:08,941	från buss		Low	1.1.11	Temperature controller / sensor 6-fold AP	3/1/17	Tank Botten	6	GroupValueWrite	  9.001 temperature (°C)	17 A0 | 78,08 °C
31	2017-07-20 16:18:09,943	från buss		Low	1.1.11	Temperature controller / sensor 6-fold AP	3/1/9	Solvärme	6	GroupValueWrite	  9.001 temperature (°C)	1C 5E | 89,44 °C
32	2017-07-20 16:18:10,940	från buss		Low	1.1.11	Temperature controller / sensor 6-fold AP	3/1/16	Tank Mitten	6	GroupValueWrite	  9.001 temperature (°C)	17 C6 | 79,6 °C
33	2017-07-20 16:18:17,321	från buss		Low	1.1.10	Room controller display compact module 2-gang	3/1/5	Entre värme aktuell temperatur	6	GroupValueWrite	  9.001 temperature (°C)	0D 07 | 25,74 °C
34	2017-07-20 16:18:21,561	från buss		Low	1.1.13	Room controller display compact module 2-gang	3/1/0	Hall värme aktuell temperatur	6	GroupValueWrite	  9.001 temperature (°C)	0D 15 | 26,02 °C
35	2017-07-20 16:18:32,620	från buss		Low	1.1.8	Room controller display compact module 4-gang	3/1/7	Badrum värme aktuell temperatur	6	GroupValueWrite	  9.001 temperature (°C)	0C B1 | 24,02 °C
36	2017-07-20 16:18:33,350	från buss		Low	1.1.16	6320/38-..-500 triton 3/6fach MF/IR/RTR	3/5/0	TEMP UTE	6	GroupValueWrite	  9.001 temperature (°C)	0E B8 | 34,4 °C
37	2017-07-20 16:18:48,537	Stoppa										Inspelning stoppades

@marcoelgordo
Copy link
Author

My EIB module gives the following.
groupsocketlisten ip:localhost
Write from 1.1.7 to 1/1/0: 0C 11
Read from 0.0.0 to 1/1/0
Read from 0.0.0 to 1/0/0
Write from 1.1.3 to 1/0/0: 0C F6
Read from 0.0.0 to 1/1/0
Read from 0.0.0 to 1/0/0
Write from 1.1.7 to 1/1/0: 0C 12
Read from 0.0.0 to 1/1/0
Read from 0.0.0 to 1/0/0
Write from 1.1.3 to 1/0/0: 0C F6
Read from 0.0.0 to 1/1/0
Read from 0.0.0 to 1/0/0
Write from 1.1.7 to 1/1/0: 0C 12
Read from 0.0.0 to 1/1/0
Read from 0.0.0 to 1/0/0
Read from 0.0.0 to 1/1/0
Read from 0.0.0 to 1/0/0
Write from 1.1.3 to 1/0/0: 0C F5

sensor.livingroom address 1/0/0
sensor.bedroom address 1/1/0

In Hass I have no error message after changing knx.py it just says
2017-07-20 14:22:20 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state group.downstairs=unknown; order=4, assumed_state=False, friendly_name=Downstairs, entity_id=('sensor.livingroom', 'light.dining_room_light', 'light.kitchen_light', 'light.kitchen_neon', 'light.living_room_light', 'light.master_bedroom_light', 'light.pendant_light', 'light.playroom_light', 'light.study_light', 'switch.tv_light') @ 2017-07-20T14:22:20.057845+01:00>, entity_id=group.downstairs>
2017-07-20 14:22:20 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state group.upstairs=unknown; order=5, assumed_state=False, friendly_name=Upstairs, entity_id=('sensor.bedroom', 'light.bathroom_light', 'light.bedroom_leds', 'light.kid_bedroom_light') @ 2017-07-20T14:22:20.058790+01:00>, entity_id=group.upstairs>

@marcoelgordo
Copy link
Author

Hi,

My Hass still has no success on reading the status of the bus (temp and Lights) and this despite the fact that I'm able to get status with the KNX controller App on Android (please see pic) https://ibb.co/g3Q8UF

Hass however does not seem to be able to read the values of the bus.

As I said above, it used to work in V0.48 and below

I'm currently running V0.52.1

Thank you in advance,
Regards,

Marc

@TinusK
Copy link

TinusK commented Sep 3, 2017

I will. Currently not at home but will try asap (tomorrow at the latest).

@marcoelgordo
Copy link
Author

Hi,
I tried method 2. I had a temp reading on one of my sensors but then nothing
Here is the log
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 236, in _step
result = coro.send(value)
File "/srv/homeassistant/lib/python3.4/site-packages/xknx/core/telegram_queue.py", line 69, in run
self.xknx.telegrams.task_done()
AttributeError: 'Queue' object has no attribute 'task_done'
2017-09-03 14:13:57 WARNING (MainThread) [xknx.log] Could not read value of <Sensor name="Bedroom" group_address="

" state="None" resolve_state="None" />
2017-09-03 14:13:58 WARNING (MainThread) [xknx.log] Could not read value of <Sensor name="Livingroom" group_address="" state="None" resolve_state="None" />
2017-09-03 14:13:59 WARNING (MainThread) [xknx.log] Could not read value of <Light name="Study Light" group_address_switch="" group_address_switch_state="None" state="False" />

@Julius2342
Copy link
Contributor

May you paste the configuration for Bedroom?

@marcoelgordo
Copy link
Author

Hi full config

xknx:
tunneling:
host: '192.168.1.45'
port: 3671
local_ip: '192.168.1.131'

light:

  • platform: xknx
    name: Living Room Light
    address: '0/1/2'

  • platform: xknx
    name: Kitchen Light
    address: '0/1/4'

  • platform: xknx
    name: Dining Room Light
    address: '0/1/0'

  • platform: xknx
    name: Pendant Light
    address: '0/1/1'

  • platform: xknx
    name: Playroom Light
    address: '0/1/5'

  • platform: xknx
    name: BedRoom Leds
    address: '0/0/4'

  • platform: xknx
    name: Master BedRoom Light
    address: '0/0/1'

  • platform: xknx
    name: BathRoom Light
    address: '0/0/3'

  • platform: xknx
    name: Study Light
    address: '0/1/3'

  • platform: xknx
    name: Kid BedRoom Light
    address: '0/0/2'

  • platform: xknx
    name: Kitchen Neon
    address: '0/1/6'

  • platform: xknx
    type: temperature
    address: '1/1/0'
    name: Bedroom
    sensor:

    • platform: xknx
      type: temperature
      address: '1/0/0'
      name: Livingroom

    • platform: rfxtrx
      automatic_add: True

@Julius2342
Copy link
Contributor

This somehow looks wrong, may you reformat to:

sensor:
  - platform: xknx
    name: Bedroom
    address: '1/1/0'
    type: 'temperature'

  - platform: xknx
    name: Livingroom
    address: '1/0/0'
    type: 'temperature'

@TinusK
Copy link

TinusK commented Sep 3, 2017

Julius,

I redid option 1:

pi@hassbian:~ $ sudo git clone https://github.com/XKNX/xknx.git
Cloning into 'xknx'...
remote: Counting objects: 4206, done.
remote: Compressing objects: 100% (126/126), done.
remote: Total 4206 (delta 113), reused 136 (delta 58), pack-reused 4001
Receiving objects: 100% (4206/4206), 701.57 KiB | 721.00 KiB/s, done.
Resolving deltas: 100% (3106/3106), done.
Checking connectivity... done.
pi@hassbian:~ $ sudo make install -C ~/xknx/home-assistant-plugin
make: Entering directory '/home/pi/xknx/home-assistant-plugin'
mkdir -p ~/.homeassistant
ln -s `pwd`/custom_components ~/.homeassistant
make: Leaving directory '/home/pi/xknx/home-assistant-plugin'

After I rebooted, I get the following errors in HA:

2017-09-03 23:40:31 ERROR (MainThread) [homeassistant.config] Invalid config for [xknx]: [host] is an invalid option for [xknx]. Check: xknx->knx->host. (See /home/homeassistant/.homeassistant/configuration.yaml, line 253). Please check the docs at https://home-assistant.io/components/xknx/
2017-09-03 23:40:31 ERROR (MainThread) [homeassistant.setup] Setup failed for xknx: Invalid config.
2017-09-03 23:40:32 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of light.xknx. Setup failed for dependencies: xknx
2017-09-03 23:40:32 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform light.xknx: Could not setup all dependencies.

In configuration.yaml I've got:

knx:
  host: 192.168.1.22
  port: 3671

xknx:
  routing:
    local_ip: '192.168.1.22'

light:
  - platform: xknx
    name: b_hallway_ceiling
    address: '1/0/10'
    brightness_address: '1/2/10'

Any Ideas?

@Julius2342
Copy link
Contributor

@TinusK : Could you try to comment out the knx section in your configuration?

@TinusK
Copy link

TinusK commented Sep 4, 2017

@julius:

Now I got this:

2017-09-04 06:31:01 ERROR (MainThread) [homeassistant.setup] Error during setup of component xknx
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/setup.py", line 191, in _async_setup_component
    result = yield from component.async_setup(hass, processed_config)
  File "/home/homeassistant/.homeassistant/custom_components/xknx.py", line 77, in async_setup
    hass.data[DATA_XKNX] = KNXModule(hass, config)
  File "/home/homeassistant/.homeassistant/custom_components/xknx.py", line 122, in __init__
    self.init_xknx()
  File "/home/homeassistant/.homeassistant/custom_components/xknx.py", line 129, in init_xknx
    config=self.config_file(),
  File "/home/homeassistant/.homeassistant/custom_components/xknx.py", line 149, in config_file
    config_file = self.config[DOMAIN].get(CONF_XKNX_CONFIG)
KeyError: 'knx'
2017-09-04 06:31:01 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of light.xknx. Setup failed for dependencies: xknx
2017-09-04 06:31:01 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform light.xknx: Could not setup all dependencies.

@TinusK
Copy link

TinusK commented Sep 4, 2017

@Julius2342:

I see 'python3.4' in the error log.... I tried:

$ sudo apt-get update
$ sudo apt-get -y upgrade

but after that it still gave me 'python3.4' in the error log. XKNX needs at least python 3.5 right? How to install python 3.5?

@Julius2342
Copy link
Contributor

regarding python3.4, what operating system do you use? (Rasbian? or plain ubuntu?)

Regarding that error: If you open /home/homeassistant/.homeassistant/custom_components/xknx.py. To what is DOMAIN set to? (Correct would be "xknx". This was fixed about 2 weeks ago, probably your module is not up to date ...).

@TinusK
Copy link

TinusK commented Sep 4, 2017

@Julius2342:

Yes, you where right... sorry... The domain was set to "knx". I copied the new "custom_components" and get:

2017-09-04 07:05:21 ERROR (MainThread) [homeassistant.setup] Error during setup of component xknx
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/setup.py", line 191, in _async_setup_component
    result = yield from component.async_setup(hass, processed_config)
  File "/home/homeassistant/.homeassistant/custom_components/xknx.py", line 78, in async_setup
    yield from hass.data[DATA_XKNX].start()
  File "/home/homeassistant/.homeassistant/custom_components/xknx.py", line 138, in start
    connection_config=connection_config)
  File "/srv/homeassistant/lib/python3.4/site-packages/xknx/xknx.py", line 66, in start
    yield from self.knxip_interface.start()
  File "/srv/homeassistant/lib/python3.4/site-packages/xknx/io/knxip_interface.py", line 71, in start
    self.connection_config.local_ip)
  File "/srv/homeassistant/lib/python3.4/site-packages/xknx/io/knxip_interface.py", line 116, in start_routing
    yield from self.interface.start()
  File "/srv/homeassistant/lib/python3.4/site-packages/xknx/io/routing.py", line 69, in start
    yield from self.udpclient.connect()
  File "/srv/homeassistant/lib/python3.4/site-packages/xknx/io/udp_client.py", line 158, in connect
    sock = UDPClient.create_multicast_sock(self.local_addr[0], self.remote_addr, self.bind_to_multicast_addr)
  File "/srv/homeassistant/lib/python3.4/site-packages/xknx/io/udp_client.py", line 124, in create_multicast_sock
    socket.inet_aton(own_ip))
OSError: [Errno 99] Cannot assign requested address
2017-09-04 07:05:22 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of light.xknx. Setup failed for dependencies: xknx
2017-09-04 07:05:22 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform light.xknx: Could not setup all dependencies.

I use hassbian:

pi@hassbian:~ $ uname -a
Linux hassbian 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

got it from:
https://home-assistant.io/docs/installation/hassbian/installation/

@Julius2342
Copy link
Contributor

yes, this error is exactly related with python3.4.

hmm, do not know how to install python3.5 on hassbian. What you could try is to use explicit tunneling functionality, if your KNX/IP device supports this:

knx:
  tunneling:
    host: '192.168.2.23'  <-- ip of your KNX/IP device
    port: 3671
    local_ip: '192.168.2.109'  <-- local ip of your hassbian

@marcoelgordo
Copy link
Author

https://community.home-assistant.io/t/python-3-6-upgrade-of-a-virtualenv/21722.

I'm battling to upgrade my virtual environment on to 3.6 as well

@TinusK
Copy link

TinusK commented Sep 4, 2017

@Julius2342:
I tried explicit tunneling and got this:

2017-09-04 07:38:58 ERROR (MainThread) [homeassistant.components.notify] Failed to initialize notification service xknx
2017-09-04 07:39:00 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 235, in _step
    result = coro.send(value)
  File "/srv/homeassistant/lib/python3.4/site-packages/xknx/core/telegram_queue.py", line 69, in run
    self.xknx.telegrams.task_done()
AttributeError: 'Queue' object has no attribute 'task_done'
2017-09-04 07:39:09 WARNING (MainThread) [xknx.log] Could not read value of <Light name="b_hallway_ceiling" group_address_switch="<Address str="1/0/10" />" group_address_switch_state="None" group_address_brightness="<Address str="1/2/10" />" group_address_brightness_state="None" state="False" brightness="0" /> <Address str="1/0/10" />
2017-09-04 07:39:10 WARNING (MainThread) [xknx.log] Could not read value of <Light name="b_hallway_ceiling" group_address_switch="<Address str="1/0/10" />" group_address_switch_state="None" group_address_brightness="<Address str="1/2/10" />" group_address_brightness_state="None" state="False" brightness="0" /> <Address str="1/2/10" />

Maybe I'll try to upgrade to python3.6 later on the day...

@Julius2342
Copy link
Contributor

Julius2342 commented Sep 4, 2017

rassbian will support python3.5 with this pull request: home-assistant/pi-gen#26

Btw, did you try: apt-get dist-upgrade ?

@TinusK
Copy link

TinusK commented Sep 4, 2017

@Julius2342 @marcoelgordo
I've got hassbian v1.23 upgraded to python 3.6.0.
Getting closer by the minute (ehhh... hour(s)) :)

Now I get the following error:

2017-09-04 09:35:58 ERROR (MainThread) [homeassistant.setup] Error during setup of component xknx
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py", line 191, in _async_setup_component
    result = yield from component.async_setup(hass, processed_config)
  File "/home/homeassistant/.homeassistant/custom_components/xknx.py", line 78, in async_setup
    yield from hass.data[DATA_XKNX].start()
  File "/home/homeassistant/.homeassistant/custom_components/xknx.py", line 138, in start
    connection_config=connection_config)
  File "/home/homeassistant/.homeassistant/deps/lib/python3.6/site-packages/xknx/xknx.py", line 66, in start
    yield from self.knxip_interface.start()
  File "/home/homeassistant/.homeassistant/deps/lib/python3.6/site-packages/xknx/io/knxip_interface.py", line 71, in start
    self.connection_config.local_ip)
  File "/home/homeassistant/.homeassistant/deps/lib/python3.6/site-packages/xknx/io/knxip_interface.py", line 116, in start_routing
    yield from self.interface.start()
  File "/home/homeassistant/.homeassistant/deps/lib/python3.6/site-packages/xknx/io/routing.py", line 69, in start
    yield from self.udpclient.connect()
  File "/home/homeassistant/.homeassistant/deps/lib/python3.6/site-packages/xknx/io/udp_client.py", line 158, in connect
    sock = UDPClient.create_multicast_sock(self.local_addr[0], self.remote_addr, self.bind_to_multicast_addr)
  File "/home/homeassistant/.homeassistant/deps/lib/python3.6/site-packages/xknx/io/udp_client.py", line 124, in create_multicast_sock
    socket.inet_aton(own_ip))
OSError: [Errno 99] Cannot assign requested address
2017-09-04 09:35:58 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of light.xknx. Setup failed for dependencies: xknx
2017-09-04 09:35:58 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform light.xknx: Could not setup all dependencies.

@Julius2342
Copy link
Contributor

are you sure own ip is set correctly?

@TinusK
Copy link

TinusK commented Sep 4, 2017

@marcoelgordo
Updating python was not that difficult in the end.
Here's what I did:

Login to your hassbian.

sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar xzvf Python-3.6.0.tgz
cd Python-3.6.0/
./configure
make
sudo make install
sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
cd /home/homeassistant
pip3 freeze —local > requirements.txt
deactivate
exit
sudo rm -rf /srv/homeassistant
sudo mkdir /srv/homeassistant
sudo chown homeassistant:homeassistant /srv/homeassistant
sudo su -s /bin/bash homeassistant
python3.6 -m venv /srv/homeassistant
source /srv/homeassistant/bin/activate
pip3 install --upgrade homeassistant
pip3 install -r /home/homeassistant/requirements.txt
exit

sudo -u homeassistant -H /srv/homeassistant/bin/hass

See also:
https://community.home-assistant.io/t/python-3-6-upgrade-of-a-virtualenv/21722
https://home-assistant.io/docs/installation/virtualenv/

@TinusK
Copy link

TinusK commented Sep 4, 2017

@Julius2342
The KNX/IP device is located at 192.168.1.22 (its an eibPort3). Hassbian is at 192.168.1.21. How should the config be?

@Julius2342
Copy link
Contributor

knx:
  tunneling:
    host: '192.168.1.22'
    port: 3671
    local_ip: '192.168.1.21'

With python3.6 you could now also try auto detection again by commenting out the tunneling block.

@TinusK
Copy link

TinusK commented Sep 4, 2017

@Julius2342:

... you know what... it works! Very nice!
I tried the setup you mentioned and it worked. A single error remains:
2017-09-04 10:06:40 ERROR (MainThread) [homeassistant.components.notify] Failed to initialize notification service xknx
Feedback (updating of the state in Hass) is almost instantaneous! I will now try to reconfig my Hass for all my KNX devices (lights, switches, shutters (covers), Climate, etc.).

Do you have something specific to test?

BTW; Commenting the tunneling part resulted in an error Can't connect to KNX interface: No Gateways found

@Julius2342
Copy link
Contributor

Great!

regarding notification: you can ignore this warning, this is fixed within my PR.

Ideally you could test if all works as expected, especially if the update mechanism works.

@TinusK
Copy link

TinusK commented Sep 4, 2017

Thanks for the support getting this up and running and I will definitely report back you!

@Julius2342
Copy link
Contributor

Regarding the gateway scanner, do you see with tcpdump if the interface responds to the search requests? For further investigation you could use: https://github.com/XKNX/xknx/blob/master/examples/example_gatewayscanner.py

@TinusK
Copy link

TinusK commented Sep 4, 2017

I will try to get some info on that the next couple of days.

@marcoelgordo
Copy link
Author

Hi,

I'm running Hass on a Virtualenv on Ubuntu 14.04 and I cannot manage to upgrade Python from 3.4 to 3.6
Any hint as to how to do that clean? The forums I have seen talk about manual move to a new Virtualenv

Thank you
Regards,

M

@TinusK
Copy link

TinusK commented Sep 4, 2017

@marcoelgordo

Sorry Marco, I scraped the info together from the two sites I mentioned and got it to work with a bit of trial and error... I have no experience with ubuntu and python so I'm unable to help you.

What I finally did is removing the environment, created a new one. Installed hass again and installed the dependencies again. After ofcourse I installed python 3.6

@marcoelgordo
Copy link
Author

Guys,

With the latest version of HASS v0.53 all works like a charm!!
I'm so pleased thanks a bunch

For upgrading to 3.6 in a Python Virtual env, all I did was to install Python3.6 then run the following command for the upgrade of Hass
pip3.6 install --upgrade homeassistant

It forces Hass to use python3.6 instead of 3.4

Thank you again for all that good work Julius2342 and the whole Hass team indeed

Cheers,

M

@home-assistant home-assistant locked and limited conversation to collaborators Dec 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants