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

Sniffing Warema Shutter #213

Open
tombrain opened this issue Jan 10, 2022 · 38 comments
Open

Sniffing Warema Shutter #213

tombrain opened this issue Jan 10, 2022 · 38 comments

Comments

@tombrain
Copy link

Latest firmware used?

yes

Information

Warema EWFS based devices, e.g. shutters (encoding type: Manchester)

Always pushed the same button and nearly almost sniffed another code.

Additional info:
At the moment i use an c++-programm (https://github.com/rfkd/aircontrol) to send the command successfully. i want to port the code to rf-bridge

with aircontrol:

	airCommand =
		"S01110100110111"	// Command
		"S000011010"                  // Device
		"S011110101"                  // Device
		"S";

Sniffed data

{"RfRaw":{"Data":"AA B1 04 0366 06E0 16E4 1A54 B0808081809190A18080809191AA180809190818091808 55"}}
{"RfRaw":{"Data":"AA B1 04 0366 06E0 16EE 1A54 B0808081809190A18080809191AA180809190818091808 55"}}
{"RfRaw":{"Data":"AA B1 04 0370 06E0 16EE 1A7C B0808081809190A18080809191AA180809190818091808 55"}}
{"RfRaw":{"Data":"AA B1 04 0384 06EA 16DA 1A68 B0808081809190A18080809191AA180809190818091808 55"}}
{"RfRaw":{"Data":"AA B1 04 0384 06EA 16E4 1A72 B0808081809190A18080809191AA180809190818091808 55"}}
{"RfRaw":{"Data":"AA B1 04 0384 06F4 16DA 1A68 B0808081809190A18080809191AA180809190818091808 55"}}
{"RfRaw":{"Data":"AA B1 04 0384 06F4 16DA 1A68 B0808081809190A18080809191AA180809190818091808 55"}}
{"RfRaw":{"Data":"AA B1 04 0384 06F4 16DA 1A68 B0808081809190A18080809191AA180809190818091808 55"}}
{"RfRaw":{"Data":"AA B1 04 0384 06F4 16DA 1A72 B0808081809190A18080809191AA180809190818091808 55"}}
{"RfRaw":{"Data":"AA B1 04 0384 06F4 16DA 1A72 B0808081809190A18080809191AA180809190818091808 55"}}
{"RfRaw":{"Data":"AA B1 04 0384 06F4 16E4 1A72 B0808081809190A18080809191AA180809190818091808 55"}}
{"RfRaw":{"Data":"AA B1 04 0384 06F4 16E4 1A72 B0808081809190A18080809191AA180809190818091808 55"}}

@chiefymuc
Copy link

Let me know if you figured it out. Would also like to use a bridge rather than another Raspberry Pi!

@m4rquez
Copy link

m4rquez commented Mar 2, 2022

Hi @tombrain, did you find any solution yet?

I'm facing the same problem. Using Warema EWFS shutters with aircontrol without any issues, but can't get them working with the rf-bridge/tasmota/portisch.

Like you, i'm getting about 8 different codes, converted them all to B0, but none of them is working.

Another problem, only UP & STOP generating the long codes, DOWN codes are shorter and always the same.

@tombrain
Copy link
Author

tombrain commented Mar 2, 2022

Let me know if you figured it out. Would also like to use a bridge rather than another Raspberry Pi!

Hi @chiefymuc,
exact. I want to port to a NUC. This engine has no Pins. I want to use the RF-Bridge for 433-Communication

@tombrain
Copy link
Author

tombrain commented Mar 3, 2022

Using Warema EWFS shutters with aircontrol without any issue

Hi @m4rquez,
sorry, i found no solution to create Codes for the bridge.

Until now i have to use aircontrol.

@tombrain
Copy link
Author

Now i use an esp32 and ESPHome. Communication by MQTT to Home Assistant. That works for me.

@chiefymuc
Copy link

Can you give some details? Which receiver / transmitter did you connect to the esp32? How did you get the codes? Thank you!

@tombrain
Copy link
Author

@tombrain
Copy link
Author

But next time i will do some changes to work by ESPHome. And additioinally some doku :-)

@chiefymuc
Copy link

@tombrain I'm trying to recreate that. I have installed aircontrol, but how exactly did you get the codes? I am able to save a file and replay it, but I struggle how to convert them into actual codes.

@tombrain
Copy link
Author

tombrain commented Jan 6, 2023

@chiefymuc good news. i extend aircontrol to sniff waremacodes direct

https://github.com/tombrain/aircontrol branch: localwaremacodes

run with paramter x and directly get the code

image

@chiefymuc
Copy link

Oh wow I did not see that! Amazing work!

I was looking into trying out ESPhome with the Raw Action:
https://esphome.io/components/remote_transmitter.html?highlight=rf#remote-transmitter-transmit-raw-action

Like S is +5000
0 is +890, -890
1 is -890,+890
s is -5000 (not used in Warema as it seems).

This might be a nice option as well to work with ESP32. I will see if I can find the time.

