andrew01144 / Tasmota-SomfyRTS

Berry script to to control Somfy powered blinds using Tasmota
13 stars 1 forks source link

Using a CC1101 for easily transmitting 433.42 MHz signals #2

Closed ruedli closed 2 years ago

ruedli commented 2 years ago

In my project I used a programmable radio, the CC1101. It allows for using the Somfy required 433.42 MHz frequency without changing crystals. I achieved full range successful Somfy shade communication in my dedicated (non Tasmota based) solution using an ESP32. I believe the libraries I used could not be used in Tasmota, because it would occupy the Tasmota loop too long for sending Somfy commands.

My questions are:

See https://github.com/ruedli/SomfyMQTT for my working hardware and code.

andrew01144 commented 2 years ago

Timing Issues? AFAIK, this is fine. I use an unmodified tasmota32-ir.bin. My code simply generates a large Tasmota IRsend Raw command and executes it, so all the real-time issues are handled by Tasmota's IRsend.

It might even be possible to do all this logic on the host. I decided to do it on the ESP32 in Berry because:

CC1101? I don't know anything about the CC1101, but did some quick research. (1) It would need to be driven by a real-time signal from IRsend - I think this is possible, but I'm not certain (config GDO0 for Tx?). (2) It would need to be configured. I could not find any generalized support for configuring the CC1101 in Tasmota, but maybe I did not look hard enough. This is the functionality of the SmartRC-CC1101-Driver-Lib that you used in your project.

I like your project! Like you, I have been using my own Wemos/Arduino/MQTT/Nickduino firmware for 4 years with no problems, but I have been on a mission to replace all my custom fw with Tasmota. Back then, I did not know how easy it was to obtain the 433.42MHz crystal/SAW for the FS1000A, so I used this Aurel Tx/Rx. I now use the modified FS1000A solution; in my opinion, this is the simplest, and simple is always good.

ruedli commented 2 years ago

Thanks for looking into it. I guess the timing issue I referred to is in making the Somfy command, which is handled in the library, which I just took as-is. At the time using this library in Tasmota was problematic, as it needed tighter control than the Tasmota loop could provide and needed to be precise enough to generate the sequence of pulses for the Somfy.

My objective was to easily control the shades, and using a readily available library was a pre. Also the CC1101 is easy (SDR) compared to hacking a 433.93 MHz device into producing 433.43MHz signal.

The devs were specific about not embedding this Somfy library in the Tasmota framework, so your Tasmota solution caught my eye.

Using Tasmota based would have been my preference and using this in combination with the SDR (the CC1101) seems the best of two worlds. I wonder if this would be easy. As you can see, the interface to the CC1101 is quite easy. You send it an initialization to tune the TX to 433.43 MHz and then precisely timed on and off commands for the sequence of pulses that make Somfy commands. This is not so different from your interface using raw IRsend commands I guess?

In short, I think the problem integrating in Tasmota that I ran into is in the Somfy command sending. (And not the Transmitter). If that is indeed correct, your creation of Somfy commands together with the CC1101 SDR would also be a simple (=good) solution. Op za 17 sep. 2022 11:08 schreef andrew01144 @.***>:

Timing Issues? AFAIK, this is fine. I use an unmodified tasmota32-ir.bin. My code simply generates a large Tasmota IRsend Raw command and executes it, so all the real-time issues are handled by Tasmota's.

It might even be possible to do all this logic on the host. I decided to do it on the ESP32 in Berry because:

  • I was worried about passing such huge commands over http or mqtt, though I never did any testing.
  • I wanted a "move-wait-stop" function, and was not confident that I could get good enough delay resolution between two http or mqtt messages.
  • I wanted a drop-in replacement for the functionality of my previous custom firmware solution.

CC1101? I don't know anything about the CC1101, but did some quick research. (1) It would need to be driven by a real-time signal from IRsend

  • I think this is possible, but I'm not certain (config GDO0 for Tx?). (2) It would need to be configured. I could not find any generalized support for configuring the CC1101 in Tasmota, but maybe I did not look hard enough. This is the functionality of the SmartRC-CC1101-Driver-Lib that you used in your project.

I like your project! Like you, I have been using my own Wemos/Arduino/MQTT/Nickduino firmware for 4 years with no problems, but I have been on a mission to replace all my custom fw with Tasmota. Back then, I did not know how easy it was to obtain the 433.42MHz crystal/SAW for the FS1000A, so I used this Aurel Tx/Rx https://www.nodo-shop.nl/en/transmitters-and-receivers/194-aurel-tranceiver-rtx-mid-5v.html. I now use the modified FS1000A solution; in my opinion, this is the simplest, and simple is always good.

— Reply to this email directly, view it on GitHub https://github.com/andrew01144/Tasmota-SomfyRTS/issues/2#issuecomment-1250034279, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGGYOGWFHPACTAZNN346LDV6WDBHANCNFSM6AAAAAAQO3SLME . You are receiving this because you authored the thread.Message ID: @.***>

andrew01144 commented 2 years ago

Do you know the bits and bytes that need to be sent to the CC1101 to configure it? Does anything need to be read from the CC1101?

Looking at the CC11001 datasheet, it looks like the SCLK has no min freq and no max duration, so we could build the driver in Berry. The SCLK might be unstable, but probably acceptable to the CC1101.

The Berry code below takes 6ms to clock through 32 bits.

import gpio
var pinSCLK = 22
var pinSO = 21
gpio.pin_mode(pinSCLK, gpio.OUTPUT)
gpio.pin_mode(pinSO, gpio.OUTPUT)
gpio.digital_write(pinSO, 0)
gpio.digital_write(pinSCLK, 0)
tasmota.delay(200)
var data = 0x55500aaa
var bit
for i: 1 .. 32
  if data & 0x80000000
    bit = 1
  else
    bit = 0
  end
  gpio.digital_write(pinSO, bit)
  gpio.digital_write(pinSCLK, 1)
  gpio.digital_write(pinSCLK, 0)
  data <<= 1
end
andrew01144 commented 2 years ago

