Somfy rts cover

I’m trying to make a Somfy RTS cover component.
Although i’m not touching the light and/or switch component it’s giving me errors on these 2.
Any direction on wat i’m doing wrong or missing?

2017-07-21 15:26:07 ERROR (MainThread) [homeassistant.loader] Error loading 
 homeassistant.components.switch.rflink. Make sure all dependencies are installed
Traceback (most recent call last):

File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/loader.py", line 141, in get_component
module = importlib.import_module(path)
File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/rflink.py", line 10, in <module>
from homeassistant.components.rflink import (
ImportError: cannot import name 'CONF_ALIASES'
2017-07-21 15:26:07 ERROR (MainThread) [homeassistant.loader] Unable to find component switch.rflink
2017-07-21 15:26:08 ERROR (MainThread) [homeassistant.loader] Error loading homeassistant.components.light.rflink. 
Make sure all dependencies are installed
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/loader.py", line 141, in get_component
module = importlib.import_module(path)
File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/light/rflink.py", line 12, in <module>
from homeassistant.components.rflink import (
ImportError: cannot import name 'CONF_ALIASES'
2017-07-21 15:26:08 ERROR (MainThread) [homeassistant.loader] Unable to find component light.rflink

Without any source code it will be difficult to get any help.

sorry for getting back so late on this topic.

I fixed al the errors and it seems to send the commands. though it’s not working yet :frowning:

2017-07-29 10:24:46 DEBUG (MainThread) [homeassistant.components.rflink] Sending command: UP to Rflink device: RTS_02FFFF_0
2017-07-29 10:24:46 DEBUG (MainThread) [rflink.protocol] sending command: {'switch': '0', 'command': 'UP', 'protocol': 'RTS', 'id': '02FFFF'}
2017-07-29 10:24:46 DEBUG (MainThread) [rflink.protocol] writing data: '10;RTS;02FFFF;0;UP;\r\n'
2017-07-29 10:24:46 DEBUG (MainThread) [rflink.protocol] waiting for acknowledgement
2017-07-29 10:24:49 DEBUG (MainThread) [rflink.protocol] received data: 20;03;OK;
2017-07-29 10:24:49 DEBUG (MainThread) [rflink.protocol] got packet: 20;03;OK;
2017-07-29 10:24:49 DEBUG (MainThread) [rflink.protocol] decoded packet: {'protocol': 'unknown', 'ok': True, 'node': 'gateway'}
2017-07-29 10:24:49 DEBUG (MainThread) [rflink.protocol] command response: {'protocol': 'unknown', 'ok': True, 'node': 'gateway'}
2017-07-29 10:24:49 DEBUG (MainThread) [rflink.protocol] packet acknowledged 

not sure what’s going wrong.

rflink.py & cover/rflink.py

[https://github.com/passie/home-assistant/blob/dev/homeassistant/components/rflink.py]
[https://github.com/passie/home-assistant/blob/dev/homeassistant/components/cover/rflink.py]

yesterday I received my dipole antenne with greater reach.
the component is working so i’ll do some clean up and figure out how to make a proper pull request.

Almost finished but…

Trying every possible way to extend the schema without succes.
@aequitas any change you could help me out here ?

I’m not sure if the extend is needed as Fabaff says in his review.
Hopefully you will have some time to look at the code so it can be merged with 0.52 :slight_smile:

Keep in mind: I’m not well acquainted with RFxTrx component.

I believe fabaff’s idea is to not override the schema of the component, but simply inherit from it the existing parts and add the functionality on top of it. I think it is needed. Otherwise you might break the component, or your component to be broken by changes in the code you are reusing.

What’s the issues you are getting with extend? I saw you mentioned some errors here: https://github.com/home-assistant/home-assistant/pull/8875#discussion_r132427539 if that’s what’s bothering you this means you haven’t updated your config file, and the config file itself is failing validation.

I tried extending the schema as mentioned by Fabaff. Though since i’m not adding any additional config options extending the schema seems pointless to me.
By adding the extended schema it’s requiring extra config options which aren’t needed.
But of course I could be completely wrong :slight_smile:

The device is a RFlink btw and not a RFxTrx device.

1 Like

Im really looking forward to getting this merged @passie :slight_smile:

My bad!

Are you adding optional configuration options? If so, you should mark them as optional, otherwise you’ll be getting what you’re getting?