I made it work with your Arduino code on ESP32 so far!

@Blackspell01
Copy link

hey there, apparently im too stupid to get it working....
whenever im trying to perform a scan with aircontrol -d scan -s 5000 im only getting a 40kb file which I can't open ... can someone please explain what I have to do?

@chiefymuc
Copy link

  • It's a hex file. You can upload it into hex converters online and then you should be able to see a bunch of 0 and 1. I then plotted the result as a graph and started to look where a code similar to the above started... It's tricky

@Blackspell01
Copy link

Blackspell01 commented Jun 17, 2023

  • It's a hex file. You can upload it into hex converters online and then you should be able to see a bunch of 0 and 1. I then plotted the result as a graph and started to look where a code similar to the above started... It's tricky

I figured out how to convert the file (at least I think so). Now I have tons of 0 and 1s. How do I plot this as a graph?

@tombrain unfortunately the x parameter doesn’t show anything.. what do I have to type into the ssh terminal specifically?
Is ./bin/aircontrol -d scan.hex -x 1000 correct? For me it doesn’t create a file nor does it show anything

@tombrain
Copy link
Author

@Blackspell01 did you downlad the code from https://github.com/tombrain/aircontrol branch: localwaremacodes

@Blackspell01
Copy link

Blackspell01 commented Jun 20, 2023

@Blackspell01 did you downlad the code from https://github.com/tombrain/aircontrol branch: localwaremacodes

Actually had to press the button a few times for the software to recognise the codes. Now it worked, thank you a 1000 times for this great software!!

But one more question, what is the perfect solution to send the codes over home assistant? Over an esp? Or is it possible with the sonoff rf bridge ?

@tombrain
Copy link
Author

@Blackspell01 I use esphome. It works perfectly. It even works with percentages of the rollo.

@chiefymuc
Copy link

@Blackspell01 I use esphome. It works perfectly. It even works with percentages of the rollo.

How did you make it work with esphome and warema?

@tombrain
Copy link
Author

@chiefymuc i upload my esphome.yaml

https://github.com/tombrain/esphome_waremacontrol

there are two parts:

  • first: warema_blind_component.h listening for MQTT an send it per RCSWitch
  • second: ESPHome timebased for sendind MQTT

@Blackspell01
Copy link

im sorry it may be a stupid question but what am I supposed to do with the .h file? :)

@tombrain
Copy link
Author

Parallel in Filesystem to yaml of esphome

@Blackspell01
Copy link

Blackspell01 commented Jun 22, 2023

Thank you. I think im very close now. Do you know by any chance how to deal with this mqtt error?
My settings are:
mqtt:
broker: @192.168.188.74
username: MQTT
password: mqtt

Screenshot 2023-06-22 185334
Screenshot 2023-06-22 185541

@Blackspell01
Copy link

Blackspell01 commented Jun 25, 2023

Damn, I finally got it working! Thank you so much!!

@tombrain
Copy link
Author

did you get working with sonoff by esp?

@Blackspell01
Copy link

Unfortunately not. Im using a wemos d1 mini currently. The sonoff rf link was a very stupid purchase, I cant manage to get this thing working with any of my rf devices...
But may I ask you another question? As with your code it is possible to send manchester code, would it also be possible to send specifically timed codes over ESP Home like in the attached image? (Maybe with another .h file)
Screenshot 2023-06-25 181320

@tombrain
Copy link
Author

i think so. you have to port this code:
https://github.com/jacobmellin/unitec-rfsend/blob/master/unitec-rfsend.c

@tombrain
Copy link
Author

tombrain commented Jun 25, 2023

Perhaps you can try by native ESPHome first:

https://esphome.io/components/remote_transmitter.html#setting-up-rf-devices

switch:
  - platform: template
    name: RF Power Button
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '100010000000000010111110'
          protocol: 2
          repeat:
            times: 10
            wait_time: 0s

@tombrain
Copy link
Author

second you can try my raw433-method

  - mqtt.publish:
      topic: waremacontrol/command/raw433
      payload: "0101010101110110110101"

@Blackspell01
Copy link