I looked at the ELECHOUSE_cc1101 functions you call, then I looked at the ELECHOUSE_cc1101 library to see what it writes to the device. There is quite a bit of work there, but it might be fun to implement it.

ruedli commented 2 years ago

Yes, it looks indeed like good fun. I took the SmartRC-CC1101-Driver-Lib-master library (initializes and operates a transmitter, using SPI) and the Somfy_Remote_Lib-0.4.1 library (creates a somfy command and sends it using the transmitter). This Somfy_Remote_Lib-0.4.1contained a CC1101 example (a one pager SomfyRemote.cpp) that when compiled allowed me to operate the Somfy right away.

Without looking into how this worked, I built my objects around this example: added MQTT and a state engine to keep track of positions and what not. Which is why I do not know exactly how it works on a lower level. The CC1101 has more functionality than actually used for Somfy, but it works, is stable and is simple to call (so =good for me). I only initialize it, providing the frequency I want.

Reading your implementation I wondered whether the CC1101 could be used in Tasmota and if so, could it use your routine to send somfy commands.All this without - as I said - understanding the code below. I realize now, in order to make it work you'd need to study the interface between the two libraries. Anyhow: I think it is a good find. Other people have built it and it works fine for them as well. Operating two sunshades in fact (learning the ESP32 to both sunshades).

Unfortunately currently I do not have much time to look into it (the mentioned interface), but if you have questions and can help with my own code, let me know.

Cheers Ruud

Op za 17 sep. 2022 om 17:58 schreef andrew01144 @.***>:

I looked at the ELECHOUSE_cc1101 functions you call, then I looked at the ELECHOUSE_cc1101 library to see what it writes to the device. There is quite a bit of work there, but it might be fun to implement it.

— Reply to this email directly, view it on GitHub https://github.com/andrew01144/Tasmota-SomfyRTS/issues/2#issuecomment-1250095470, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGGYODTROGNFNBEZVO7QVTV6XTC7ANCNFSM6AAAAAAQO3SLME . You are receiving this because you authored the thread.Message ID: @.***>

-- Ruud Rademaker prefered mail: @.***

andrew01144 commented 2 years ago

FYI, I have just bought one of these CC1101 modules. It will be a few weeks before I expect to get some results.

ruedli commented 2 years ago

Yes, you need to be very careful. I have seen at least two different boards with 4x2 Dupont, however with different pinout! The Aliexpress vendor was not aware he posted images of the wrong layout / pinout. His board was simply a different PCB. These are the two diferent ones I had, both worked, but needed to be wired up differently: image

andrew01144 commented 2 years ago

Update: I received my CC1101 and took a first look at it. I built your SimpleSomfy.ino, connected it to the CC1101, and it works perfectly. As far as I can tell, I can switch from 433.42 to 433.92 using ELECHOUSE_cc1101.setMHZ(). So, that's all good. However, my Berry driver for the CC1101 does not work yet. The logic analyzer tells me my Berry driver is doing the same setup as ELECHOUSE_cc1101/SimpleSomfy.ino, but the CC1101 is not behaving the same, so I am am a bit stuck for for now.

ruedli commented 2 years ago

To me, the code to work with the module is in the software, that I used without modification. It seems to work, together with the Somfy library and can easily be used, as you can see from the working sketch.

Maybe it is something simple? You say : I can switch from 433.42 to 433.92

However it should be the other way around: Switch from 433.92 to 433.42. Hope this was it...

andrew01144 commented 2 years ago

I have it working now. It will take me a little while to put it into a publishable state. If I do that, do you want to try it?

You will need an ESP32. I am using an ESP32 minikit like this. It is pin-compatible with the Wemos D1 mini, but physically bigger, so will not fit in your box. You could use an ESP32-S2 like this. It is a similar size to the Wemos D1 mini, though the USB-C is on the other side, so you may need to mount it upside down to be mechanically compatible. I have used this module before; the initial flashing procedure is slightly different from the ESP32 because the USB-Serial conversion is implemented in the ESP rather than a separate chip, but it's quite a nice solution. Also, the IRsend signal that I send to the 433MHz Tx has little glitches in it. The FS1000A ignores them, but the CC1101 transmits them. I suspect the Somfy will ignore them, but I have not checked yet. If required, they can be removed with a filter built from a 47nF capacitor and 1k2 resistor.

ruedli commented 2 years ago

Yes, I can try it. I worked with a Wemos D1 mini, but the first one I had built was probably a minikit, like you mentioned, as I had to modify my 3D printed box in the past to fit the USB on the other side of my PCB ;-)

Does the publishable state mean I'll have a tasmota device capable of sending somfy commands? I have a sonoff 433 RF bridge which I use to issue Tasmota commands from (to light up groups) and which listens to buttons etc. Will I be able to issue commands to open and close the Somfy shutters?

Let me know what commands are supported or what your typical use case is.

Where do you suppress the glitches? between ESP and CC1101? Which CC1101 wire? Is it a low pass filter? capacitor to ground and resistor in series to the input? Or differently?

cheers Ruud

Op wo 5 okt. 2022 om 15:01 schreef andrew01144 @.***>:

I have it working now. It will take me a little while to put it into a publishable state. If I do that, do you want to try it?

You will need an ESP32. I am using an ESP32 minikit like this https://developers.wia.io/release/things/esp32-minikit. It is pin-compatible with the Wemos D1 mini, but physically bigger, so will not fit in your box. You could use an ESP32-S2 like this https://www.wemos.cc/en/latest/s2/s2_mini.html. It is a similar size to the Wemos D1 mini, though the USB-C is on the other side, so you may need to mount it upside down to be mechanically compatible. I have used this module before; the initial flashing procedure is slightly different from the ESP32 because the USB-Serial conversion is implemented in the ESP rather than a separate chip, but it's quite a nice solution. Also, the IRsend signal that I send to the 433MHz Tx has little glitches in it. The FS1000A ignores them, but the CC1101 transmits them. I suspect the Somfy will ignore them, but I have not checked yet. If required, they can be removed with a filter built from a 47nF capacitor and 1k2 resistor.

— Reply to this email directly, view it on GitHub https://github.com/andrew01144/Tasmota-SomfyRTS/issues/2#issuecomment-1268405608, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGGYOB52AAXBSD53P5GPR3WBV33JANCNFSM6AAAAAAQO3SLME . You are receiving this because you authored the thread.Message ID: @.***>

-- Ruud Rademaker prefered mail: @.***

andrew01144 commented 2 years ago

I don't think you will need the RC filter. I just tried it with my real Somfy, and it works.

It should be a functional replacement for your SomfyMQTT.ino project. It will be a device, made with an ESP32 + CC1101 which accepts mqtt commands and can control multiple blinds. It has no custom firmware because it uses standard tasmota32-ir.bin. It does have a custom Berry script, which you upload to the tasmota filesystem. See this to see how you would use it.

At the moment, it does not appear as a Tasmota "shutter" device, though it may be possible to configure Tasmota to do that. You will send it mqtt commands like RFtxSMFY {"Idx":1,"Button":2} to open blind 1, or RFtxSMFY {"Idx":2,"Button":4} to close blind 2.

ruedli commented 2 years ago

Yes, I see. An important part of my solution, is that I can move the shutter to a certain position (and report that position back through MQTT). It does this by calculating how long to move from the configured "time to move up" and "time to move down" and sending a "stop" at the right time. When moving to "0" or "100" I move to the end position without sending a stop, thus movement is synchronized again. Are shutter positions supported in your tasmota commands?

Op wo 5 okt. 2022 om 16:23 schreef andrew01144 @.***>:

I don't think you will need the RC filter. I just tried it with my real Somfy, and it works.

It should be a functional replacement for your SomfyMQTT.ino project. It will be a device, made with an ESP32 + CC1101 which accepts mqtt commands and can control multiple blinds. It has no custom firmware because it uses standard tasmota32-ir.bin. It does have a custom Berry script, which you upload to the tasmota filesystem. See this https://github.com/andrew01144/Tasmota-SomfyRTS#to-demonstrate-operation to see how you would use it.

At the moment, it does not appear as a Tasmota "shutter" device, though it may be possible to configure Tasmota to do that. You will send it mqtt commands like RFtxSMFY {"Idx":1,"Button":2} to open blind 1, or RFtxSMFY {"Idx":2,"Button":4} to close blind 2.

— Reply to this email directly, view it on GitHub https://github.com/andrew01144/Tasmota-SomfyRTS/issues/2#issuecomment-1268507795, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGGYOCXWZNAP44CQM2UBMDWBWFPNANCNFSM6AAAAAAQO3SLME . You are receiving this because you authored the thread.Message ID: @.***>

-- Ruud Rademaker prefered mail: @.***

andrew01144 commented 2 years ago

Are shutter positions supported in your tasmota commands?

No. I do this on the host side, and issue an mqtt command like RFtxSMFY {"Idx":1,"Button":2,"StopAfterMs":1500}. If you wanted the ESP32 to keep track of the position, you could either implement that in the Berry script, or you could try to get Tasmota to do it for you by making it a proper Tasmota Shutter device. This might be a clue on how to do that.

I don't fancy doing either myself because I don't need it in my situation, and it looks quite complicated! But feel free to add that functionality to my script if you want to. You might find that quite easy if you have already done it in your SomfyMQTT.ino. I'm happy to help if you have any questions.

ruedli commented 2 years ago

I see, with the "StopAfterMs" you can move a calculator interval of time. I'll have to see how easy a Tasmota shutter device can be created. I believe they rely on two relays operating the motor up and motor down power, so it is different from momentary switches to move up/down and stop.

Op wo 5 okt. 2022 om 16:44 schreef andrew01144 @.***>:

Are shutter positions supported in your tasmota commands?

No. I do this on the host side, and issue an mqtt command like RFtxSMFY {"Idx":1,"Button":2,"StopAfterMs":1500}. If you wanted the ESP32 to keep track of the position, you could either implement that in the Berry script, or you could try to get Tasmota to do it for you by making it a proper Tasmota Shutter device. This https://github.com/GitHobi/Tasmota/wiki/Somfy-RTS-support-with-Tasmota#using-rules-to-control-blinds might be a clue on how to do that.

I don't fancy doing either myself because I don't need it in my situation, and it looks quite complicated! But feel free to add that functionality to my script if you want to. You might find that quite easy if you have already done it in your SomfyMQTT.ino. I'm happy to help if you have any questions.

— Reply to this email directly, view it on GitHub https://github.com/andrew01144/Tasmota-SomfyRTS/issues/2#issuecomment-1268540903, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGGYOEYP5KJNQBXXJ7RPU3WBWH6XANCNFSM6AAAAAAQO3SLME . You are receiving this because you authored the thread.Message ID: @.***>

-- Ruud Rademaker prefered mail: @.***

andrew01144 commented 2 years ago

I believe they rely on two relays operating the motor up and motor down power

Can do, but does not have to. The example I pointed to is actually done on the fork of Tasmota that supports Somfy RTS. That might be a good place to start. Hopefully, just replace SomfyUp1 with RFtxSMFY {"Idx":1,"Button":2}, etc, and it should work on my Somfy support. However, I find Tasmota Rules are very difficult to understand, and there might be a simpler way to do it in Berry.

andrew01144 commented 2 years ago

You can download the version with CC1101 support now: RFtxSMFY_CC1101.be.

Follow the instructions here, with the following changes:

andrew01144 commented 2 years ago

FYI - I have implemented integration with Tasmota Shutters, so that should address your need for tracking and reporting the position of the blinds. It uses the example mentioned earlier, but implemented in Berry, so it is easier to install and understand. I'll let you know when I have some documentation of how to do it. image

ruedli commented 2 years ago

This looks great! I'll give it a go this weekend. I read that Berry is only available on 32bit platforms, so not on ESP82xx. (here: https://tasmota.github.io/docs/Berry/ ) However, the devkit you showed seemed to have an ESP8266, just like my wemos D1 mini. Is it just my confusion?

andrew01144 commented 2 years ago

