Skip to content

Commit

Permalink
Merge branch 'group'
Browse files Browse the repository at this point in the history
  • Loading branch information
dewenni committed Dec 24, 2024
2 parents e1a3dea + 53ca1b4 commit 7fad5a1
Show file tree
Hide file tree
Showing 33 changed files with 1,232 additions and 125 deletions.
Binary file modified Doc/ESP32_Jarolift_Controller_social.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/webUI_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/webUI_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 76 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@ Controlling Jarolift(TM) TDEF 433MHz radio shutters via **ESP32** and **CC1101**

## Features

- Web-based User Interface (WebUI):
- **Web-based User Interface (WebUI):**
A modern, mobile-friendly interface for easy configuration and control.

- MQTT Support:
- **MQTT Support:**
Communication and control of devices are handled via MQTT, a lightweight and reliable messaging protocol.

- HomeAssistant Integration:
- **HomeAssistant Integration:**
Automatic device discovery in HomeAssistant through MQTT Auto Discovery for seamless integration.

- Support for up to 16 Roller Shutters:
- **Support for up to 16 Roller Shutters:**
Control up to 16 roller shutters with ease, all managed through the WebUI and MQTT.

- **Support for up to 6 Roller Shutter Groups:**
define shutter groups to control several shutters at once

Experimental version.
Use at your own risk. For private/educational use only. (Keeloq algorithm licensed only to TI Microcontrollers)
This project is not affiliated in any way with the vendor of the Jarolift components.
Expand Down Expand Up @@ -237,6 +240,12 @@ Here you can configure the GPIO to connect the CC1101 to the ESP32
- **Jarolift**
here you have to configure some Jarolift specific protocol settings

- **Shutter**
here you can configure each shutter with individual name

- **Group**
here you can define optional shutter-groups

- **Language**
There are two languages available. Choose what you prefer.
The language take effect on the webUI and also on the mqtt messages!
Expand Down Expand Up @@ -309,7 +318,9 @@ Topic: ESP32-Jarolift-Controller/wifi = {

## Commands

To control the shutters yu can use the following mqtt commands.
### Shutter

To control the shutters you can use the following mqtt commands.
{UP, OPEN, 0} means, that you can use one of the listed payload commands.

```text
Expand All @@ -335,6 +346,66 @@ payload: {SHADE, 3}
```

### predefined Group

To control shutters a group you can use the following mqtt commands.
{UP, OPEN, 0} means, that you can use one of the listed payload commands.

```text
command: group up
topic: ../cmd/group/1 ... cmd/group/6
payload: {UP, OPEN, 0}
command: group down
topic: ../cmd/group/1 ... cmd/group/6
payload: {DOWN, CLOSE, 1}
command: group stop
topic: ../cmd/group/1 ... cmd/group/6
payload: {STOP, 2}
command: group shade
topic: ../cmd/group/1 ... cmd/group/6
payload: {SHADE, 3}
```

### Group with bitmask

You can also use a generic group command and provide the bitmask to select the shutters directly.
The bitmask is a 16-bit number, with the least significant bit (on the right) representing channel 1.
A set bit means that the channel belongs to this group.

**Example**: `0000000000010101` means that channels 1, 3, and 5 belong to this group.

As payload, you can use three different formats to represent the same bitmask:

- **Binary**: `0b0000000000010101`
- **Hex**: `0x15`
- **Decimal**: `21`

```text
command: group up
topic: ../cmd/group/up
payload: {0b0000000000010101, 0x15, 21}
command: group down
topic: ../cmd/group/down
payload: {0b0000000000010101, 0x15, 21}
command: group stop
topic: ../cmd/group/stop
payload: {0b0000000000010101, 0x15, 21}
command: group shade
topic: ../cmd/group/shade
payload: {0b0000000000010101, 0x15, 21}
```


> [!NOTE]
> < ../ > is the placeholder for the MQTT topic which is specified in the settings.
Expand Down
81 changes: 70 additions & 11 deletions changeNew.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,77 @@
# v1.2.0
# v1.3.0

## what's new

Implemented a command queue for incomming mqtt messages and also for the CC1101 commands.
Commands are now buffered and processed sequentially to prevent timing issues during transmission.
This release brings group support for roller shutters. It is now possible to predefine up to 6 shutter groups. These groups can then be controlled with a command via the WebUI, MQTT or Home Assistant.
It is also possible to use a generic MQTT command to specify the selection of roller shutters for a group directly as a bitmask

this project is still in an early phase.
If you like this project, feel free to push the **[Star ⭐️]** button and click **[Watch 👁]** to stay updated.
If there is any bug, please use the Issue function and let me know.
If you have any further questions, suggestions or requests, please use the discussion function.
### predefined Group

To control shutters a group you can use the following mqtt commands.
{UP, OPEN, 0} means, that you can use one of the listed payload commands.

```text
command: group up
topic: ../cmd/group/1 ... cmd/group/6
payload: {UP, OPEN, 0}
command: group down
topic: ../cmd/group/1 ... cmd/group/6
payload: {DOWN, CLOSE, 1}
command: group stop
topic: ../cmd/group/1 ... cmd/group/6
payload: {STOP, 2}
command: group shade
topic: ../cmd/group/1 ... cmd/group/6
payload: {SHADE, 3}
```

### Group with bitmask

You can also use a generic group command and provide the bitmask to select the shutters directly.
The bitmask is a 16-bit number, with the least significant bit (on the right) representing channel 1.
A set bit means that the channel belongs to this group.

**Example**: `0000000000010101` means that channels 1, 3, and 5 belong to this group.

As payload, you can use three different formats to represent the same bitmask:

- **Binary**: `0b0000000000010101`
- **Hex**: `0x15`
- **Decimal**: `21`

```text
command: group up
topic: ../cmd/group/up
payload: {0b0000000000010101, 0x15, 21}
command: group down
topic: ../cmd/group/down
payload: {0b0000000000010101, 0x15, 21}
command: group stop
topic: ../cmd/group/stop
payload: {0b0000000000010101, 0x15, 21}
command: group shade
topic: ../cmd/group/shade
payload: {0b0000000000010101, 0x15, 21}
```

> [!NOTE]
> this project is still in an early phase.
> If you like this project, feel free to push the **[Star ⭐️]** button and click **[Watch 👁]** to stay updated.
> If there is any bug, please use the Issue function and let me know.
> If you have any further questions, suggestions or requests, please use the discussion function.
## changelog

- fix missing SW-Version in MQTT-SysInfo and Home Assistant
- Implemented a command queue for incoming mqtt messages. #5
- Implemented a command queue for CC1101 to handle rapid consecutive commands to prevent timing issues during transmission. #5
- update to Arduino core 3.1.0 based on IDF 5.3.2.241210
- [FEATURE] highlight active page in the sidebar navigation
- [FEATURE] Implement Group Commands #6
- [FEATURE] HASS: ignore cover state (use optimistic=true) #8
21 changes: 21 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
**Changelog**

# v1.2.0

## what's new

Implemented a command queue for incomming mqtt messages and also for the CC1101 commands.
Commands are now buffered and processed sequentially to prevent timing issues during transmission.

this project is still in an early phase.
If you like this project, feel free to push the **[Star ⭐️]** button and click **[Watch 👁]** to stay updated.
If there is any bug, please use the Issue function and let me know.
If you have any further questions, suggestions or requests, please use the discussion function.

## changelog

- fix missing SW-Version in MQTT-SysInfo and Home Assistant
- Implemented a command queue for incoming mqtt messages. #5
- Implemented a command queue for CC1101 to handle rapid consecutive commands to prevent timing issues during transmission. #5
- update to Arduino core 3.1.0 based on IDF 5.3.2.241210

---

# v1.1.1

## what's new
Expand Down
5 changes: 4 additions & 1 deletion include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/*-------------------------------------------------------------------------------
General Configuration
--------------------------------------------------------------------------------*/
#define VERSION "v1.2.0" // internal program version
#define VERSION "v1.3.0" // internal program version

#define WIFI_RECONNECT 30000 // Delay between wifi reconnection tries
#define MQTT_RECONNECT 10000 // Delay between mqtt reconnection tries
Expand All @@ -16,6 +16,9 @@ struct s_cfg_jaro {
uint32_t serial;
char ch_name[16][64]{"\0"};
bool ch_enable[16];
char grp_name[6][64]{"\0"};
bool grp_enable[6];
uint16_t grp_mask[6];
};

struct s_cfg_wifi {
Expand Down
4 changes: 2 additions & 2 deletions include/gzip_css.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions include/gzip_js.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/gzip_login_html.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const uint8_t PROGMEM gzip_login_html[] = {0x1f, 0x8b, 0x08, 0x00, 0xdc, 0x7a, 0x66, 0x67, 0x02, 0xff, 0x75, 0x53, 0xb1, 0x92, 0xd4, 0x30, 0x0c, 0xed, 0xef, 0x2b, 0x84, 0x5b, 0xc8, 0xe6, 0x38, 0x1a, 0x8a, 0x64, 0x1b, 0x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x7f, 0x7a, 0x68, 0x06, 0x66, 0x67, 0xe7, 0xc2, 0x71, 0x68, 0x7a, 0x9d, 0xa6, 0x9e, 0xbd, 0xca, 0xdc, 0xc6, 0xb0, 0x72, 0x72, 0xec, 0xef, 0x32, 0xca, 0xab, 0x6d, 0x54, 0x65, 0x5e, 0x58, 0x5e, 0x68, 0xde, 0x63, 0xda, 0xc5, 0xe5, 0xbb, 0xfd, 0x01, 0x84, 0x40, 0xe8, 0x4e, 0x7f, 0x03, 0x00, 0x00};
const uint8_t PROGMEM gzip_login_html[] = {0x1f, 0x8b, 0x08, 0x00, 0x4e, 0x78, 0x6a, 0x67, 0x02, 0xff, 0x75, 0x53, 0xb1, 0x92, 0xd4, 0x30, 0x0c, 0xed, 0xef, 0x2b, 0x84, 0x5b, 0xc8, 0xe6, 0x38, 0x1a, 0x8a, 0x64, 0x1b, 0xb8, 0x2b, 0x18, 0x66, 0xd8, 0x19, 0x8e, 0x82, 0x52, 0x89, 0xb5, 0xb1, 0xe7, 0x1c, 0xdb, 0xd8, 0xca, 0xee, 0x85, 0xaf, 0xc7, 0x59, 0x27, 0x24, 0x3b, 0x2c, 0x95, 0xe5, 0xf7, 0xe4, 0x27, 0xe9, 0x69, 0x5c, 0xbd, 0xf9, 0xfc, 0xed, 0xd3, 0xf3, 0xcf, 0xc3, 0x23, 0x28, 0xee, 0xcd, 0xfe, 0xae, 0x9a, 0x0e, 0x30, 0x68, 0xbb, 0x5a, 0x90, 0x15, 0x20, 0x75, 0xa8, 0x85, 0xe1, 0x90, 0x22, 0x64, 0x2c, 0x58, 0x51, 0x4f, 0xb5, 0x90, 0x18, 0x5e, 0xc4, 0xfe, 0x0e, 0xa0, 0x52, 0x84, 0x72, 0x0a, 0x52, 0xd8, 0x13, 0x23, 0xb4, 0x0a, 0x43, 0x24, 0xae, 0xc5, 0x8f, 0xe7, 0xa7, 0xe2, 0xa3, 0x80, 0x72, 0x4b, 0x5a, 0x9c, 0x1e, 0xa3, 0xf7, 0x86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 0x5d, 0xa7, 0x6d, 0x55, 0xfa, 0x0d, 0x77, 0x74, 0xa1, 0x07, 0x6c, 0x59, 0x3b, 0x9b, 0x3c, 0x34, 0x53, 0x82, 0x80, 0x34, 0x96, 0x72, 0xb2, 0x16, 0xde, 0x45, 0x16, 0x6b, 0x72, 0x4a, 0xd7, 0xd6, 0x0f, 0xbc, 0xb1, 0x47, 0xcc, 0xd3, 0x0f, 0x91, 0xc2, 0x14, 0x09, 0xf0, 0x06, 0x5b, 0x52, 0xce, 0x48, 0x0a, 0x19, 0x86, 0x8c, 0x07, 0xfa, 0x35, 0xe8, 0x40, 0x72, 0xf1, 0x6e, 0x2b, 0xb8, 0x01, 0x60, 0x16, 0xf7, 0x18, 0xe3, 0xd9, 0x05, 0x29, 0xae, 0xb8, 0x5c, 0xec, 0x36, 0x77, 0x55, 0xf8, 0x76, 0xca, 0x7f, 0x7a, 0x68, 0x06, 0x66, 0x67, 0xe7, 0xc2, 0x71, 0x68, 0x7a, 0x9d, 0xa6, 0x9e, 0xbd, 0xca, 0xdc, 0xc6, 0xb0, 0x72, 0x72, 0xec, 0xef, 0x32, 0xca, 0xab, 0x6d, 0x54, 0x65, 0x5e, 0x58, 0x5e, 0x68, 0xde, 0x63, 0xda, 0xc5, 0xe5, 0xbb, 0xfd, 0x01, 0x84, 0x40, 0xe8, 0x4e, 0x7f, 0x03, 0x00, 0x00};
const unsigned int gzip_login_html_size = 448;
4 changes: 2 additions & 2 deletions include/gzip_m_html.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/gzip_ntp_html.h

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions include/jarolift.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,22 @@ uint16_t jaroGetDevCnt();
void jaroliftSetup();
void jaroliftCyclic();

enum JaroCommandType { CMD_UP, CMD_DOWN, CMD_STOP, CMD_SET_SHADE, CMD_SHADE, CMD_LEARN };
enum JaroCmdType { CMD_UP, CMD_DOWN, CMD_STOP, CMD_SET_SHADE, CMD_SHADE, CMD_LEARN };
enum JaroCmdGrpType { CMD_GRP_UP, CMD_GRP_DOWN, CMD_GRP_STOP, CMD_GRP_SHADE };

struct JaroCommand {
JaroCommandType type;
uint8_t channel;
enum CommandType { SINGLE, GROUP } cmdType;
union {
struct {
JaroCmdType type;
uint8_t channel;
} single;
struct {
JaroCmdGrpType type;
uint16_t group_mask;
} group;
};
};

void jaroCmd(JaroCommandType type, uint8_t channel);
void jaroCmd(JaroCmdType type, uint8_t channel);
void jaroCmd(JaroCmdGrpType type, uint16_t group_mask);
Loading

0 comments on commit 7fad5a1

Please sign in to comment.