cflurin / xiaomi-mqtt

A Bridge between the Xiaomi Mi Smart Home Gateway and the Mqtt broker.
Apache License 2.0
50 stars 14 forks source link

Aqara Wall Switch(Witch Neutral, Single Rocker) #7

Closed iChUdY closed 5 years ago

iChUdY commented 5 years ago

Hi,

i have new one Aqara Wall Switch(Witch Neutral, Single Rocker).

On read OK: {"cmd":"report","model":"ctrl_ln1.aq1","sid":"158d00020d88d0","short_id":20531,"data":{"channel_0":"on"}}

I try write: {"cmd":"write","model":"ctrl_ln1.aq1","sid":"158d00020d88d0","short_id":20531,"data":{"channel_0":"off"}}

but always return: "{"cmd":"xm","msg":"sid >158d00020d88d0< unknown."}"

I have many model":"ctrl_neutral1" and other Xiaomi HW, but never this issue.

Many restart both Raspberry, Xiaomi Gateway.. same, same and same issue.

Any idea ?

cflurin commented 5 years ago

Hi, I don't have this model. Would you please set the loglevel to debug in the config.json, restart xiaomi-mqtt, try to write ctrl_ln1.aq1 and post the log here.

How ist the write object for ctr_neutral1 ?

Can you please list all your Xiaomi-models and if possible the corresponding write objects, so I can try to find out what is wrong with ctrl_ln1.aq1.

cflurin commented 5 years ago

Please try get_id_list

https://github.com/cflurin/xiaomi-mqtt#get_id_list

Is the sid of your model ctrl_ln1.aq1 in the list?

iChUdY commented 5 years ago

Hi,

i don't know why, but today attempt (delete and add switch again on gateway) and all works fine. Probably some problem between gateway and switch HW.

Both ctrl_neutral1, ctrl_ln1.aq1 write obj is:

{"cmd":"write","model":"ctrl_neutral1","sid":"158d00018289e2","short_id":30115,"data":{"channel_0":"on"}}

{"cmd":"write","model":"ctrl_ln1.aq1","sid":"158d00020d88d0","short_id":13284,"data":{"channel_0":"on"}}

So ctrl_ln1.aq1 now works fine. Thanks.

cflurin commented 5 years ago

Okey! As I said I don't own all devices. Could you please post a list of your devices (modes), just to know which devices have been tested/used.

cflurin commented 5 years ago

BTW the write cmd doesn't need the short_id

This should also work

{"cmd":"write","model":"ctrl_neutral1","sid":"158d00018289e2","data":{"channel_0":"on"}}
iChUdY commented 5 years ago

Hi, my tested device is:

Aqara Wall Switch(No Neutral, Single Rocker):

{"cmd":"report","model":"ctrl_neutral1","sid":"158d00022eb285","short_id":26442,"data":{"channel_0":"on"}}

Aqara Wall Switch(No Neutral, Double Rocker):

{"cmd":"report","model":"ctrl_neutral2","sid":"158d000223745e","short_id":37255,"data":{"channel_0":"on"}}

{"cmd":"report","model":"ctrl_neutral2","sid":"158d000223745e","short_id":37255,"data":{"channel_1":"on"}}

Aqara Wall Switch(With Neutral, Single Rocker):

{"cmd":"report","model":"ctrl_ln1.aq1","sid":"158d00020d88d0","short_id":13284,"data":{"channel_0":"on"}}

Aqara Wireless Remote Switch(Single Rocker):

{"cmd":"report","model":"86sw1","sid":"158d000238b6ce","short_id":53234,"data":{"channel_0":"click"}}

Aqara Motion Sensor:

{"cmd":"report","model":"sensor_motion.aq2","sid":"158d0001e63198","short_id":39931,"data":{"status":"motion"}}

{"cmd":"report","model":"sensor_motion.aq2","sid":"158d0001e63198","short_id":39931,"data":{"lux":"227"}}

Mi Motion Sensor:

{"cmd":"report","model":"motion","sid":"158d00016438e5","short_id":10810,"data":{"status":"motion"}}

Mi Temperature and Humidity Sensor:

{"cmd":"read_ack","model":"sensor_ht","sid":"158d0001f545cb","short_id":56840,"data":{"voltage":2995,"temperature":21.7,"humidity":40.6}}

Mi Windows and Door Sensor:

{"cmd":"report","model":"magnet","sid":"158d00022541cb","short_id":7491,"data":{"status":"close"}}

{"cmd":"report","model":"magnet","sid":"158d00022541cb","short_id":7491,"data":{"status":"open"}}

Mi Wireless Switch:

{"cmd":"report","model":"switch","sid":"158d0001d62bcc","short_id":22437,"data":{"status":"click"}}

{"cmd":"report","model":"switch","sid":"158d0001d62bcc","short_id":22437,"data":{"status":"double_click"}}

{"cmd":"report","model":"switch","sid":"158d0001d62bcc","short_id":22437,"data":{"status":"long_click_press"}}

{"cmd":"report","model":"switch","sid":"158d0001d62bcc","short_id":22437,"data":{"status":"long_click_release"}}

These devices work at home in nine rooms through raspberrypi and node-red for almost half a year.

snimek obrazovky 2018-09-25 v 10 57 40
cflurin commented 5 years ago

Thanks for your feedback.

So 5 more models tested:

iChUdY commented 5 years ago

Yes. Works fine.

I could buy and test another. Any tip?

cflurin commented 5 years ago

On my list but not ordered yet:

iChUdY commented 5 years ago

Hi, arrived Aqara Water Leak Sensor for $11.99.

Works fine with this msg:

"{"cmd":"report","model":"sensor_wleak.aq1","sid":"158d0002568b60","short_id":25443,"data":{"status":"leak"}}"

..after being removed from the water, msg arrived in ten seconds.

"{"cmd":"report","model":"sensor_wleak.aq1","sid":"158d0002568b60","short_id":25443,"data":{"status":"no_leak"}}"

cflurin commented 5 years ago

Hi, Thanks for your feedback.