Yes, you need an ESP32 for Berry. My earlier message mentions the two most convenient modules. The ESP32 MiniKit and the ESP32-S2 Mini are both ESP32, and they are pin compatible with the ESP8266 Wemos D1 mini. image

ruedli commented 2 years ago

Thnx... I found a ESP32 DEVKIT, board says0 MH-ET LIVE in my drawer (in fact 5 of them), the module says ESP32-WROOM-32, it is a slightly "larger" 2x19 pin board, similar to this:

[image: image.png]

This will be sufficient, no doubt

Op do 6 okt. 2022 om 20:36 schreef andrew01144 @.***>:

Yes, you need an ESP32 for Berry. My earlier message https://github.com/andrew01144/Tasmota-SomfyRTS/issues/2#issuecomment-1268405608 mentions the two most convenient modules. The ESP32 MiniKit and the ESP32-S2 Mini are both ESP32, and they are pin compatible with the ESP8266 Wemos D1 mini. [image: image] https://user-images.githubusercontent.com/18399286/194391561-125d6e32-4d95-4891-a770-db6a8d41e26a.png

— Reply to this email directly, view it on GitHub https://github.com/andrew01144/Tasmota-SomfyRTS/issues/2#issuecomment-1270519379, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGGYOC3T4HKHYNFAOY54YLWB4LZVANCNFSM6AAAAAAQO3SLME . You are receiving this because you authored the thread.Message ID: @.***>

-- Ruud Rademaker prefered mail: @.***

andrew01144 commented 2 years ago

That should do it. Install tasmota32-ir.bin and you are 30% of the way there. I have found the webinstaller works pretty well: https://tasmota.github.io/install. Just select "ESP32" and "Tasmota IR".

If you prefer to use esptool, then install tasmota32-ir.factory.bin. The ESP32 memory layout is different from ESP8266, and it has additional components, including a partition map. webinstaller knows how to create the additional components. The "factory" version of the firmware has the additional components bundled in, so you can write it to flash location 0x0.

darenkeates commented 2 years ago

You guys are amazing, I've been searching high and low for a solution and there are various things available but none seem to work. The Tasmota with CC1101 is the solution I feel is best but happy to replace the crystal on another card too. I will purchase an ESP32 so I can try your solution as I only have a bucket full of ESP8266s. I want to interface this to my Hubitat smart home and lots of people talk about MQTT but I have zero experience of that so a bit worried.

andrew01144 commented 2 years ago

@darenkeates Baby steps is always my advice. Install Tasmota on one of your ESP8266s and try to get Hubitat to control its LED via mqtt (or you can use http). If that works, then progress to Shutters and Blinds. Let me/us know if you need any help. Good luck!

FYI: Changing the crystal on the FS1000A was surprisingly easy (search eBay for "433 SAW"), vs the CC1101 needs 4 additional wires from the ESP. Which solution you prefer is a personal matter.

andrew01144 commented 2 years ago

hooking up my CC1101 to a working tamota32-ir.bin firmware. I noticed you are not using GDO2. I am not sure if this is needed, probably not as I read in the module documentation:

image

Was it used in the CC1101 library and were we not depending on that part of it for sending Somfy commands? If so might be worse documenting in the Berry script. You mentioned you needed to hookup 8 wires between module and ESP32, but like this there are only 7 wires needed. Or did you hook it up somewhere that I cannot see from the script?

I hooked GDO2 up, but I confirm that it is not used, so it should be fine to leave it disconnected. That's the same as your usage in SimpleSomfy.ino. I agree it's worth adding something to document that in the script.

It's not clear to me exactly what the CC1101 library does with GDO0 and GDO2. It looks like it uses GDO0(input) in async mode (which is what we use) and GDO0(output)+GDO2(input) in sync mode. But I don't understand what sync mode is.

ruedli commented 2 years ago

The good news is: I have my shutters moving!

I was wondering how you got the interface with the shutters integrated:

I have implemented integration with Tasmota Shutters, so that should address your need for tracking and reporting the position of the blinds. It uses the example mentioned earlier,

Which shutter type did you add? Did you configure up / down moving times? Which relays did you specify and how did you make it do RFtxSMFY (button 1,2 and 4) commands with the right id?

My quick and dirty setup, that worked immediately: signal-2022-10-08-125141

andrew01144 commented 2 years ago

That's great, I'm so pleased that it worked for you!

I have thrown some instructions on how to configure it to work with Tasmota Shutters and Blinds here.

ruedli commented 2 years ago

I see, I worked from tasmota32-ir.bin, but that doesn't have shutter functionality enabled. Did you compile it yourself with shutters AND ir? I get: image

fun fact: my shutters DO move when I operate relay 1 and 2 manually... ;-) When I toggle relay 1, it goes down and when I toggle relay 2 it goes up again. I cannot stop it yet however...

andrew01144 commented 2 years ago

Oh, that's interesting. I confess that I am not using tasmota32-ir.bin. I needed some temperature sensors, so I built my own binary, which (I guess) just happens to have shutters in it.

These are my notes on how I created it: Make a tasmota32.bin with both IR and Sensor support: TasmoCompiler: https://gitpod.io/#https://github.com/benzino77/tasmocompiler Select features: ESP32: Generic, Add: IR, Temp/Hum. V12.0.2 Custom parameters: #define CODE_IMAGE_STR "my-ir+th" Download firmware.bin, upgrade.

andrew01144 commented 2 years ago

you can download this tasmota32gen_custom-ir.bin if you like.

ruedli commented 2 years ago

slowly getting there.... Maybe a small problem in the integration? It seems to send and extra command. It moves to the targeted position then stops, next another "stop" is send, which causes it to go to the saved position. ("stop" = "my" button).

I see this log after sending it the command to close to 50%

15:47:01.796 MQT: stat/somfy/RESULT = {"Position1":50} 15:47:02.889 MQT: stat/somfy/RESULT = {"IRSend":"Done"} 15:47:03.750 MQT: stat/somfy/RESULT = {"IRSend":"Done"} 15:47:04.466 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":94,"Direction":-1,"Target":50,"Tilt":0}} 15:47:04.578 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":94,"Direction":-1,"Target":50,"Tilt":0}} 15:47:05.587 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":92,"Direction":-1,"Target":50,"Tilt":0}} 15:47:06.610 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":89,"Direction":-1,"Target":50,"Tilt":0}} 15:47:07.588 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":87,"Direction":-1,"Target":50,"Tilt":0}} 15:47:08.612 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":85,"Direction":-1,"Target":50,"Tilt":0}} 15:47:09.587 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":83,"Direction":-1,"Target":50,"Tilt":0}} 15:47:10.588 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":80,"Direction":-1,"Target":50,"Tilt":0}} 15:47:11.615 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":78,"Direction":-1,"Target":50,"Tilt":0}} 15:47:12.591 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":76,"Direction":-1,"Target":50,"Tilt":0}} 15:47:13.644 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":73,"Direction":-1,"Target":50,"Tilt":0}} 15:47:14.618 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":71,"Direction":-1,"Target":50,"Tilt":0}} 15:47:15.627 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":69,"Direction":-1,"Target":50,"Tilt":0}} 15:47:16.596 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":67,"Direction":-1,"Target":50,"Tilt":0}} 15:47:17.626 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":64,"Direction":-1,"Target":50,"Tilt":0}} 15:47:18.599 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":62,"Direction":-1,"Target":50,"Tilt":0}} 15:47:19.655 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":60,"Direction":-1,"Target":50,"Tilt":0}} 15:47:20.581 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":58,"Direction":-1,"Target":50,"Tilt":0}} 15:47:21.606 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":55,"Direction":-1,"Target":50,"Tilt":0}} 15:47:22.609 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":53,"Direction":-1,"Target":50,"Tilt":0}} 15:47:23.584 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":51,"Direction":-1,"Target":50,"Tilt":0}} 15:47:24.046 MQT: stat/somfy/RESULT = {"POWER1":"OFF"} 15:47:24.050 MQT: stat/somfy/POWER1 = OFF 15:47:24.057 MQT: stat/somfy/RESULT = {"POWER2":"OFF"} 15:47:24.061 MQT: stat/somfy/POWER2 = OFF 15:47:24.570 MQT: stat/somfy/SHUTTER1 = 50 15:47:24.575 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":50,"Direction":0,"Target":50,"Tilt":0}} 15:47:25.400 MQT: stat/somfy/RESULT = {"IRSend":"Done"} 15:47:26.202 MQT: stat/somfy/RESULT = {"IRSend":"Done"}

the relays seem to move OK. This is what it looks like after the 50% command. The shutters move there and next to the saved pos.

image

I "just" configure one shutter, not two. With only 2 relays, not 4. Should not cause issues, or is it?

It also seems to send two commands in the beginning, but if these are both "move up" (or "down") they do not cause issues.

ruedli commented 2 years ago

you can download this tasmota32gen_custom-ir.bin if you like.

Thnx, I had compiled and uploaded it, but for some reason it refused to connect to the wifi (I configured it correctly) and would not go into AP mode. Yours worked OK, and could be configured using its AP.

ruedli commented 2 years ago

just trying to debug it:

When I just use the arrows to move it, I see how the relays respond. Relay1 is indicating movement (like power), and relay 2 indicates its direction. Is this how you interpret shutter movement as well?

Further using the arrow buttons the "slider" is NOT updated (this seems a Tasmota thing for the shutter functionality).

When moving "open" two commands are sent, no command for stopping. When moving "close" only one command is sent, no command for stopping.

maybe my shutter config is wrong? How would you expect the relays to behave in your script?

Are you seeing the slider postion reflecting the position of your screen? Can you set the positions with the sliders?

ruedli commented 2 years ago

log for "open"

