Hi. I’m new to home assistant - and like it already very much. I have a working knx installation and some philips hue and xiaomi sensors - and nearly everything works great more or less right out of the box. Thank you very much for making this possible.
The only thing I couldn’t get to work is to expose xiaomi sensor values to the knx bus. According to the “manual” one has to use “expose:” in configuration.yaml (knx: expose:). But using that I get an error in the log file saying that “expose:” isn’t a know term for the knx component. Any suggestions?
Thank you very much!
Update: This (see docs) doesn’t to work (whether I use expose:: or expose:) for me:
No. As I understand it „expose:“ should be able to expose any sensor value to the knx bus, regardless of its origin. As long as Home Assistant is able to get the sensor value (e.g. temperature, humidity, motion, …) of a device it should be able to pass it along to the knx bus. But maybe I missunderstood something …
It seems like that, so to me the odd things about that documentation is that none of it really follows typical yaml that we deal with in these configs… try this out:
knx:
expose:
- type: temperature
entity_id: sensor.owm_temperature
address: '0/0/2'
Thank you very much for your help - unfortunately it doesn’t work. Using your code, I get the following error:
starting version 3.2.4
Testing configuration at /config
ERROR:homeassistant.config:Invalid config for [knx]: [expose] is an invalid option for [knx]. Check: knx->knx->expose. (See /config/configuration.yaml, line 16). Please check the docs at https://home-assistant.io/components/knx/
ERROR:homeassistant.setup:Setup failed for knx: Invalid config.
Failed config
knx:
expose: [source /config/configuration.yaml:17]
- address: 8/0/0
entity_id: sensor.temperature_158d0001c14eb8
type: temperature
General Errors:
- Setup failed for knx: Invalid config.
Successful config (partial)
knx:
Could it be that the expose-option is only available in the newest xknx-versions, but hass uses an older version (see xknx.io)?
No, because this shows a knx sensor in hass (which, by the way, works). But I want it the other way around: a Xiaomi Temperature sensor (discovered by hass) should send its temperature to the knx bus.
Thanx again for your help. Yes, I am at the current hass release 0.64.1 or 0.64.02 (I’m not at home right now). Maybe I should check whether I’ve got the newest knx.py version. Where is this file stored? Couldn’t find it with the configurator. Or is it in a hidden drawer, only accessible by ssh?
Yes, I guess I used the proper syntax. I even copied your code and pasted it to configuration.yaml - but I still get the same error.
If you are on hass.io, i’m not sure where it is. I have hass.io and I haven’t been able to locate files. You could always copy the source code and use it as a custom component. I’m pretty sure it would overwrite whats installed.
What strikes me as odd is the fact that you are getting an error about expose when the source code explicitly calls it out. It should be working for you.
Can you post your entire config that you are using for the knx?