dib0 / elro_connects

The ELRO Connects uses a propriety protocol on the local network over UDP. This is the reversed engineered python implementation of the protocol.
MIT License
16 stars 7 forks source link

Smart switch integration #33

Open jodewee opened 2 years ago

jodewee commented 2 years ago

Hi, i have a device SF40PLF from elro, but it can't see the commands & state in the app. { "name": "schakelaar lamp", "device_name": "schakelaar lamp", "id": 8, "type": "1200", "state": "Unknown", "battery": 255 }

Is there any way to integrate this one? i've decompiled my elro app on my phone and attached it, maybe it can help?

Kind regards

ELRO_Connects_base_source_from_JADX.zip

Skons commented 2 years ago

The current implementation only beholds in short a WindowSensor and AlarmSensor https://github.com/dib0/elro_connects/blob/6ea49cb7ab56d1cceecc1839d5bc685600634954/elro/device.py#L13

Your device is a socket: https://github.com/Siterwell/familywell-lidl-android/blob/40cc44ce13d479af6e774365fde58ae72440b385/branch/lidl/app/src/main/java/me/hekr/sthome/tools/NameSolve.java#L39

The actions belonging to a socket are here https://github.com/Siterwell/familywell-lidl-android/blob/6218fdd314a031c4745e71f101061065cc27bbfc/branch/lidl/app/src/main/res/values-it/arrays.xml#L29

And here is the implementation for handling a socket in the app https://github.com/Siterwell/familywell-lidl-android/blob/6218fdd314a031c4745e71f101061065cc27bbfc/branch/lidl/app/src/main/java/me/hekr/sthome/equipment/detail/SocketDetailActivity.java

All that needs to be implemented as a class in the device.py file

depuits commented 2 years ago

The HistoryDataHandler is also a good place to see the different states. There all device states are summed up in one file (or at least a whole bunch).