Trouble getting devices set up
Closed this issue · 10 comments
Hi! Being "stuck" with a legacy xComfort solution I can't swap out unless I want to tear down multiple walls, this is a great solution for me. I was able to install the integration, and it reports back success. However, for every device group I get an error:
Logger: homeassistant.components.switch
Source: custom_components/xcomfort/switch.py:14
Integration: Switch (documentation, issues)
First occurred: 17:53:10 (1 occurrences)
Last logged: 17:53:10
Error while setting up xcomfort platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/xcomfort/switch.py", line 14, in async_setup_entry
if device['type'].find("Switch") >= 0:
KeyError: 'type'
This one, as you can see, was for switches. All other categories, except buttons, fail the same way. For buttons it's the "id" key:
Logger: homeassistant.components.button
Source: custom_components/xcomfort/button.py:14
Integration: Button ([documentation](https://www.home-assistant.io/integrations/button), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+button%22))
First occurred: 17:53:10 (1 occurrences)
Last logged: 17:53:10
Error while setting up xcomfort platform for button
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/xcomfort/button.py", line 14, in async_setup_entry
async_add_entities([xcScene(coordinator, i, scene['id'], scene['name'])])
KeyError: 'id'
Thoughts?
Hey olesk75,
It looks like you have wrong zone number configured or there are no devices assigned to this zone. Tell me, did you follow this instruction to identify correct zone number?
To find zone number log into SHC via web console using this address http://ip_address_of_your_integration/system/console/config, go to Configuration Status -> Home Devices and use search function to search for 'hz_'. Number following hz_ is the zone number.
Hi!
It's possible I made things more difficult for myself, but I basically went and made a new zone in xComfort SHC in order to make sure I could add the relevant Eaton devices to that zone in HASS.
Here you can see that I've added a new zone, (7) for HASS. I then use hz_7 for the settings:
However, if I then check the HASS log, I get these entries:
Which seems rather bad, as the format indicates that the extension not only has an error, but actually breaks HASS logging indirectly 🙂
Perfect. The error is on shutter setup. If you don't have any shutters at your home go to init.py file on your HA in /config/custom_components/xcomfort folder. And put # in front of line with "cover". This will prevent the integration from installing shutters.
I wrote this integration for myself and need to improve error handling definitely.
Let me know if works now
It seems that every time I commented out one of the xComfort categories, the next one would fail.
To try to reduce the confusion a little, I commented out everything but the lights. As you can see above in my SHC config screenshot, the example device there is a light dimmer ("actuator" in xComfort speak).
Still, even with everything other that lights commented out, I get this:
await asyncio.shield(task)
File "/config/custom_components/xcomfort/light.py", line 14, in async_setup_entry
if device['type'].find("DimAct") >= 0:
KeyError: 'type'
Can you please run xcomfort.save_status_files service from HA's Developer Tools-> Services. It will save xcomfort_devices in HA /config folder which would be necessary to understand your issue.
Interestingly, nothing in devices:
devices:
[ {} ]
Log_stats:
{ "hdm:xComfort Adapter:5209689_u0": { "msgsPerDay": "51", "lastMsgTimeStamp": "14:47:11", "eventLog": "17.9" }, "hdm:xComfort Adapter:5209689": { "msgsPerDay": "2", "lastMsgTimeStamp": "03:46:56", "eventLog": "316" }, "hdm:xComfort Adapter:5486265_u0": { "msgsPerDay": "2", "lastMsgTimeStamp": "03:47:01", "eventLog": "ON/OPEN" }, "hdm:xComfort Adapter:5789963_u0": { "msgsPerDay": "2", "lastMsgTimeStamp": "03:47:01", "eventLog": "ON/OPEN" }, "hdm:xComfort Adapter:5490318_u0": { "msgsPerDay": "2", "lastMsgTimeStamp": "03:47:01", "eventLog": "ON/OPEN" }, "hdm:xComfort Adapter:5209689_u1": { "msgsPerDay": "3", "lastMsgTimeStamp": "03:16:08", "eventLog": "42.2" }, "hdm:xComfort Adapter:5209689_w": { "msgsPerDay": "51", "lastMsgTimeStamp": "14:47:11", "eventLog": "0.3" } }
Yeap, that's the issue.
I suggest to start from restarting SHC. If won't help then try building another zone and add only one light there.
Also you can try to see what will appear when you select hz_2.
Sorry, nothing I can help from the integration side. I hope this is only glitch in SHC and after few trial and error you will find the solution.
I actually think I found the problem here. My lights are dimmable spotlights. Their type is "dimmer", which is not one of the types I found in init.py. I don't suppose that's something that could be easily added?
You can see an example here:
hdm:xComfort Adapter:5184958_u0
Name: Dimmer dining (act)
Hardware Vendor: Eaton
Hardware Version: 1.0.0
Time Added: 1640527013634 (14:56:53.634 26.12.2021)
Adapter: xComfort Adapter
Type:
Status: Online
Error: N/A
Parent: Dimmer dining (act) (hdm:xComfort Adapter:5184958)
Children: N/A
Zones: Living room (hz_2), HASS (hz_1)
Device Class Objects:
Dim Actuator
Type: Dimmer
dimmingState: 0 (Stop)
isNewActuator: false
level: 0
profileCmd: -1
state: 0 (OFF)
units: %
Hei Ole!
Hva slags dimmer har du? Jeg har to installasjoner med masse dimmere som fungerer
What kind of dimmers do you have? I have two sites with dimmers that works flowless
My apologies for answering this late - the installation is in the summer house, and we Airbnb rent the place out when not there ourselves, so I didn't have a good way to test this. I've now been in the house for two weeks and had the chance to test, and after updating the SHC (basically remove a ton of devices now replaced with Zigbee), rebooting and reinstalling the integration via HACKS, it worked beautifully on the first try! 😁
All I can say now is thanks a bunch for the help - this integration is a lifesaver!