Save Somfy rolling codes in ESP32 memory

In addition to MQTT - in case we lose MQTT persistence.
This commit is contained in:
2025-01-30 22:05:34 +01:00
parent 84f6c8fe10
commit 2103a411ad
2 changed files with 32 additions and 17 deletions
+6 -1
View File
@@ -24,6 +24,10 @@ globals:
# Can be retrieved from MQTT server. Take the key with lowest integer value
# from /rolling_code/ path.
initial_value: !secret somfy_remote_id_base
- id: somfy_rolling_codes
type: 'int[13]'
initial_value: '{0,0,0,0,0,0,0,0,0,0,0,0,0}'
restore_value: yes
cover:
- platform: custom
@@ -35,7 +39,8 @@ cover:
auto cover = new SomfyRTS(
rfPin,
id(somfy_remote_id_base) + i,
id(mqtt_homeassistant));
id(mqtt_homeassistant),
&(id(somfy_rolling_codes)[i]));
blinds.push_back(cover);
App.register_component(cover);
}