16:19:47.822 MQT: stat/somfy/RESULT = {"POWER2":"ON"} 16:19:47.827 MQT: stat/somfy/POWER2 = ON 16:19:47.938 MQT: stat/somfy/RESULT = {"POWER1":"ON"} 16:19:47.943 MQT: stat/somfy/POWER1 = ON 16:19:47.950 MQT: stat/somfy/RESULT = {"Position1":0} 16:19:48.746 MQT: stat/somfy/RESULT = {"IRSend":"Done"} 16:19:49.597 MQT: stat/somfy/RESULT = {"IRSend":"Done"} 16:19:49.714 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":96,"Direction":-1,"Target":0,"Tilt":0}} 16:19:49.826 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":96,"Direction":-1,"Target":0,"Tilt":0}} 16:19:49.972 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":96,"Direction":-1,"Target":0,"Tilt":0}} 16:19:50.896 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":93,"Direction":-1,"Target":0,"Tilt":0}} 16:19:51.927 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":91,"Direction":-1,"Target":0,"Tilt":0}} 16:19:52.937 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":89,"Direction":-1,"Target":0,"Tilt":0}} 16:19:53.915 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":87,"Direction":-1,"Target":0,"Tilt":0}} 16:19:54.891 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":85,"Direction":-1,"Target":0,"Tilt":0}} 16:19:55.948 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":82,"Direction":-1,"Target":0,"Tilt":0}} 16:19:56.921 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":80,"Direction":-1,"Target":0,"Tilt":0}} 16:19:57.903 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":78,"Direction":-1,"Target":0,"Tilt":0}} 16:19:58.932 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":75,"Direction":-1,"Target":0,"Tilt":0}} 16:19:59.905 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":73,"Direction":-1,"Target":0,"Tilt":0}} 16:20:00.931 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":71,"Direction":-1,"Target":0,"Tilt":0}} 16:20:01.932 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":69,"Direction":-1,"Target":0,"Tilt":0}} 16:20:02.909 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":66,"Direction":-1,"Target":0,"Tilt":0}} 16:20:03.912 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":64,"Direction":-1,"Target":0,"Tilt":0}} 16:20:04.942 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":62,"Direction":-1,"Target":0,"Tilt":0}} 16:20:05.898 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":60,"Direction":-1,"Target":0,"Tilt":0}} 16:20:06.925 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":57,"Direction":-1,"Target":0,"Tilt":0}} 16:20:07.931 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":55,"Direction":-1,"Target":0,"Tilt":0}} 16:20:08.885 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":53,"Direction":-1,"Target":0,"Tilt":0}} 16:20:09.908 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":50,"Direction":-1,"Target":0,"Tilt":0}} 16:20:10.970 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":48,"Direction":-1,"Target":0,"Tilt":0}} 16:20:11.895 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":46,"Direction":-1,"Target":0,"Tilt":0}} 16:20:12.920 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":44,"Direction":-1,"Target":0,"Tilt":0}} 16:20:13.979 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":41,"Direction":-1,"Target":0,"Tilt":0}} 16:20:14.906 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":39,"Direction":-1,"Target":0,"Tilt":0}} 16:20:15.910 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":37,"Direction":-1,"Target":0,"Tilt":0}} 16:20:16.938 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":35,"Direction":-1,"Target":0,"Tilt":0}} 16:20:17.911 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":32,"Direction":-1,"Target":0,"Tilt":0}} 16:20:18.883 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":30,"Direction":-1,"Target":0,"Tilt":0}} 16:20:19.939 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":28,"Direction":-1,"Target":0,"Tilt":0}} 16:20:20.915 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":26,"Direction":-1,"Target":0,"Tilt":0}} 16:20:21.890 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":23,"Direction":-1,"Target":0,"Tilt":0}} 16:20:22.953 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":21,"Direction":-1,"Target":0,"Tilt":0}} 16:20:23.877 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":19,"Direction":-1,"Target":0,"Tilt":0}} 16:20:24.903 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":17,"Direction":-1,"Target":0,"Tilt":0}} 16:20:25.962 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":14,"Direction":-1,"Target":0,"Tilt":0}} 16:20:26.890 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":12,"Direction":-1,"Target":0,"Tilt":0}} 16:20:27.919 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":10,"Direction":-1,"Target":0,"Tilt":0}} 16:20:28.928 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":7,"Direction":-1,"Target":0,"Tilt":0}} 16:20:29.908 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":5,"Direction":-1,"Target":0,"Tilt":0}} 16:20:30.886 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":3,"Direction":-1,"Target":0,"Tilt":0}} 16:20:31.945 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":1,"Direction":-1,"Target":0,"Tilt":0}} 16:20:32.267 MQT: stat/somfy/RESULT = {"POWER1":"OFF"} 16:20:32.271 MQT: stat/somfy/POWER1 = OFF 16:20:32.282 MQT: stat/somfy/RESULT = {"POWER2":"OFF"} 16:20:32.285 MQT: stat/somfy/POWER2 = OFF 16:20:32.795 MQT: stat/somfy/SHUTTER1 = 0 16:20:32.800 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":0,"Direction":0,"Target":0,"Tilt":0}}

log for "close"

16:21:32.765 MQT: stat/somfy/RESULT = {"POWER2":"OFF"} 16:21:32.770 MQT: stat/somfy/POWER2 = OFF 16:21:32.882 MQT: stat/somfy/RESULT = {"POWER1":"ON"} 16:21:32.887 MQT: stat/somfy/POWER1 = ON 16:21:32.895 MQT: stat/somfy/RESULT = {"Position1":100} 16:21:33.690 MQT: stat/somfy/RESULT = {"IRSend":"Done"} 16:21:33.828 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":2,"Direction":1,"Target":100,"Tilt":0}} 16:21:33.944 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":2,"Direction":1,"Target":100,"Tilt":0}} 16:21:34.950 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":5,"Direction":1,"Target":100,"Tilt":0}} 16:21:35.888 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":7,"Direction":1,"Target":100,"Tilt":0}} 16:21:36.918 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":9,"Direction":1,"Target":100,"Tilt":0}} 16:21:37.976 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":12,"Direction":1,"Target":100,"Tilt":0}} 16:21:38.901 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":14,"Direction":1,"Target":100,"Tilt":0}} 16:21:39.880 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":16,"Direction":1,"Target":100,"Tilt":0}} 16:21:40.954 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":19,"Direction":1,"Target":100,"Tilt":0}} 16:21:41.879 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":21,"Direction":1,"Target":100,"Tilt":0}} 16:21:42.907 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":23,"Direction":1,"Target":100,"Tilt":0}} 16:21:43.963 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":26,"Direction":1,"Target":100,"Tilt":0}} 16:21:44.883 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":28,"Direction":1,"Target":100,"Tilt":0}} 16:21:45.913 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":30,"Direction":1,"Target":100,"Tilt":0}} 16:21:46.888 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":32,"Direction":1,"Target":100,"Tilt":0}} 16:21:47.893 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":35,"Direction":1,"Target":100,"Tilt":0}} 16:21:48.919 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":37,"Direction":1,"Target":100,"Tilt":0}} 16:21:49.891 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":39,"Direction":1,"Target":100,"Tilt":0}} 16:21:50.925 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":42,"Direction":1,"Target":100,"Tilt":0}} 16:21:51.903 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":44,"Direction":1,"Target":100,"Tilt":0}} 16:21:52.880 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":46,"Direction":1,"Target":100,"Tilt":0}} 16:21:53.887 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":48,"Direction":1,"Target":100,"Tilt":0}} 16:21:54.918 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":51,"Direction":1,"Target":100,"Tilt":0}} 16:21:55.977 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":53,"Direction":1,"Target":100,"Tilt":0}} 16:21:56.900 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":56,"Direction":1,"Target":100,"Tilt":0}} 16:21:57.927 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":58,"Direction":1,"Target":100,"Tilt":0}} 16:21:58.958 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":60,"Direction":1,"Target":100,"Tilt":0}} 16:21:59.879 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":62,"Direction":1,"Target":100,"Tilt":0}} 16:22:00.957 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":65,"Direction":1,"Target":100,"Tilt":0}} 16:22:01.880 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":67,"Direction":1,"Target":100,"Tilt":0}} 16:22:02.914 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":69,"Direction":1,"Target":100,"Tilt":0}} 16:22:03.926 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":72,"Direction":1,"Target":100,"Tilt":0}} 16:22:04.948 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":74,"Direction":1,"Target":100,"Tilt":0}} 16:22:05.884 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":76,"Direction":1,"Target":100,"Tilt":0}} 16:22:06.912 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":79,"Direction":1,"Target":100,"Tilt":0}} 16:22:07.886 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":81,"Direction":1,"Target":100,"Tilt":0}} 16:22:08.917 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":83,"Direction":1,"Target":100,"Tilt":0}} 16:22:09.894 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":86,"Direction":1,"Target":100,"Tilt":0}} 16:22:10.947 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":88,"Direction":1,"Target":100,"Tilt":0}} 16:22:11.877 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":90,"Direction":1,"Target":100,"Tilt":0}} 16:22:12.902 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":93,"Direction":1,"Target":100,"Tilt":0}} 16:22:13.975 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":95,"Direction":1,"Target":100,"Tilt":0}} 16:22:14.899 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":97,"Direction":1,"Target":100,"Tilt":0}} 16:22:15.927 MQT: stat/somfy/RESULT = {"Shutter1":{"Position":100,"Direction":1,"Target":100,"Tilt":0}} 16:22:16.111 MQT: stat/somfy/RESULT = {"POWER1":"OFF"} 16:22:16.116 MQT: stat/somfy/POWER1 = OFF 16:22:16.625 MQT: stat/somfy/SHUTTER1 = 100

andrew01144 commented 2 years ago

I have not tested this bit extensively, so there may be problems.

Relay1 is indicating movement (like power), and relay 2 indicates its direction.

That looks wrong. That is as if "ShutterMode1 2", when it should be "ShutterMode1 1". Should be one relay for each direction. What does "shuttermode" tell you?

ruedli commented 2 years ago

What does "shuttermode" tell you?

I do not know... As I immediately gave it a ShutterMode1 1 command, which...... FIXED all my issues... !!! Yesss...

<<edited to include the answer with my (now deleted) question)>>

Thanks for all your help, at least we know now that it can relatively easily be reproduced with the CC1101. I like the functionality a lot, however your implementation is not for the faint-hearted, not being able to rely on a SPI library... I configured all the SPI pins in Tasmota (module settings), with this part:

    SCK_PIN  = gpio.pin(gpio.SPI_CLK)
    MISO_PIN = gpio.pin(gpio.SPI_MISO)
    MOSI_PIN = gpio.pin(gpio.SPI_MOSI)
    CS_PIN   = gpio.pin(gpio.SPI_CS)

Settings matching the Berry script, as shown below work OK.

08-10-2022 18-14-53

andrew01144 commented 2 years ago

if I configure all the SPI pins in Tasmota (module settings)

Yes, that should work. I briefly tested it. Download the latest RFtxSMFY_CC1101.be. You should see "var SCK_PIN = -1" etc. Then you just need to set the "if true" and "if false" blocks to get the block you want. I should probably remove the two hard-coded blocks and just rely on the configurable block, now.

ruedli commented 2 years ago

Yes, have that working now as well. In my unsuccessful attempt I used SSPI instead of SPI in the pulldowns...

Settings matching the Berry script, as attached with the previous comment work OK.

andrew01144 commented 2 years ago

BTW: If you ever find this to be unreliable, I suggest you add the RC filter between the ESP and the CC1101, and post a comment back here.

The top trace is the IRsend out from the ESP. The lower trace is as received by an RXB14 that I had to hand. The FS1000A filters out the glitches, but the CC1101 transmits some of them. As far as I (and you) can tell, the Somfy filters them out, but there may be some problem there yet to be discovered. image

ruedli commented 2 years ago

BTW: If you ever find this to be unreliable, I suggest you add the RC filter between the ESP and the CC1101, and post a comment back here.

Were these glitches also in the signal in the SimpleSomfy.ino file, using the ElecHouse library and the Somfylib? Or are they the result of generating a Somfy signal with the Berry script?

andrew01144 commented 2 years ago

The glitches are the result of using IRsend to generate the Somfy signal.

I plan to write a little explanation of this, but, in brief:

Your SimpleSomfy.ino does not have this problem, but (I believe) it has the problem of long timing loops that violates the Tasmota programming standards.

ruedli commented 2 years ago

Yes, the timing issue in the Tasmota loop was the trigger to my first comment, as I was surprised to see a Tasmota solution generating and sending out the pulse train. I guess with this trick you off-load the timing issues to a separate processing in IRsend. pity they are not nicely glued together, but as you say, the somfy seems not to care. If you can modulate and influence the shape of the multiplier to be a constant (now it is a block), the modulation.is not a problem

darenkeates commented 2 years ago

Many thanks. I will follow that advice. I just need to get my head round mqtt. I’ll report back thanks.

Regards

Daren Keates MSc Principal Project Engineer - New Technology

Siemens Mobility Limited

Station Approach, Swanley, Kent, BR8 8JD, UK. Mobile: +44 (0) 7921 247 011<tel:+44%207921%20247%20011> E @.**@.>

On 7 Oct 2022, at 17:52, andrew01144 @.***> wrote:



@darenkeateshttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdarenkeates&data=05%7C01%7Cdaren.m.keates%40siemens.com%7Cf4a8e425a7064d2f075408daa8844008%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C638007583216580680%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=R92Mic%2Brr4x5MlbaTD4mJKYgBiDjJUqcyr8DQodAht0%3D&reserved=0 Baby steps is always my advice. Install Tasmota on one of your ESP8266s and try to get Hubitat to control its LED via mqtt (or you can use http). If that works, then progress to Shutters and Blinds. Let me/us know if you need any help. Good luck!

FYI: Changing the crystal on the FS1000A was surprisingly easy (search eBay for "433 SAW"), vs the CC1101 needs 4 additional wires from the ESP. Which solution you prefer is a personal matter.

— Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fandrew01144%2FTasmota-SomfyRTS%2Fissues%2F2%23issuecomment-1271825011&data=05%7C01%7Cdaren.m.keates%40siemens.com%7Cf4a8e425a7064d2f075408daa8844008%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C638007583216736892%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NQCJfYSH6pxsS8Z1CKm3Pj9c73%2BvQopUJ5wW2QLqn70%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAH7JPF7VG5PFUITUZZ6KRITWCBIK3ANCNFSM6AAAAAAQO3SLME&data=05%7C01%7Cdaren.m.keates%40siemens.com%7Cf4a8e425a7064d2f075408daa8844008%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C638007583216736892%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8DO9FD4jeqjY2NC1m3yP7utrZ0zxUmS6ZtkRzQ3vlgI%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

andrew01144 commented 2 years ago

FYI - CC1101 support is no longer in a separate script. I renamed RFtxSMFY_CC1101.be to RFtxSMFY.be. If you need CC1101 support, you need to enable it in the first few lines of the script. Also, it no longer has hard-coded SPI pins; you need to Configure them in Tasmota. I have updated README.md quite a bit, but that still needs more work.

darenkeates commented 2 years ago

What you guys have done over such a short period is amazing. I have received my ESP32 and connected up the CC1101 by following your amazing instructions but I have hit a problem, probably my misunderstanding.

The part of the instruction that says:

Regards

Daren Keates MSc Principal Project Engineer - New Technology

Siemens Mobility Limited Station Approach, Swanley, Kent, BR8 8JD, UK. Mobile: +44 (0) 7921 247 011 Email: @.**@.> @.***

From: andrew01144 @.> Sent: 09 October 2022 10:13 To: andrew01144/Tasmota-SomfyRTS @.> Cc: Keates, Daren (SMO UKI RC-GB RI PE DE ECDP 1) @.>; Mention @.> Subject: Re: [andrew01144/Tasmota-SomfyRTS] Using a CC1101 for easily transmitting 433.42 MHz signals (Issue #2)

FYI - CC1101 support is no longer in a separate script. I renamed RFtxSMFY_CC1101.be to RFtxSMFY.be. If you need CC1101 support, you need to enable it in the first few lines of the script. Also, it no longer has hard-coded SPI pins; you need to Configure them in Tasmota. I have updated README.md quite a bit, but that still needs more work.

- Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fandrew01144%2FTasmota-SomfyRTS%2Fissues%2F2%23issuecomment-1272495983&data=05%7C01%7Cdaren.m.keates%40siemens.com%7C749ddd2cc22d4494e15a08daa9d67fa9%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C638009035973165462%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Y9ce6rdTPbwBNm074eyvtWhWrbYn33Q4UU8bsxYoq4k%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAH7JPFY4U6RC4BPEZTJJWWLWCKECVANCNFSM6AAAAAAQO3SLME&data=05%7C01%7Cdaren.m.keates%40siemens.com%7C749ddd2cc22d4494e15a08daa9d67fa9%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C638009035973165462%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=D%2FPHkekNGHUD7VW8OnAjdi08npdVRtzK5togZTwHd2M%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.**@.>>

andrew01144 commented 2 years ago

Two things:

1) That RFtxSMFY is unknown, means the Berry script has not successfully loaded. That might be because I did a lot of tidying up today. If you download autoexec.be and RFtxSMFY.be from github now, then upload them to your Tasmota, all should be good. You will see that autoexec.be just loads() RFtxSMFY.be. Previously, I had the CC1101 support in a separate RFtxSMFY_CC1101.be file, but that's gone now. See also https://github.com/andrew01144/Tasmota-SomfyRTS/blob/main/README.md#using-a-cc1101 - you will need to edit the file to enable CC1101.

2) The system does not know the code of the blind. It works the other way around. You tell the blind to learn the code of a new controller.

ruedli commented 2 years ago

@darenkeates

  • Execute this Tasmota command: RFtxSMFY {"Idx":1,"Id":123,"RollingCode":1} This part does not word and reports unknown command, I guess this is where the problem lies but the bit I don't understand is how the system knows the code of any particular blind? Does it not have to learn the rf code before it can transmit it? Have I missed a step?

Hope you have it working now, to help you understanding, I also provide some info.

setting up a remote within the ESP32 (you can have multiple) is done with the commands described in te README of this project. In short, the first command sets up a remote with an internal Id (123 in this example), then sending RFtxSMFY with button= 1,2,4,8 acts as if the ESP32 presses stop,up,down,prog for this remote respectively.

You can link n remotes to m sunshades. They do not need to be 1:1.

hope this helps, the readme is quite good, once you understand what needs to be accomplished.

ruedli commented 2 years ago

@andrew01144 Just an observation, have you also put functionality in your script to do a long press prog? In my program I just repeat the prog button for 3 seconds or so, which you use to unlearn a remote.

andrew01144 commented 2 years ago

@ruedli Yes, long press is supported, and I added it to the README earlier today. I have made quite a few changes/additions to the README; it would be great if you could look it over and tell me if anything is wrong, misleading or missing.

darenkeates commented 2 years ago

I haven’t got to that bit yet but what script do I need? Apologies if it’s in the readme, I’ll refresh myself tomorrow.

Regards

Daren Keates MSc Principal Project Engineer - New Technology

Siemens Mobility Limited

Station Approach, Swanley, Kent, BR8 8JD, UK. Mobile: +44 (0) 7921 247 011<tel:+44%207921%20247%20011> E @.**@.>

On 9 Oct 2022, at 20:31, Ruud Rademaker @.***> wrote:



Just an observation, have you also put functionality in your script to do a long press prog? In my program I just repeat the prog button for 3 seconds or so, which you use to unlearn a remote.

— Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fandrew01144%2FTasmota-SomfyRTS%2Fissues%2F2%23issuecomment-1272612861&data=05%7C01%7Cdaren.m.keates%40siemens.com%7Ce3c7affe9e1247f60bc608daaa2ceb39%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C638009407147591204%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8GHR7%2BK%2BBEkdrATm5Hl6%2BUJ3Q5aEodE9%2FHZRuZEmack%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAH7JPF7NDJUHQHMVIFDVSM3WCMMSPANCNFSM6AAAAAAQO3SLME&data=05%7C01%7Cdaren.m.keates%40siemens.com%7Ce3c7affe9e1247f60bc608daaa2ceb39%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C638009407147591204%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4DuyzjJrhj%2FRaKh%2BkoE1J8c%2BK%2BQih9W6A6DrlFKI1Cc%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>