Name the alarm sounds
Replace Sound 1 to 7 with the names identified by ear on this lamp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5c29cdd52f
commit
a355f64d1a
4 files changed
+24
-21
No files matched your search
@@ -8,6 +8,7 @@ ESPHome firmware for a Moes Wake Up Light II (Tuya PID `ya39qahrcdhvxowz`), runn
|
|||||||
- `alarm_block.yaml`: controls for one alarm, included 4 times.
|
- `alarm_block.yaml`: controls for one alarm, included 4 times.
|
||||||
- `alarm_day.yaml`: one weekday switch, included 7 times per alarm.
|
- `alarm_day.yaml`: one weekday switch, included 7 times per alarm.
|
||||||
- `components/uart`: ESPHome 2026.10.2's UART component with `patches/wbr3-pa13-pa14-uart.patch` applied. Recheck it when ESPHome updates.
|
- `components/uart`: ESPHome 2026.10.2's UART component with `patches/wbr3-pa13-pa14-uart.patch` applied. Recheck it when ESPHome updates.
|
||||||
|
|
||||||
- `server-example.yaml`: the short YAML that goes on an ESPHome server.
|
- `server-example.yaml`: the short YAML that goes on an ESPHome server.
|
||||||
- `secrets.yaml`: local only, ignored by git. Needs `wifi_ssid`, `wifi_password`, `ap_password`, `api_encryption_key`.
|
- `secrets.yaml`: local only, ignored by git. Needs `wifi_ssid`, `wifi_password`, `ap_password`, `api_encryption_key`.
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ From Tuya's definition for a sibling product (tuya-local issue #3821). See the R
|
|||||||
- Byte 11: above 1 becomes 1.
|
- Byte 11: above 1 becomes 1.
|
||||||
- Byte 4 is the ring length in minutes: set to 10, a ring ran from 18:16 to 18:26 and the owner saw it stop.
|
- Byte 4 is the ring length in minutes: set to 10, a ring ran from 18:16 to 18:26 and the owner saw it stop.
|
||||||
- Sound 0 is silent. In Sound + Light mode, the light still came on and no sound played.
|
- Sound 0 is silent. In Sound + Light mode, the light still came on and no sound played.
|
||||||
- Sound names, being tested one at a time: Sound 1 is birds chirping. Sounds 2 to 7 are still to do, then the names go into the sound selects.
|
- Alarm sounds, identified by ear: 1 birds chirping, 2 beach (water and birds), 3 galaxy twinkles, 4 piano and birds, 5 happy harp or high piano, 6 old mechanical alarm clock, 7 old digital alarm clock. Names are in `alarm_block.yaml`. Sunset's sounds 1 to 4 haven't been checked, so they keep their numbers.
|
||||||
- Radio Volume and station writes are ignored with the radio off. With it on, both work, and the station stays selected after turning it off.
|
- Radio Volume and station writes are ignored with the radio off. With it on, both work, and the station stays selected after turning it off.
|
||||||
- Keep `default_transition_length` at 0. A transition sends about 50 MCU writes a second.
|
- Keep `default_transition_length` at 0. A transition sends about 50 MCU writes a second.
|
||||||
- LibreTiny before v1.14.0 can hang after a software restart or OTA until powered off for about 30 seconds (LibreTiny issue #396). The config pins v1.14.0. Drop the pin once ESPHome defaults to it or newer.
|
- LibreTiny before v1.14.0 can hang after a software restart or OTA until powered off for about 30 seconds (LibreTiny issue #396). The config pins v1.14.0. Drop the pin once ESPHome defaults to it or newer.
|
||||||
|
|||||||
+18
-17
@@ -117,13 +117,13 @@ select:
|
|||||||
name: "Alarm ${n} Sound"
|
name: "Alarm ${n} Sound"
|
||||||
options:
|
options:
|
||||||
- "Off"
|
- "Off"
|
||||||
- "Sound 1"
|
- "Birds"
|
||||||
- "Sound 2"
|
- "Beach"
|
||||||
- "Sound 3"
|
- "Galaxy Twinkles"
|
||||||
- "Sound 4"
|
- "Piano and Birds"
|
||||||
- "Sound 5"
|
- "Happy Harp"
|
||||||
- "Sound 6"
|
- "Mechanical Alarm Clock"
|
||||||
- "Sound 7"
|
- "Digital Alarm Clock"
|
||||||
update_interval: 2s
|
update_interval: 2s
|
||||||
web_server:
|
web_server:
|
||||||
sorting_group_id: group_alarm_${n}
|
sorting_group_id: group_alarm_${n}
|
||||||
@@ -131,20 +131,21 @@ select:
|
|||||||
lambda: |-
|
lambda: |-
|
||||||
if (!id(alarm_raw_valid)) return {};
|
if (!id(alarm_raw_valid)) return {};
|
||||||
uint8_t s = id(alarm_raw)[${o} + 6];
|
uint8_t s = id(alarm_raw)[${o} + 6];
|
||||||
if (s == 0) return std::string("Off");
|
static const char *const names[8] = {"Off", "Birds", "Beach", "Galaxy Twinkles", "Piano and Birds",
|
||||||
if (s >= 1 && s <= 7) return std::string("Sound ") + std::to_string(s);
|
"Happy Harp", "Mechanical Alarm Clock", "Digital Alarm Clock"};
|
||||||
return {};
|
if (s > 7) return {};
|
||||||
|
return std::string(names[s]);
|
||||||
set_action:
|
set_action:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
if (!id(alarm_raw_valid)) return;
|
if (!id(alarm_raw_valid)) return;
|
||||||
uint8_t value = 0;
|
uint8_t value = 0;
|
||||||
if (x == "Sound 1") value = 1;
|
if (x == "Birds") value = 1;
|
||||||
else if (x == "Sound 2") value = 2;
|
else if (x == "Beach") value = 2;
|
||||||
else if (x == "Sound 3") value = 3;
|
else if (x == "Galaxy Twinkles") value = 3;
|
||||||
else if (x == "Sound 4") value = 4;
|
else if (x == "Piano and Birds") value = 4;
|
||||||
else if (x == "Sound 5") value = 5;
|
else if (x == "Happy Harp") value = 5;
|
||||||
else if (x == "Sound 6") value = 6;
|
else if (x == "Mechanical Alarm Clock") value = 6;
|
||||||
else if (x == "Sound 7") value = 7;
|
else if (x == "Digital Alarm Clock") value = 7;
|
||||||
id(alarm_raw)[${o} + 6] = value;
|
id(alarm_raw)[${o} + 6] = value;
|
||||||
- script.execute: send_alarm_settings
|
- script.execute: send_alarm_settings
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,6 +7,6 @@ substitutions:
|
|||||||
packages:
|
packages:
|
||||||
lamp:
|
lamp:
|
||||||
url: https://mangavalk.com/mangavalk/esphome-wake-up-light-ii.git
|
url: https://mangavalk.com/mangavalk/esphome-wake-up-light-ii.git
|
||||||
ref: v1.0.2
|
ref: v1.0.3
|
||||||
files: [wake-up-light-ii.yaml]
|
files: [wake-up-light-ii.yaml]
|
||||||
refresh: 1d
|
refresh: 1d
|
||||||
@@ -22,7 +22,7 @@ external_components:
|
|||||||
- source:
|
- source:
|
||||||
type: git
|
type: git
|
||||||
url: https://mangavalk.com/mangavalk/esphome-wake-up-light-ii.git
|
url: https://mangavalk.com/mangavalk/esphome-wake-up-light-ii.git
|
||||||
ref: v1.0.2
|
ref: v1.0.3
|
||||||
components: [uart]
|
components: [uart]
|
||||||
refresh: 1d
|
refresh: 1d
|
||||||
|
|
||||||
@@ -268,7 +268,8 @@ tuya:
|
|||||||
# [03] repeat days: bit 0 = Monday ... bit 6 = Sunday, 0 = one time
|
# [03] repeat days: bit 0 = Monday ... bit 6 = Sunday, 0 = one time
|
||||||
# [04] ring duration (Tuya says 10-20, this lamp reports 30; any value is kept)
|
# [04] ring duration (Tuya says 10-20, this lamp reports 30; any value is kept)
|
||||||
# [05] mode bits: bit 0=light, bit 1=radio. Values above 3 are ignored.
|
# [05] mode bits: bit 0=light, bit 1=radio. Values above 3 are ignored.
|
||||||
# [06] sound 0..7. Writing 8 or more turns on the radio bit and resets it to 1.
|
# [06] sound 0..7, named in alarm_block.yaml. Writing 8 or more turns on the
|
||||||
|
# radio bit and resets it to 1.
|
||||||
# Locked at 1 in radio modes.
|
# Locked at 1 in radio modes.
|
||||||
# [07] volume 1..16 (any value is kept)
|
# [07] volume 1..16 (any value is kept)
|
||||||
# [08] radio station. Not per alarm: every write sets all 4 to the current
|
# [08] radio station. Not per alarm: every write sets all 4 to the current
|
||||||
|
|||||||
Reference in new issue
Block a user