-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Q: SJWS01LM is now supported? #410
Comments
There is nothing to add or correct to SJWS01LM. The official firmware works well. |
Well, what is missing from SJWS01LM is the ability to use custom data formats (ATC,PVVX and BHome), the possibility to alter beacon frequency, unbind from mihome and so on.. there's much lacking, actually. |
ATC and PVVX formats are not suitable for SJWS01LM and CGPR1. |
You're right about unbinding, thanks! |
RF TX boost will fail if powered by CR2032. The device will crash and restart. Higher RF TX levels require a larger power supply. What else? Play flashing? |
It is an issue just of SJWS01LM? I have the LYWSD03MMC without capacitors and I have upped the TX power slightly with no issues. My LYWSD03MMC(s) are a floor away from the receiver and the receiver has a pretty good external antenna already, so there's not much else I can do, other than increase TX power. I also lowered the beacon interval to 15 seconds to save battery (as per your consumption graphs) and I had hope to do the same with SJWS01LM |
That PR was simply referring to a preliminary support of the native SJWS01LM protocol in atc_mi_interface, including tools and related codec and does not imply the need of a specific custom firmware. A completion of the work might be pulled in the near future, depending on the available time to test and close it.
The native firmware of the SJWS01LM device appears to have a beacon interval of about 10 minutes (with one repetition in the subsequent minute: each beaconing consists of up to 4 frames, generally 1 or 2, with encrypted content including the battery percentage level). |
In the future, if there is nothing else to do, it is possible to convert the SJWS01LM to Zigbee... |
Real measurements on TLSR825x chips with line of sight and 0 dB transmitter power: Zigbee - 100..500 м For +10 dB transmitter power: Zigbee - 200..700 м According to theory, due to different modulation and recovery codes, the difference in range should be twofold. An example that works for me: Receiver - inexpensive Realtek RTL8761 BT adapter Signal Path:
Another thermometer, locked in an iron refrigerator: Due to the long distances on my private property, Zigbee needs to be retransmitted to BLE. |
Добрый день, в итоге удалось преобразовать в zigbee? |
A bit offtopic, I do have quite a few WSD500A It does say ts0201 as its zigbee model, but it looks rather different then both it is ZTU + CHT8305 it does have 3 test pins that would be enough for flashing TP1 is Uart_RXD Do you think there is significant chance it might work with your TS0201 firmware? zigbee2ble is coordinator for zigbee that zigbee devices pairs to? |
@pvvx : sorry to come at the 'custom firmware' topic again, but there seems to be another issue with using the standard firmware.
..so another reason to have a custom firmware would be to have the data advertised in unencrypted format, if I understand well |
SJWS01LM uses a primitive water sensor, low reliability. There is no point in considering such a sensor for an emergency system. This is a children's toy. For normal operation of such sensors, OpenMQTTGateway must monitor the sequence of packet numbers, battery status, and have reliable constant reception on Bluetooth radio frequency channels. |
Isn't a primitive sensor better than nothing? :) |
There is no alternative to BLE. The sensor itself, consisting of two contacts, is primitive and does not always work. To write a program for SJWS01LM there is an SDK from Telink. |
Since we are suggesting, you can do diy with ie. optical flood/leak sensor (ie. https://item.taobao.com/item.htm?id=626837370107) and hct-08 or similar uart transceiver and hande the raw data on the device receiver is plugged in to. Also since you have diy option for reed switch in the LYWSD03MMC firmware, would the to point flood/leak sensor, like this one https://item.taobao.com/item.htm?id=42418867871 work as a reed switch? I know this is not an answer, but maybe this can help you find the solution, depends a lot on what exactly are your needs and environment. I do not think the optical variant could work as reed switch. |
There has been a solution for a long time, but it requires 3 details:
The program must be supplemented with a special function (developed a long time ago). The two sensor wires must be short and insulated. Sensitivity from several pF. That is, it “feels” the approach of a hand. Can work through a plastic housing. But each form of sensor requires adjustments due to different sizes, insulation and different parts. |
It can be decoded: you simply need the bindkey. You can test a preliminary version of the Python API, which also supports Xiaomi Mijia devices like SJWS01LM, by installing it locally. The following program decodes and prints the first 20 BLE advertisements of one or more devices implementing the Xiaomi Mijia BLE advertisement protocol, detecting flood and battery data natively produced by the SJWS01LM sensor. The bindkey can be obtained via TelinkMiFlasher. import asyncio
from bleak import BleakScanner
from bleak.uuids import normalize_uuid_str
from functools import partial
from pprint import pprint
from atc_mi_interface import mi_like_format, atc_mi_advertising_format
bindkey = {
"54:EF:44:C6:33:6B": bytes.fromhex("ff1b17f0a386d27d407529a9f0463653"),
"54:EF:44:AA:BB:CC": bytes.fromhex("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"),
# ...
}
async def ble_coro():
count = [0]
MAX_COUNT = 20
stop_event = asyncio.Event()
def detection_callback(count, device, advertisement_data):
format_label, adv_data = atc_mi_advertising_format(advertisement_data)
if format_label != "mi_like" or not adv_data:
return
mac_address = bytes.fromhex(device.address.replace(":", ""))
print(
f"{count[0]}. {device}. Format: {format_label}. "
f"RSSI: {advertisement_data.rssi}."
)
atc_mi_data = mi_like_format.parse(
adv_data,
mac_address=mac_address,
bindkey=(
bindkey[device.address] if device.address in bindkey else None
)
)
print(" ", atc_mi_data)
flooding = atc_mi_data.search_all("^flooding$")
battery = atc_mi_data.search_all("^battery_level")
if flooding:
print()
print("Flooding:", flooding[0])
if battery:
print()
print(f"Battery: {battery[0]}%")
print('-' * 80)
count[0] += 1
if count[0] == MAX_COUNT:
stop_event.set()
async with BleakScanner(
detection_callback=partial(detection_callback, count)
) as scanner:
await stop_event.wait()
print("Stopped")
asyncio.run(ble_coro()) |
Hi
I see you have added SJWS01LM firmware to the list of official firmwares, and merged #310 into the repo, but SJWS01LM is not among the list of supported devices.
..what is the current status of SJWS01LM?
Thanks!
The text was updated successfully, but these errors were encountered: