nayaverdier / halohome

A python library to control Eaton HALO Home Smart Lights
MIT License
1 stars 1 forks source link

Debugging different products #3

Open deadman96385 opened 2 years ago

deadman96385 commented 2 years ago

Hello, I have been working on trying to get this implementation working for my halo lights. The only change i've done to the source is change the product_id to 162. This allows my lights to show up and controlling them does work. All data for each light in core.config_entries lines up. I verified the friendly name and mac address in the avi-on app. But when I turn on a light in home assistant it turns on the light one up in the list. Using the example below if I turn on Mr m6, Bath ne will be turned on in instead. I am using the latest copy of your home assistant component loaded as a custom component pointing at my copy of the library with the id change.

            ```{
              "device_id": 25,
              "pid": "4d6ad07151d425528a7a5300",
              "device_name": "Bath ne",
              "mac_address": "1c:d6:bd:9d:b9:39"
            },
            {
              "device_id": 26,
              "pid": "689e98be968bed96d257766d",
              "device_name": "Mr m6",
              "mac_address": "1c:d6:bd:9d:b0:08"
            },```

Edit: Here is the data of me turning on Mr m6 via home assistant

nRF Connect, 2022-06-30
Avi-on (1C:D6:BD:95:87:3D)
I 19:50:58.460 Notification received from c4edc000-9daf-11e3-8003-00025b000b00, value: (0x) 2D-CA-E2-00-80-3B-27-67-2F-C3-C8-EE-4C-04-79-E9-46-5C-92-C9
A 19:50:58.460 "(0x) 2D-CA-E2-00-80-3B-27-67-2F-C3-C8-EE-4C-04-79-E9-46-5C-92-C9" received
I 19:50:58.461 Notification received from c4edc000-9daf-11e3-8004-00025b000b00, value: (0x) 4F-04-24-21-C6-61-FD
A 19:50:58.461 "(0x) 4F-04-24-21-C6-61-FD" received
I 19:50:59.632 Notification received from c4edc000-9daf-11e3-8003-00025b000b00, value: (0x) E6-6D-12-9A-80-14-C6-93-0C-F4-36-D7-79-52-88-45-7A-EA-A4-9E
A 19:50:59.632 "(0x) E6-6D-12-9A-80-14-C6-93-0C-F4-36-D7-79-52-88-45-7A-EA-A4-9E" received
I 19:50:59.632 Notification received from c4edc000-9daf-11e3-8004-00025b000b00, value: (0x) 12
A 19:50:59.632 "(0x) 12" received

First one decrypted (2DCAE200803B27672FC3C8EE4C0479E9465C92C9):

[+] Data length 20
[+] Operation succeeded
seq: 14862893
source: 32768
encpayload: b'3b27672fc3c8'
decpayload: b'9a8073000a00'
hmac_computed: b'2ffd63473fd7dfe1'
hmac_packet: b'ee4c0479e9465c92'
eof: b'c9'

Second one decrypted (E66D129A8014C6930CF436D7795288457AEAA49E)

[+] Data length 20
[+] Operation succeeded
seq: 1207782
source: 32922
encpayload: b'14c6930cf436'
decpayload: b'008073010a00'
hmac_computed: b'b05b55bf56dd128d'
hmac_packet: b'd7795288457aeaa4'
eof: b'9e'
nayaverdier commented 2 years ago

@deadman96385 To help debug, could you do the following:

I suspect this is an issue with the way the device_id is calculated within this library, which is very unclear from HALO's API. Some magic values I used may be specific to either my account or the halo products I have, but it shouldn't be too difficult to figure out what's going on.

deadman96385 commented 2 years ago

Here is the two outputs you requested https://gist.github.com/deadman96385/3d0006d1fa5b6e64f2f1a8b28f653c8a

Also either sometime this week or next weekend I will have some other Halo lights to test. I won a bunch of them via a promotion so we will see how they go.