Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamjobstjn wrote:Hi sir,
1st it's the startup bug:
there's a ~50% chance this config gets applied upon boot (so several tries are needed):
addEventHandler TuyaMCUParsed 0x02 addRepeatingEvent 2.5 1 setChannel 4 7
addEventHandler TuyaMCUParsed 0x02 addRepeatingEvent 3 1 setChannel 6 30
(I think it's something similar for retain: true as a mqtt config strategy)
2nd it's when the device disconnects from mqtt server (server down):
gui will still report last config but device will act on default values (e.g. song 5, 10s). Regardless of when or if it reconnects.
a regular hass automation config will stop working here, need to apply the hack above
Additionally the minor issue of requiring delay between mqtt commands, perhaps network related?.
I am unsure how would those ideas fix these issues.
# from the Debug-Log of NAS-AB02W6 V4
# [11:38:22][C][tuya:041]: Tuya:
# [11:38:22][C][tuya:062]: Datapoint 101: enum (value: 4)
# [11:38:22][C][tuya:062]: Datapoint 102: enum (value: 0)
# [11:38:22][C][tuya:058]: Datapoint 103: int value (value: 1)
# [11:38:22][C][tuya:056]: Datapoint 104: switch (value: OFF)
# [11:38:22][C][tuya:074]: Product: '{"p":"jsm1tlzrta3s7zja","v":"1.0.5","m":2}'
[other stuff like
esphome:
wifi:
web_server:
etc. omitted]
bk72xx:
board: generic-bk7231n-qfn32-tuya
# tuya needs uart, pins see https://esphome.io/components/libretiny.html
uart:
rx_pin: GPIO10
tx_pin: GPIO11
baud_rate: 9600
# Register the Tuya MCU connection
tuya:
number:
# Duration - datapoint 103
- platform: "tuya"
name: "Duration (s)"
icon: "mdi:clock-outline"
number_datapoint: 103
min_value: 0
max_value: 120
step: 1
# Bell on / off - datapoint 104
switch:
- platform: "tuya"
name: "Bell on / off"
switch_datapoint: 104
select:
# Ringetone - datapoint 102
- platform: "tuya"
name: "Ringtone"
enum_datapoint: 102
optimistic: true
options:
0: doorbell
1: fur elise
2: big ben
3: ring ring
4: lone ranger
5: turkish march
6: high pitched
7: red alert
8: crickets
9: beep
10: dog bark
11: police siren
12: grandfather clock
13: phone ring
14: fire truck
15: clock chime
16: alarm clock
17: school bell