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

unabel to control covers #21

Closed
ageurtse opened this issue Sep 5, 2022 · 17 comments
Closed

unabel to control covers #21

ageurtse opened this issue Sep 5, 2022 · 17 comments
Labels
help wanted Extra attention is needed

Comments

@ageurtse
Copy link

ageurtse commented Sep 5, 2022

I have a problem, but don't know where to look.
I rebuild the schematic from this site https://www.die-welt.net/2021/06/controlling-somfy-roller-shutters-using-an-esp32-and-esphome/

flashed my ESP32, but the up/down and stop commands won't work.
When learning the remote the cover goes shortly up an down.
but that is it.

i make use of NVSRollingCodeStorage.

@Legion2
Copy link
Owner

Legion2 commented Sep 5, 2022

What type of covers do you have and what type of remote did you used before? Have a look at #17 (comment), you may also have to adjust the repeat parameter for your type of covers to work.

@ageurtse
Copy link
Author

ageurtse commented Sep 6, 2022

I have blinds witw a somfy rts motor.
The origanaly remote is an old telis 4

@ageurtse
Copy link
Author

ageurtse commented Sep 8, 2022

tryed the things from post 17, and changed the repeat time's but that didn't solved it.
any more clue's

@Legion2 Legion2 added the help wanted Extra attention is needed label Sep 8, 2022
@Legion2
Copy link
Owner

Legion2 commented Sep 8, 2022

I think your covers and remote use different commands or variations of the commands. Maybe you find some more information about their protocol in the internet (e.g. https://github.com/merbanan/rtl_433), but I can't help you debug your hardware.

@adam-thomas-privitar
Copy link

adam-thomas-privitar commented Nov 29, 2022

Hi. I have this exact same issue. Prog works, the blinds jump when I run PROG. But after, nothing happens -- no response on the up or down. I have discussed it over email with @evgeni who authored the blog post and he also mentioned that possibly the commands are different.

I am purchasing an RTL-SDR stick to check and compare the signals myself. I will report back if I have luck finding this issue.

Maybe its the blinds we have? I have "Electra" blinds which integrate with somfy remote. Is it the same for you? I can't find the model on the damn things.

@ageurtse
Copy link
Author

I abbonded ghis and installed an rflink gateway, which worked great.

@adamscybot
Copy link
Contributor

adamscybot commented Nov 29, 2022

@ageurtse Interesting. Does that thing support somfy out of the box? If so, perhaps I can work backwards from its software to how it sends the commands? Did you use some additional software?

Or do you think its a hardware issue?

@ageurtse
Copy link
Author

Yes it works out of the box but its based on a arduino mega.

All the info is here https://www.rflink.nl/

@adamscybot
Copy link
Contributor

adamscybot commented Nov 29, 2022

Thanks. Apparently the source is now closed https://www.letscontrolit.com/forum/viewtopic.php?t=8323 so my plan wont work. Though I did find https://github.com/filipmaelbrancke/ha-rflink-rts.

Whatever its doing inside RFLink, this project is not. Hopefully I can shine light on it with the dongle.

EDIT: More details. I suspect this is related to how programming works on my Electra blinds. When I pair a new remote, that channel on the real one stops working. Very odd -- I need to reset the blind completely I think. I have asked the manufacturer for the manual.

@adamscybot
Copy link
Contributor

adamscybot commented Dec 5, 2022

I've got an RTL SDR and started debugging. With a newly compiled version, I can see the frames picked up from the original remote using RTL_433.

Testing the original remote

Ive masked out my original remote ID below.

Down:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:32:16
model     : Somfy-RTS    id        : XXXXXX
Control   : Down (4)     Counter   : 2306          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:32:16
model     : Somfy-RTS    id        : XXXXXX
Control   : Down (4)     Counter   : 2306          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:32:17
model     : Somfy-RTS    id        : XXXXXX
Control   : Down (4)     Counter   : 2307          Retransmission: 0         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:32:17
model     : Somfy-RTS    id        : XXXXXX
Control   : Down (4)     Counter   : 2307          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:32:17
model     : Somfy-RTS    id        : XXXXXX
Control   : Down (4)     Counter   : 2307          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:32:17
model     : Somfy-RTS    id        : XXXXXX
Control   : Down (4)     Counter   : 2307          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:32:17
model     : Somfy-RTS    id        : XXXXXX
Control   : Down (4)     Counter   : 2307          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:32:20
model     : Somfy-RTS    id        : XXXXXX
Control   : Down (4)     Counter   : 2309          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:32:20
model     : Somfy-RTS    id        : XXXXXX
Control   : Down (4)     Counter   : 2309          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:32:21
model     : Somfy-RTS    id        : XXXXXX
Control   : Down (4)     Counter   : 2310          Retransmission: 1         Integrity : CHECKSUM

Up:

time      : 2022-12-05 00:34:18
model     : Somfy-RTS    id        : XXXXXX
Control   : Up (2)       Counter   : 2313          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:34:18
model     : Somfy-RTS    id        : XXXXXX
Control   : Up (2)       Counter   : 2313          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:34:18
model     : Somfy-RTS    id        : XXXXXX
Control   : Up (2)       Counter   : 2313          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:34:18
model     : Somfy-RTS    id        : XXXXXX
Control   : Up (2)       Counter   : 2313          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:34:18
model     : Somfy-RTS    id        : XXXXXX
Control   : Up (2)       Counter   : 2313          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:34:18
model     : Somfy-RTS    id        : XXXXXX
Control   : Up (2)       Counter   : 2313          Retransmission: 1         Integrity : CHECKSUM
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-12-05 00:34:18
model     : Somfy-RTS    id        : XXXXXX
Control   : Up (2)       Counter   : 2313          Retransmission: 1         Integrity : CHECKSUM

Thoughts on results

So this confirms my problem is not caused by the blinds working on different commands, and probably that's the same as the OPs and the guy in this thread.

It is of note I have the same CC1101 as this guy. Which raises some suspicions.

Testing my fake remote

Now to check how the signal appears when sent from my fake remote...

RTL_433 detects PROG from my fake remote. As expected, since that seems to work. However, issuing UP or DOWN commands yields no detection in RTL_433. At this point it seems clear the issue is with the fake remote. I'm guessing on people who have this project setup as working, RTL_433 works fine with it -- so this is definitely weird.

When using the -A flag to analyse what the fake remote is sending when I press up and down, I can see for sure there is something sent when I issue the up and down commands. But RTL_433 does not think it's somfy frames.

Maybe my hardware is bad? Maybe the code in this project doesn't create 100% valid somfy frames? Not sure where to go from here.

I have also checked the frequencies of both the real and fake remote. The fake remote is vastly stronger than the real one, but given it receives PROG fine, I'm inclined to think it's not a problem. It's also slightly above what's expected frequency wise but within tolerance IMO (and again, prog works). Red line is 433.42mhz.

Original remote Fake Remote
original remote fake remote

There's something odd a little that the fake on seems to have a small pulse before the main pulses. Whereas the real one does not. Unsure if related.

Fake remote pulse captures

Next steps

I'm a little stuck now. New to radio stuff so took some time to get as far as this.

I think I should add logging to the RTL_422 somfy decoder and see exactly where the fake remote up/down calls fail to be recognised.

Again, new to radio, so I don't know if its nonsense -- but its curious that the other guy has the problem on the same "v2" CC1101 board. Maybe my board is poor quality and the timings are off. Then again, PROG is detected, but perhaps this is a simpler signal with less leading/trailing edges on the manchester encoding.

@adamscybot
Copy link
Contributor

I have discovered the reason RTL_433 does not detect up/down frames from my fake remote is that it fails this check in its decoder:

    if (bitbuffer_search(bitbuffer, decode_row, 0, preamble_pattern, preamble_pattern_bit_length) != 0) {
        printf("Abort early 2\n");
        return DECODE_ABORT_EARLY;
    }

Where with the real remote it passes, and PROG passes on the fake one too.

@adamscybot
Copy link
Contributor

adamscybot commented Dec 5, 2022

Well, im getting somewhere. I've managed to get RTL_433 to detect my fake remote DOWN command (up seems to work only rarely). I monitored the frequency and offset it slightly so its exactly 443.42mhz. I'm beginning to suspect the additional unexpected burst of signal power before the main bursts on the fake remote is the cause of the flaky detection. I also increase the pulses to 8.

Its at least detected sometimes now...but I think this is a non issue since even with the real remote, rtl_433 does not detect all frames the real blinds do.

However, I can see that:

  • Both remotes I have setup on home assistant (emulated) come through with the same remote ID
  • The rolling code does not increment!! It's always 1. I am using NVS rolling code storage, so now this is my primary angle to attack.

Lo and behold -- in the serial monitor after compiling with DEBUG as 1 I have:

nvs_set failed!
nvs_commit done

@adamscybot
Copy link
Contributor

Aaaand BINGO!

I have it working. The problems were as follows:

  • The key that I used for the NVS rolling storage was long and had spaces, probably too long.
  • At the same time, I changed the name of the storage to abandon the old area of the NVS storage.
  • Reprogrammed.
  • It now all works.

I would hazard a guess people who have this problem have the same issue.

@Legion2
Copy link
Owner

Legion2 commented Dec 7, 2022

We should add this to the documentation, or even implement a runtime check.

@adamscybot
Copy link
Contributor

I've gone ahead and raised a PR to add a bit more info

@Legion2
Copy link
Owner

Legion2 commented Apr 3, 2023

I merged the documentation update and now closing this issue as resolved.

@Legion2 Legion2 closed this as completed Apr 3, 2023
@evgeni
Copy link
Contributor

evgeni commented Feb 22, 2025

FWIW, When moving the code to an "external component" (evgeni/esphome-configs#130) I also implemented limits, so people should get proper errors when they try to use namespace or storage names longer than 15 chars :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants