jheling / freeathome

Free@Home component for Home Assistant
112 stars 41 forks source link

Possibly a new way to parse getall.xml #39

Closed lassem closed 3 years ago

lassem commented 4 years ago

See my gist here https://gist.github.com/lassem/7b6612d325976802c19e8e519f26ced4

Basically, functionId and pairingId is what is relevant when dealing with the various devices. The deviceId is less relevant and can be ignored.

This parser goes through the device list and decorates the result with information from the definitions and descriptions-block.

Try running it on your getall.xml and see the output.

Feel free to close this issue.

miezie commented 4 years ago

I actually love this kind of proposal. Focussed info processing is of value. What I noticed when I looked in the API of ABB in the cloud is that the conclusions we have maybe doesn't fit entirely in the component. So my question would be: can you align this with the API documentation and generate a more complete story and more to the point analysis? In this way we can also starting to notice the activation of a scene by a press on a sensor, detect double clicks, etc.

If we mature in that way it can be still on site and then it can move step by step to a HA component. It could also be appropriate to still start focussing on the Cloud API to make it a component..

jheling commented 4 years ago

I think this is good to investigate. Looking to it at this way, new devices with new ids would probably work out of the box because we know the functionid.

lassem commented 4 years ago

The idea that functionId and pairingId is the stuff that is relevant I did get from the ABB developer documentation. The bread and butter of it is actually publicly available at https://developer.eu.mybuildings.abb.com/getting-started.

To make discussions easier I've created a gist with the result of dumping and parsing my entire getall.xml https://gist.github.com/lassem/aaf296c3cbcdf6b5353c1081ca44a543 (This with the updated parser script)

For example, but ABB700C714C3 is an movement detector which has ch0001 with functionId 7, which is a FID_SwitchActuator Going through the datapoints we see that idp0000 has a pairingId of 1 which according to the documentation is PID_SwitchOnOff, which also conforms well with the name Switch On/Off which is deducted from the xml.

So in theory this means that all channels with a function id of 7 is a switch actuator and all datapoints on such channels with a pairing id of 1 is the actual on/off switch.

I haven't fully figured out how scenes work. There are scene devices with output datapoints which I suspect is used to trigger the receiving devices, but how to actually trigger a scene - Ie. where is the scene input datapoint 🤷‍♂

Tho85 commented 3 years ago

@lassem I rewrote the parser according to your ideas in #73. Could you test that branch with your devices, especially the door opener / lock? I couldn't test that since I don't own a panel...