status topic for switch is not correctly published causing switch become unavailable in HA
It is observed that switches become unabliable in HA after S1E device booted. From HA, it is observed that the status topic received NO message at all.
After further debugging, it seems that the device is producting different id for switches, in detail:
- id
1, 2, 3is used forubus -S call switch state - id
33, 34, 35is used forubus -S call switch get.config
I think the same hack should be made in set_status function as the config_switch one, where the id for ubus -S call switch state is used to as the unique id of switch.
我已提交了一个pr,修复了此问题#37
I have submitted a pr to fix this problem.
临时的解决办法如下: 下载这个压缩包,解压缩并使用其中的res_monitor.sh替换 s1e开关的/data/bin下的同名文件,记得chmod+x给替换后的文件赋予可执行权限,最后reboot s1e The temporary solutions are as follows: Download this [compressed package] (https://github.com/oopuuu/AqaraSmartSwitchS1E/blob/master/homeassistant/s1e2ha.tar.gz) and unzip And use res_monitor.sh to replace the file of the same name under /data/bin of the s1e switch. Remember chmod+x to give executable permission to the replaced file then reboot the s1e.