diff --git a/docs/use/actuators.md b/docs/use/actuators.md index ab45992..4c081cc 100644 --- a/docs/use/actuators.md +++ b/docs/use/actuators.md @@ -102,6 +102,9 @@ The json message must contain two properties: * remote: the index of the remote which is used to send the command (index start at zero) * command: the command which should be send with the remote as string, see [table of command names](https://github.com/Legion2/Somfy_Remote_Lib#available-commands). +Optionally it can contain the following property: +* repeat: the number how often the command is repeated, default 4. Should be used to simulate long button presses, by increasing the repeat number, e.g. 20. + ::: tip The middle button on physical Somfy RTS Remote controls is called "My". ::: diff --git a/main/ZactuatorSomfy.ino b/main/ZactuatorSomfy.ino index 54c7097..5b93144 100644 --- a/main/ZactuatorSomfy.ino +++ b/main/ZactuatorSomfy.ino @@ -67,9 +67,11 @@ void MQTTtoSomfy(char* topicOri, JsonObject& jsonData) { const String commandData = jsonData["command"]; const Command command = getSomfyCommand(commandData); + const int repeat = jsonData["repeat"] | 4; + EEPROMRollingCodeStorage rollingCodeStorage(EEPROM_ADDRESS_START + remoteIndex * 2); SomfyRemote somfyRemote(RF_EMITTER_GPIO, somfyRemotes[remoteIndex], &rollingCodeStorage); - somfyRemote.sendCommand(command); + somfyRemote.sendCommand(command, repeat); # ifdef ZradioCC1101 ELECHOUSE_cc1101.SetRx(receiveMhz); // set Receive on # endif diff --git a/platformio.ini b/platformio.ini index 8d720fc..2eda357 100644 --- a/platformio.ini +++ b/platformio.ini @@ -119,7 +119,7 @@ m5stack = M5Stack@0.3.1 smartrc-cc1101-driver-lib = SmartRC-CC1101-Driver-Lib@2.5.5 stl = https://github.com/mike-matera/ArduinoSTL.git#7411816 shtc3 = https://github.com/sparkfun/SparkFun_SHTC3_Arduino_Library -somfy_remote=Somfy_Remote_Lib@0.2.0 +somfy_remote=Somfy_Remote_Lib@0.3.0 rtl_433_ESP = https://github.com/NorthernMan54/rtl_433_ESP#38ee89a emodbus = miq19/eModbus@1.0.0 gfSunInverter = https://github.com/BlackSmith/GFSunInverter.git#v1.0.1