├── firmware ├── slzb-06x-bluetooth-1-51.bin ├── slzb-06x-thread_bluetooth-1-51.bin └── slzb-06x-zigbee_bluetooth-1-51.bin ├── assets └── img │ └── zigbee-bluetooth-ha-exposed-config.png ├── README.md └── configs ├── bt.yaml ├── zb-bt.yaml └── th-bt.yaml /firmware/slzb-06x-bluetooth-1-51.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smlight-dev/slzb-06-fw-esphome/HEAD/firmware/slzb-06x-bluetooth-1-51.bin -------------------------------------------------------------------------------- /firmware/slzb-06x-thread_bluetooth-1-51.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smlight-dev/slzb-06-fw-esphome/HEAD/firmware/slzb-06x-thread_bluetooth-1-51.bin -------------------------------------------------------------------------------- /firmware/slzb-06x-zigbee_bluetooth-1-51.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smlight-dev/slzb-06-fw-esphome/HEAD/firmware/slzb-06x-zigbee_bluetooth-1-51.bin -------------------------------------------------------------------------------- /assets/img/zigbee-bluetooth-ha-exposed-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smlight-dev/slzb-06-fw-esphome/HEAD/assets/img/zigbee-bluetooth-ha-exposed-config.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SLZB-06x ESPHome Bluetooth proxy/Zigbee/Thread configs and binaries 2 | 3 | This repository includes YAML config files and compiled binaries of ESPHome-based firmware for SLZB-06x series coordinators. 4 | 5 | These firmware allow users to use ESPHome Bluetooth proxy functionalities, as well as a combination of ESPHome Bluetooth proxy together with Zigbee (via Zigbee2MQTT or ZHA) and Thread/Matter-over-Thread (together with the Thread add-on/integration for Home Assistant). 6 | 7 | ## 1. Supported models 8 | 9 | Firmware fits a series of SLZB-06x coordinators: 10 | | Model | [SLZB-06](https://smlight.tech/product/slzb-06/) | [SLZB-06M](https://smlight.tech/product/slzb-06m/) | [SLZB-06p7](https://smlight.tech/product/slzb-06p7/) | [SLZB-06p10](https://smlight.tech/product/slzb-06p10/) | [SLZB-06p10](https://smlight.tech/product/slzb-06p10/) | [SLZB-06Mg24](https://smlight.tech/product/slzb-06mg24/) | 11 | |---|:---:|:---:|:---:|:---:|:---:|:---:| 12 | |BT Proxy only|Yes|Yes|Yes|Yes|Yes|Yes| 13 | |Zigbee+BT Proxy|Yes|Yes|Yes|Yes|Yes|Yes| 14 | |Thread+BT Proxy|Yes|Yes|Yes|Yes|Yes|Yes| 15 | 16 | ## 2. Firmware types and basic settings 17 | There are 3 ESPHome yaml configs in 'configs' directory: 18 | 1. **bt**: Bluetooth proxy only (in case you do not need a Zigbee or Thread connections). 19 | 2. **zb-bt**: Zigbee+Bluetooth proxy. Settings for Zigbee (Zigbee2MQTT or ZHA): 20 | - baudrate: 115200 21 | - port: 6638 22 | 3. **th-bt**: Thread+Bluetooth proxy. Settings for Thread (Thread integration/add-on): 23 | - baudrate: 460800 24 | - port: 6638 25 | 26 | 27 | ## 3. Integration with Home Assistant 28 | 29 | ![](https://github.com/smlight-dev/slzb-06-fw-esphome/blob/main/assets/img/zigbee-bluetooth-ha-exposed-config.png) 30 | 31 | By default, Home Assistant should automatically discover SLZB-06x flashed with ESPHome, just like any other ESPHome device, and prompt the user to add it to Home Assistant. 32 | 33 | If Home Assistant doesn't autodiscover the ESPHome device on your network, please follow these steps: 34 | - Go to "Settings". 35 | - Go to "Devices & Services". 36 | - Click the button "Add Integration" in the bottom right corner. 37 | - Search for the "ESPHome" integration and add it, using the IP address of your device and the port specified above (default is '6638'). 38 | 39 | 40 | 41 | ## Please Note 42 | Because of the [ESPHome recommendation](https://esphome.io/components/bluetooth_proxy.html), the Web Server component (ESPHome web interface) is disabled by default. 43 | 44 | However, all controls and functionalities are available through the Home Assistant ESPHome integration, as shown in the screenshot above. 45 | 46 | If the user wants to enable the web interface at their own risk, this can be done simply by uncommenting those two lines in the ESPHome config and recompiling the firmware: 47 | *web_server: 48 | port: 80 49 | local: True* 50 | We do not recommend doing that based on the aforementioned notice from ESPHome 51 | -------------------------------------------------------------------------------- /configs/bt.yaml: -------------------------------------------------------------------------------- 1 | # 1. SUBSTITUTIONS (Names to be used in sensor IDs) 2 | substitutions: 3 | name: "slzb-06-bluetooth" 4 | 5 | 6 | # 2. GENERAL ESPHOME CONFIGURATION SETTINGS 7 | 8 | ## Project information 9 | esphome: 10 | name: "${name}" 11 | name_add_mac_suffix: true 12 | project: 13 | name: SMLIGHT.SLZB-06(Bluetooth-only) 14 | version: "1.31" 15 | 16 | ## Board information 17 | esp32: 18 | board: esp32dev 19 | flash_size: 16MB 20 | framework: 21 | type: arduino 22 | 23 | 24 | ## Connection to Home Assistant through API is enabled 25 | api: 26 | 27 | ## Logger is enabled 28 | #logger: 29 | 30 | ## OTA firmware updates are available 31 | ota: 32 | - platform: esphome 33 | ## Accessible portal with control buttons is available 34 | #web_server: 35 | # port: 80 36 | # local: True 37 | 38 | ## WiFi settings 39 | #wifi: 40 | # ssid: !secret wifi_ssid 41 | # password: !secret wifi_password 42 | # 43 | # # Enable fallback hotspot (captive portal) in case wifi connection fails 44 | # ap: 45 | # ssid: "slzb-06 Hotspot" 46 | # password: "slzb06" 47 | 48 | ## Enabling captive portal 49 | # captive_portal: 50 | 51 | 52 | # 3. EXTERNAL COMPONENTS USED 53 | external_components: 54 | - source: github://tube0013/esphome-stream-server-v2 55 | 56 | dashboard_import: 57 | package_import_url: github://smlight-dev/slzb-06-fw-esphome/configs/bt.yaml 58 | 59 | 60 | # 4. COMMUNICATION SETTINGS 61 | ## Ethernet Connection 62 | ethernet: 63 | type: LAN8720 64 | mdc_pin: GPIO23 65 | mdio_pin: GPIO18 66 | clk_mode: GPIO0_IN 67 | phy_addr: 1 68 | power_pin: GPIO16 69 | 70 | ## MDNS service settings 71 | mdns: 72 | services: 73 | - service: "_slzb-06-bluetooth" 74 | protocol: "_tcp" 75 | port: 6638 76 | txt: 77 | version: 1.0 78 | name: SMLIGHT SLZB-06 79 | radio_type: znp 80 | baud_rate: 115200 81 | data_flow_control: software 82 | 83 | 84 | # 5. BLLUETOOTH PROXY COMPONENTS 85 | esp32_ble_tracker: 86 | scan_parameters: 87 | interval: 1100ms 88 | window: 1100ms 89 | active: true 90 | 91 | bluetooth_proxy: 92 | active: true 93 | 94 | #button: 95 | #- platform: safe_mode 96 | # name: Safe Mode Boot 97 | # entity_category: diagnostic 98 | 99 | 100 | # 6. SENSORS 101 | ## Upteime information as sensor 102 | text_sensor: 103 | - platform: template 104 | name: "SLZB-06 Uptime" 105 | lambda: |- 106 | uint32_t dur = id(uptime_s).state; 107 | int dys = 0; 108 | int hrs = 0; 109 | int mnts = 0; 110 | if (dur > 86399) { 111 | dys = trunc(dur / 86400); 112 | dur = dur - (dys * 86400); 113 | } 114 | if (dur > 3599) { 115 | hrs = trunc(dur / 3600); 116 | dur = dur - (hrs * 3600); 117 | } 118 | if (dur > 59) { 119 | mnts = trunc(dur / 60); 120 | dur = dur - (mnts * 60); 121 | } 122 | char buffer[17]; 123 | sprintf(buffer, "%ud %02uh %02um %02us", dys, hrs, mnts, dur); 124 | return {buffer}; 125 | icon: mdi:clock-start 126 | update_interval: 60s 127 | 128 | 129 | ## Uptime generic sensor 130 | sensor: 131 | - platform: uptime 132 | id: uptime_s 133 | update_interval: 60s 134 | 135 | # 7. SWITCHES 136 | ## ESP32 Restart 137 | switch: 138 | - platform: restart 139 | id: coreRestart 140 | name: "Core restart" 141 | 142 | 143 | 144 | 145 | ## Mode LAN/USB switch 146 | - platform: gpio 147 | name: "DEVICE MODE SWITCH (LAN|OFF / USB|ON)" 148 | restore_mode: ALWAYS_OFF 149 | icon: mdi:toggle-switch 150 | internal: true 151 | id: gpio4Select 152 | pin: 153 | number: GPIO4 154 | 155 | ### LEDs swithces 156 | - platform: gpio 157 | name: "LED - device mode (Blue)" 158 | restore_mode: ALWAYS_OFF 159 | internal: true 160 | icon: mdi:toggle-switch 161 | id: gpio12LED1 162 | pin: 163 | number: GPIO12 164 | 165 | - platform: gpio 166 | name: "LED - power (Yellow)" 167 | restore_mode: ALWAYS_ON 168 | icon: mdi:toggle-switch 169 | id: gpio14LED2 170 | pin: 171 | number: GPIO14 -------------------------------------------------------------------------------- /configs/zb-bt.yaml: -------------------------------------------------------------------------------- 1 | # 1. SUBSTITUTIONS (Names to be used in sensor IDs) 2 | substitutions: 3 | name: "slzb-06-zigbee_bluetooth" 4 | 5 | 6 | # 2. GENERAL ESPHOME CONFIGURATION SETTINGS 7 | 8 | ## Project information 9 | esphome: 10 | name: "${name}" 11 | name_add_mac_suffix: true 12 | project: 13 | name: SMLIGHT.SLZB-06*(Zigbee+Bluetooth) 14 | version: "1.51" 15 | on_boot: 16 | priority: 600 17 | then: 18 | - switch.turn_on: zRST_gpio 19 | - delay: 15ms 20 | - switch.turn_off: zRST_gpio 21 | 22 | ## Board information 23 | esp32: 24 | board: esp32dev 25 | flash_size: 16MB 26 | framework: 27 | type: arduino 28 | 29 | ## Connection to Home Assistant through API is enabled 30 | api: 31 | 32 | ## Logger is enabled 33 | #logger: 34 | 35 | ## OTA firmware updates are available 36 | ota: 37 | - platform: esphome 38 | ## Accessible portal with control buttons is available 39 | #web_server: 40 | # port: 80 41 | # local: True 42 | 43 | ## WiFi settings 44 | #wifi: 45 | # ssid: !secret wifi_ssid 46 | # password: !secret wifi_password 47 | # 48 | # # Enable fallback hotspot (captive portal) in case wifi connection fails 49 | # ap: 50 | # ssid: "slzb-06 Hotspot" 51 | # password: "slzb06" 52 | 53 | ## Enabling captive portal 54 | # captive_portal: 55 | 56 | 57 | # 3. EXTERNAL COMPONENTS USED 58 | external_components: 59 | - source: github://tube0013/esphome-stream-server-v2 60 | 61 | dashboard_import: 62 | package_import_url: github://smlight-dev/slzb-06-fw-esphome/configs/zb-bt.yaml 63 | 64 | 65 | # 4. COMMUNICATION SETTINGS 66 | ## Ethernet Connection 67 | ethernet: 68 | type: LAN8720 69 | mdc_pin: GPIO23 70 | mdio_pin: GPIO18 71 | clk_mode: GPIO0_IN 72 | phy_addr: 1 73 | power_pin: GPIO16 74 | 75 | ## UART Settings 76 | uart: 77 | id: uart_bus 78 | rx_pin: GPIO5 79 | tx_pin: GPIO17 80 | baud_rate: 115200 81 | 82 | ## Stream Server 83 | stream_server: 84 | uart_id: uart_bus 85 | id: streamServer 86 | port: 6638 87 | 88 | ## MDNS service settings 89 | mdns: 90 | services: 91 | - service: "_slzb-06" 92 | protocol: "_tcp" 93 | port: 6638 94 | txt: 95 | version: 1.0 96 | name: SMLIGHT SLZB-06 97 | radio_type: znp 98 | baud_rate: 115200 99 | data_flow_control: software 100 | 101 | 102 | # 5. BLLUETOOTH PROXY COMPONENTS 103 | esp32_ble_tracker: 104 | scan_parameters: 105 | interval: 1100ms 106 | window: 1100ms 107 | active: true 108 | 109 | bluetooth_proxy: 110 | active: true 111 | 112 | #button: 113 | #- platform: safe_mode 114 | # name: Safe Mode Boot 115 | # entity_category: diagnostic 116 | 117 | 118 | # 6. SENSORS 119 | ## Upteime information as sensor 120 | text_sensor: 121 | - platform: template 122 | name: "SLZB-06 Uptime" 123 | lambda: |- 124 | uint32_t dur = id(uptime_s).state; 125 | int dys = 0; 126 | int hrs = 0; 127 | int mnts = 0; 128 | if (dur > 86399) { 129 | dys = trunc(dur / 86400); 130 | dur = dur - (dys * 86400); 131 | } 132 | if (dur > 3599) { 133 | hrs = trunc(dur / 3600); 134 | dur = dur - (hrs * 3600); 135 | } 136 | if (dur > 59) { 137 | mnts = trunc(dur / 60); 138 | dur = dur - (mnts * 60); 139 | } 140 | char buffer[17]; 141 | sprintf(buffer, "%ud %02uh %02um %02us", dys, hrs, mnts, dur); 142 | return {buffer}; 143 | icon: mdi:clock-start 144 | update_interval: 60s 145 | 146 | 147 | ## Uptime generic sensor 148 | sensor: 149 | - platform: uptime 150 | id: uptime_s 151 | update_interval: 60s 152 | 153 | ## Status of physical button - sensor 154 | binary_sensor: 155 | - platform: gpio 156 | name: "Physical button status" 157 | icon: mdi:toggle-switch 158 | id: gpio35btn1 159 | pin: 160 | number: GPIO35 161 | mode: 162 | input: true 163 | inverted: yes 164 | on_press: 165 | then: 166 | - switch.toggle: modeSwitchTemplate 167 | - platform: stream_server 168 | stream_server: streamServer 169 | name: "SLZB-06* Serial Connected" 170 | 171 | # 7. SWITCHES 172 | ## ESP32 Restart 173 | switch: 174 | - platform: restart 175 | id: coreRestart 176 | name: "Core only restart" 177 | ## Zigbee Restart 178 | - platform: gpio 179 | pin: 33 180 | id: zRST_gpio 181 | inverted: yes 182 | restore_mode: ALWAYS_OFF 183 | - platform: template 184 | name: "Zigbee Restart" 185 | icon: mdi:toggle-switch 186 | id: zRST 187 | turn_on_action: 188 | - switch.turn_on: zRST_gpio 189 | - delay: 15ms 190 | - switch.turn_off: zRST_gpio 191 | ## Full Restart 192 | - platform: template 193 | name: "Full (Core+Zigbee) Restart" 194 | icon: mdi:toggle-switch 195 | id: fullRST 196 | turn_on_action: 197 | - switch.turn_on: zRST_gpio 198 | - delay: 15ms 199 | - switch.turn_off: zRST_gpio 200 | - delay: 15ms 201 | - switch.turn_on: coreRestart 202 | 203 | ## Zigbee to flash mode switch 204 | - platform: gpio 205 | pin: 32 206 | name: "Zigbee flash Mode internal" 207 | icon: mdi:toggle-switch 208 | id: zBSL 209 | inverted: yes 210 | restore_mode: ALWAYS_OFF 211 | internal: true 212 | 213 | - platform: template 214 | name: "Zigbee flash Mode" 215 | icon: mdi:cellphone-arrow-down 216 | turn_on_action: 217 | - script.execute: fw_update_mode 218 | turn_off_action: 219 | - switch.toggle: zRST 220 | 221 | ## Mode LAN/USB switch 222 | - platform: template 223 | name: "DEVICE MODE SWITCH (LAN|OFF / USB|ON)" 224 | id: modeSwitchTemplate 225 | turn_on_action: 226 | - switch.turn_on: gpio12LED1 227 | - switch.turn_on: gpio4Select 228 | - switch.template.publish: 229 | id: modeSwitchTemplate 230 | state: ON 231 | turn_off_action: 232 | - switch.turn_off: gpio12LED1 233 | - switch.turn_off: gpio4Select 234 | - switch.template.publish: 235 | id: modeSwitchTemplate 236 | state: OFF 237 | 238 | - platform: gpio 239 | name: "DEVICE MODE SWITCH (LAN|OFF / USB|ON)" 240 | restore_mode: ALWAYS_OFF 241 | icon: mdi:toggle-switch 242 | internal: true 243 | id: gpio4Select 244 | pin: 245 | number: GPIO4 246 | 247 | ### LEDs swithces 248 | - platform: gpio 249 | name: "LED - device mode (Blue)" 250 | restore_mode: ALWAYS_OFF 251 | icon: mdi:toggle-switch 252 | id: gpio12LED1 253 | pin: 254 | number: GPIO12 255 | 256 | - platform: gpio 257 | name: "LED - power (Yellow)" 258 | restore_mode: ALWAYS_ON 259 | icon: mdi:toggle-switch 260 | id: gpio14LED2 261 | pin: 262 | number: GPIO14 263 | 264 | # 8. SCRIPTS 265 | script: 266 | - id: fw_update_mode 267 | then: 268 | - switch.turn_on: zBSL 269 | - delay: 1s 270 | - switch.turn_on: zRST_gpio 271 | - delay: 1s 272 | - switch.turn_off: zRST_gpio 273 | - logger.log: "Wait 1 seconds for Zigbee chip to be ready" 274 | - delay: 1s 275 | - switch.turn_off: zBSL 276 | - logger.log: "Update Zigbee with your Z-Stack firmware now!" 277 | 278 | -------------------------------------------------------------------------------- /configs/th-bt.yaml: -------------------------------------------------------------------------------- 1 | # 1. SUBSTITUTIONS (Names to be used in sensor IDs) 2 | substitutions: 3 | name: "slzb-06-thread_bluetooth" 4 | 5 | 6 | # 2. GENERAL ESPHOME CONFIGURATION SETTINGS 7 | 8 | ## Project information 9 | esphome: 10 | name: "${name}" 11 | name_add_mac_suffix: true 12 | project: 13 | name: SMLIGHT.SLZB-06*(Thread+Bluetooth) 14 | version: "1.51" 15 | on_boot: 16 | priority: 600 17 | then: 18 | - switch.turn_on: zRST_gpio 19 | - delay: 15ms 20 | - switch.turn_off: zRST_gpio 21 | 22 | ## Board information 23 | esp32: 24 | board: esp32dev 25 | flash_size: 16MB 26 | framework: 27 | type: arduino 28 | 29 | 30 | ## Connection to Home Assistant through API is enabled 31 | api: 32 | 33 | ## Logger is enabled 34 | #logger: 35 | 36 | ## OTA firmware updates are available 37 | ota: 38 | - platform: esphome 39 | ## Accessible portal with control buttons is available 40 | #web_server: 41 | # port: 80 42 | # local: True 43 | 44 | ## WiFi settings 45 | #wifi: 46 | # ssid: !secret wifi_ssid 47 | # password: !secret wifi_password 48 | # 49 | # # Enable fallback hotspot (captive portal) in case wifi connection fails 50 | # ap: 51 | # ssid: "slzb-06 Hotspot" 52 | # password: "slzb06" 53 | 54 | ## Enabling captive portal 55 | # captive_portal: 56 | 57 | 58 | # 3. EXTERNAL COMPONENTS USED 59 | external_components: 60 | - source: github://tube0013/esphome-stream-server-v2 61 | 62 | dashboard_import: 63 | package_import_url: github://smlight-dev/slzb-06-fw-esphome/configs/th-bt.yaml 64 | 65 | 66 | # 4. COMMUNICATION SETTINGS 67 | ## Ethernet Connection 68 | ethernet: 69 | type: LAN8720 70 | mdc_pin: GPIO23 71 | mdio_pin: GPIO18 72 | clk_mode: GPIO0_IN 73 | phy_addr: 1 74 | power_pin: GPIO16 75 | 76 | ## UART Settings 77 | uart: 78 | id: uart_bus 79 | rx_pin: GPIO5 80 | tx_pin: GPIO17 81 | baud_rate: 460800 82 | 83 | ## Stream Server 84 | stream_server: 85 | uart_id: uart_bus 86 | id: streamServer 87 | port: 6638 88 | 89 | ## MDNS service settings 90 | mdns: 91 | services: 92 | - service: "_slzb-06" 93 | protocol: "_tcp" 94 | port: 6638 95 | txt: 96 | version: 1.0 97 | name: SMLIGHT SLZB-06 98 | radio_type: znp 99 | baud_rate: 115200 100 | data_flow_control: software 101 | 102 | 103 | # 5. BLLUETOOTH PROXY COMPONENTS 104 | esp32_ble_tracker: 105 | scan_parameters: 106 | interval: 1100ms 107 | window: 1100ms 108 | active: true 109 | 110 | bluetooth_proxy: 111 | active: true 112 | 113 | #button: 114 | #- platform: safe_mode 115 | # name: Safe Mode Boot 116 | # entity_category: diagnostic 117 | 118 | 119 | # 6. SENSORS 120 | ## Upteime information as sensor 121 | text_sensor: 122 | - platform: template 123 | name: "SLZB-06 Uptime" 124 | lambda: |- 125 | uint32_t dur = id(uptime_s).state; 126 | int dys = 0; 127 | int hrs = 0; 128 | int mnts = 0; 129 | if (dur > 86399) { 130 | dys = trunc(dur / 86400); 131 | dur = dur - (dys * 86400); 132 | } 133 | if (dur > 3599) { 134 | hrs = trunc(dur / 3600); 135 | dur = dur - (hrs * 3600); 136 | } 137 | if (dur > 59) { 138 | mnts = trunc(dur / 60); 139 | dur = dur - (mnts * 60); 140 | } 141 | char buffer[17]; 142 | sprintf(buffer, "%ud %02uh %02um %02us", dys, hrs, mnts, dur); 143 | return {buffer}; 144 | icon: mdi:clock-start 145 | update_interval: 60s 146 | 147 | 148 | ## Uptime generic sensor 149 | sensor: 150 | - platform: uptime 151 | id: uptime_s 152 | update_interval: 60s 153 | 154 | ## Status of physical button - sensor 155 | binary_sensor: 156 | - platform: gpio 157 | name: "Physical button status" 158 | icon: mdi:toggle-switch 159 | id: gpio35btn1 160 | pin: 161 | number: GPIO35 162 | mode: 163 | input: true 164 | inverted: yes 165 | on_press: 166 | then: 167 | - switch.toggle: modeSwitchTemplate 168 | - platform: stream_server 169 | stream_server: streamServer 170 | name: "SLZB-06* Serial Connected" 171 | 172 | # 7. SWITCHES 173 | ## ESP32 Restart 174 | switch: 175 | - platform: restart 176 | id: coreRestart 177 | name: "Core only restart" 178 | ## Zigbee Restart 179 | - platform: gpio 180 | pin: 33 181 | id: zRST_gpio 182 | inverted: yes 183 | restore_mode: ALWAYS_OFF 184 | - platform: template 185 | name: "Radio Restart" 186 | icon: mdi:toggle-switch 187 | id: zRST 188 | turn_on_action: 189 | - switch.turn_on: zRST_gpio 190 | - delay: 15ms 191 | - switch.turn_off: zRST_gpio 192 | ## Full Restart 193 | - platform: template 194 | name: "Full (Core+Radio) Restart" 195 | icon: mdi:toggle-switch 196 | id: fullRST 197 | turn_on_action: 198 | - switch.turn_on: zRST_gpio 199 | - delay: 15ms 200 | - switch.turn_off: zRST_gpio 201 | - delay: 15ms 202 | - switch.turn_on: coreRestart 203 | 204 | ## Zigbee to flash mode switch 205 | - platform: gpio 206 | pin: 32 207 | name: "Radio flash Mode internal" 208 | icon: mdi:toggle-switch 209 | id: zBSL 210 | inverted: yes 211 | restore_mode: ALWAYS_OFF 212 | internal: true 213 | 214 | - platform: template 215 | name: "Radio flash Mode" 216 | icon: mdi:cellphone-arrow-down 217 | turn_on_action: 218 | - script.execute: fw_update_mode 219 | turn_off_action: 220 | - switch.toggle: zRST 221 | 222 | ## Mode LAN/USB switch 223 | - platform: template 224 | name: "DEVICE MODE SWITCH (LAN|OFF / USB|ON)" 225 | restore_mode: RESTORE_DEFAULT_ON 226 | id: modeSwitchTemplate 227 | turn_on_action: 228 | - switch.turn_on: gpio12LED1 229 | - switch.turn_on: gpio4Select 230 | - switch.template.publish: 231 | id: modeSwitchTemplate 232 | state: ON 233 | turn_off_action: 234 | - switch.turn_off: gpio12LED1 235 | - switch.turn_off: gpio4Select 236 | - switch.template.publish: 237 | id: modeSwitchTemplate 238 | state: OFF 239 | 240 | - platform: gpio 241 | name: "DEVICE MODE SWITCH (LAN|OFF / USB|ON)" 242 | restore_mode: ALWAYS_OFF 243 | icon: mdi:toggle-switch 244 | internal: true 245 | id: gpio4Select 246 | pin: 247 | number: GPIO4 248 | 249 | ### LEDs swithces 250 | - platform: gpio 251 | name: "LED - device mode (Blue)" 252 | restore_mode: ALWAYS_OFF 253 | icon: mdi:toggle-switch 254 | id: gpio12LED1 255 | pin: 256 | number: GPIO12 257 | 258 | - platform: gpio 259 | name: "LED - power (Yellow)" 260 | restore_mode: ALWAYS_ON 261 | icon: mdi:toggle-switch 262 | id: gpio14LED2 263 | pin: 264 | number: GPIO14 265 | 266 | # 8. SCRIPTS 267 | script: 268 | - id: fw_update_mode 269 | then: 270 | - switch.turn_on: zBSL 271 | - delay: 1s 272 | - switch.turn_on: zRST_gpio 273 | - delay: 1s 274 | - switch.turn_off: zRST_gpio 275 | - logger.log: "Wait 1 seconds for Radio chip to be ready" 276 | - delay: 1s 277 | - switch.turn_off: zBSL 278 | - logger.log: "Update Radio chip now!" --------------------------------------------------------------------------------