I tried the native method already with no luck :(.
How did you convert the initial code: '100010000000000010111110' to the payload: "0101010101110110110101"?
And also why do you suggest to use protocol 2 in this case?

@tombrain
Copy link
Author

both code ars only examples..

protocol 2 is from copy&paste of official doku

@Blackspell01
Copy link

Hmm ok i already tried that. I somehow have to set the timings to 975us and 475us but I don't understand how to specify those values..

@chiefymuc
Copy link

I was able to make this work with the pure esphome!

I had to convert the up and downs into the timing and then it will send the right command.

This is the crucial part:

      - remote_transmitter.transmit_raw:
          code: [5890,-1780,890,-890,890,-890,1780,-1780,1780,-890,890,-1780,890,
                -890,1780,-1780,890,-890,890,-890,6780,-890,890,-890,890,-1780,890,
                -890,890,-890,1780,-1780,890,-890,6780,-890,890,-890,890,-1780,1780,
                -890,890,-1780,1780,-1780,5890]

Here ist my full esphome .yaml:

esphome:
  name: esphome-warema

esp32:
  board: esp32doit-devkit-v1
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ""

ota:
  password: ""

wifi:
  ssid: "XXXX"
  password: "#YYYY"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Warema Fallback Hotspot"
    password: "ZZZZ"

captive_portal:


remote_transmitter:
  pin: GPIO25
  # RF uses a 100% carrier signal
  carrier_duty_percent: 100%


cover:
  - platform: time_based
    device_class: blind
    name: Garden Window Cover
    icon: "mdi:window-shutter"
    open_duration: 26s
    open_action:
      - switch.turn_on: garden_window_up
    close_duration: 23s
    close_action:
      - switch.turn_on: garden_window_down
    stop_action:
      - switch.turn_on: garden_window_stop
  - platform: time_based
    device_class: blind
    name: Side Window Cover
    icon: "mdi:window-shutter"
    open_duration: 27s
    open_action:
      - switch.turn_on: side_window_up
    close_duration: 23s
    close_action:
      - switch.turn_on: side_window_down
    stop_action:
      - switch.turn_on: side_window_stop

switch:
  - platform: template
    name: Garden Window Up
    id: garden_window_up
    icon: "mdi:window-shutter-open"
    entity_category: config
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [5890,-1780,890,-890,890,-890,1780,-1780,1780,-890,890,-1780,890,
                -890,1780,-1780,890,-890,890,-890,6780,-890,890,-890,890,-1780,890,
                -890,890,-890,1780,-1780,890,-890,6780,-890,890,-890,890,-1780,1780,
                -890,890,-1780,1780,-1780,5890]
  - platform: template
    name: Garden Window Down
    id: garden_window_down
    icon: "mdi:window-shutter"
    entity_category: config
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [5890,-1780,890,-890,890,-890,1780,-1780,1780,-890,890,-1780,890,
                -890,1780,-1780,890,-890,1780,-890,5890,-890,890,-890,890,-1780,
                890,-890,890,-890,1780,-1780,890,-890,6780,-890,890,-890,890,
                -1780,1780,-890,890,-1780,1780,-1780,5890]
  - platform: template
    name: Garden Window Stop
    id: garden_window_stop
    icon: "mdi:window-shutter-cog"
    entity_category: config
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [5890,-890,890,-1780,890,-890,1780,-1780,1780,-890,890,-1780,890,
                -890,1780,-890,890,-890,890,-1780,6780,-890,890,-890,890,-1780,890,-890,
                890,-890,1780,-1780,890,-890,6780,-890,890,-890,890,-1780,1780,-890,890,
                -1780,1780,-1780,5890]
  - platform: template
    name: Side Window Up
    id: side_window_up
    icon: "mdi:window-shutter-open"
    entity_category: config
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [5890,-1780,890,-890,890,-890,1780,-1780,1780,-890,890,-1780,
                890,-890,890,-890,890,-890,890,-890,890,-890,6780,-890,890,
                -890,890,-1780,890,-890,890,-890,1780,-1780,890,-890,6780,-890,
                890,-890,890,-1780,1780,-890,890,-1780,1780,-1780,5890]
  - platform: template
    name: Side Window Down
    id: side_window_down
    icon: "mdi:window-shutter"
    entity_category: config
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [5890,-1780,890,-890,890,-890,1780,-1780,1780,-890,890,-1780,
                890,-890,890,-890,890,-890,890,-890,1780,-890,5890,-890,890,
                -890,890,-1780,890,-890,890,-890,1780,-1780,890,-890,6780,
                -890,890,-890,890,-1780,1780,-890,890,-1780,1780,-1780,5890]
  - platform: template
    name: Side Window Stop
    id: side_window_stop
    icon: "mdi:window-shutter-cog"
    entity_category: config
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [5890,-890,890,-1780,890,-890,1780,-1780,1780,-890,890,-1780,
                890,-890,890,-890,1780,-890,890,-1780,6780,-890,890,-890,890,
                -1780,890,-890,890,-890,1780,-1780,890,-890,6780,-890,890,-890,
                890,-1780,1780,-890,890,-1780,1780,-1780,5890]

@Blackspell01
Copy link

Blackspell01 commented Nov 26, 2023

Damn that's impressive. Thank you so much for sharing.

@iflowmac
Copy link

I was able to make this work with the pure esphome!

I had to convert the up and downs into the timing and then it will send the right command.

Hello chiefymuc,
how did you convert the "S01110100111111S011101001S000011111S" to the timings? by hand or had you a software? where did you get the exact µs-values from?

@Blackspell01
Copy link

I did it by hand with a YouTube tutorial. Timing is always 890µs

@iflowmac
Copy link

thank you!

@chiefymuc
Copy link

I built an Excel-Table to convert the codes to the timestampts. It is not fully automatic... Maybe it helps:

code.xlsx

@iflowmac
Copy link

thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants