Sonoff basic (esp 8266) là switch hay gặp trong nhà thông minh vì nó có giá thành rẻ , dễ sử dung.
hình cắm thật tế :
Đặc biệt khi kêt hợp với tasmota thì cực kỳ tiện dụng
Hôm nay chúng ra sẽ đi flash tasmota với sonoff basic
Thiết bị :
1 sonoff basic
1. usb cp2102 module usb to ttl
phần mềm
https://tasmota.github.io/docs/
https://github.com/tasmota/tasmotizer
1. Tải phần mêm tasmotizer về và cài đặt
giao diện như bên dưới
2. cắm cap từ USB vào Các chân của sonoff
KHI cắm chú ý vừa nhần nút reset trên sonoff vừa , cắm USB vào máy tính
sau đó chọn file bin và chạy phần mêm tasmota
Cấu hình sonoff :
Tìm địa chỉ và truy cập :
1. config để send các lệnh hồng ngoại IR đến tivi/điều hòa
2. set lệnh để tự config đến home assitant
setoption19 1 -> MQTT home assitant
PowerOnState 1 -> khởi động công tắc luôn ở chế độ ON
refer : https://tasmota.github.io/docs/Commands/#poweronstate
BONUS:
lệnh IR QUẠT
tốc độ
IRSend 0,1274,402,1272,402,434,1266,1248,428,1248,402,434,1244,434,1244,1270,402,434,1244,434,1244,434,1268,410,7968
bật/tắt
IRSend 0,1268,406,1242,432,432,1246,1266,408,1266,408,406,1272,428,1250,430,1246,434,1244,406,1272,432,1244,1270,7128
swing
IRSend 0,1276,406,1278,408,406,1300,1252,430,1252,428,400,1286,412,1272,410,1248,436,1272,386,1274,1276,404,436,7996
++++++++++++++++++++
config HA:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- platform: mqtt | |
name: "quat toilet" | |
command_topic: "cmnd/tasmota_44CBF3/IRSend" | |
payload_on: "0,1274,402,1272,402,434,1266,1248,428,1248,402,434,1244,434,1244,1270,402,434,1244,434,1244,434,1268,410,7968" | |
payload_off: "0,1268,406,1242,432,432,1246,1266,408,1266,408,406,1272,428,1250,430,1246,434,1244,406,1272,432,1244,1270,7128" | |
oscillation_command_topic: "cmnd/tasmota_44CBF3/IRSend" | |
payload_oscillation_on: "0,1276,406,1278,408,406,1300,1252,430,1252,428,400,1286,412,1272,410,1248,436,1272,386,1274,1276,404,436,7996" | |
payload_oscillation_off: "0,1276,406,1278,408,406,1300,1252,430,1252,428,400,1286,412,1272,410,1248,436,1272,386,1274,1276,404,436,7996" | |
availability_topic: "tele/tasmota_44CBF3/LWT" | |
payload_available: "Online" | |
payload_not_available: "Offline" | |
preset_modes: | |
- 'off' | |
- 'low' | |
- 'medium' | |
- 'max' | |
preset_mode_command_topic: "cmnd/tasmota_44CBF3/IRSend" | |
preset_mode_command_template: > | |
{% if value == 'low' %} | |
0,1274,402,1272,402,434,1266,1248,428,1248,402,434,1244,434,1244,1270,402,434,1244,434,1244,434,1268,410,7968 | |
{% elif value == 'off' %} | |
0,1268,406,1242,432,432,1246,1266,408,1266,408,406,1272,428,1250,430,1246,434,1244,406,1272,432,1244,1270,7128 | |
{% else %} | |
0,1274,402,1272,402,434,1266,1248,428,1248,402,434,1244,434,1244,1270,402,434,1244,434,1244,434,1268,410,7968 | |
{% endif %} | |
preset_mode_state_topic: "stat/tasmota_44CBF3/RESULT " | |
preset_mode_value_template: > | |
{% if value_json.IRSend == 'Done' %} | |
off | |
{% else %} | |
max | |
{% endif %} |
Nhận xét
Đăng nhận xét