atxbyea / samsungrac

Home Assistant Climate Device for controlling (not only) Samsung AC
60 stars 18 forks source link

MIM-H03 and unique_id #76

Open smourylev opened 1 year ago

smourylev commented 1 year ago

Dear All,

I've finally moved to HA 2 weeks ago, and i'm trying to integrate my devices.

So, I have 2 outdoor unit (1 st one connected with 4 indoor and 2nd one with 3 indoor), so I have 2 MIM-H03 (of course, smartthings integration dont work correctly, and I prefer to locally manage my AC without cloud :-D)... so I'm trying to use Climate_IP module.

So, both tokens collected, I was able to add 1 internal unit... working "not bad..", cannot turn it on/ off but can set mode, temperature , wind etc...

But, when I added other internal modules, I have such a messages in home-assistant.log: 2023-08-23 19:37:15.111 ERROR (MainThread) [homeassistant.components.climate] Platform climate_ip does not generate unique IDs. ID climate_ip_1d7d855b-4b62-4fbb-a091-5f98ff9de37e already exists - ignoring climate.climate_ip_salon_climatisation_chauffage 2023-08-23 19:37:17.511 ERROR (MainThread) [homeassistant.components.climate] Platform climate_ip does not generate unique IDs. ID climate_ip_1d7d855b-4b62-4fbb-a091-5f98ff9de37e already exists - ignoring climate.climate_ip_salon_climatisation_chauffage

from what i see, it seems to have a bug to getting an individual unique ID...

[root@balboa ~]# curl  -k -H "Content-Type: application/json" -H "Authorization: Bearer d2ozss5dqy" --cert /root/Documents/HA/climate_ip/ac14k_m.pem https://192.168.99.99:8888/devices/?id=032001003 -X GET | jq | grep uuid
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3811  100  3811    0     0   2438      0  0:00:01  0:00:01 --:--:--  2438
      "uuid": "702C1F80-AB82-0000-0000-000000000000"
      "uuid": "1d7d855b-4b62-4fbb-a091-5f98ff9de37e"
      "uuid": "4476bef7-ee98-4766-a414-c474cf9f9e0f"
      "uuid": "5582c94c-e156-4583-9979-c214b96ac069"
      "uuid": "ccd69f17-9e7c-4153-a5e3-ccb0903158e2"

I'm not good in python, but from what i read, it does not look to get another UUID in case of multiple unit connected to MIM-H03...

My config is:

climate:
  ######## Clims DOMIK
  - platform: climate_ip
    config_file: "mim-h03_heatpump.yaml"
    ip_address: "192.168.99.99"
    name: "Chambre 3"
    device_id: "032001000"
    token: "totoken"
    cert: "ac14k_m.pem"
    poll: true
  - platform: climate_ip
    config_file: "mim-h03_heatpump_DOMIK-Chambre1.yaml"
    ip_address: "192.168.99.99"
    name: "Chambre 1"
    device_id: "032001001"
    token: "totoken"
    cert: "ac14k_m.pem"
    poll: true
  - platform: climate_ip
    config_file: "mim-h03_heatpump_DOMIK-Chambre2.yaml"
    ip_address: "192.168.99.99"
    name: "Chambre 2"
    device_id: "032001002"
    token: "totoken"
    cert: "ac14k_m.pem"
    poll: true
  - platform: climate_ip
    config_file: "mim-h03_heatpump_DOMIK-Salon.yaml"
    ip_address: "192.168.99.99"
    name: "Salon"
    device_id: "032001003"
    token: "totoken"
    cert: "ac14k_m.pem"
    poll: true

If anyone has an idea ..... ;)

Thank you! Serguei

lucadjc commented 1 year ago

HI, i suppose that the error is in your config part, each single unit should have unique ip_address, it cannot be the same for all. I'm not using device_id, try to remove it and see what happens (of course after adjusting the ip address part)

smourylev commented 1 year ago

Hello @lucadjc , As I said each MIM-H03 has 3 or 4 units connected on it.... so 1 IP addr for 3 or 4 units.

See the wiring diagram... MIM-H03-wiring

So yes, seems that Climate_ip supports only one unit attached to MIM-H03. Modifying the code myself, I was able to add the units, but still facing the problem to get the correct unique_id.

lucadjc commented 1 year ago

ciao, each single unit that you want to manage indipendently has own IP address, this feature is not shared. of course you've to exclude the outdoor device, only the indoor one that have the wifi capabilities

smourylev commented 1 year ago

some of my units has an old gen wifi module in it (was working like 4 years ago ... (i think those are 2878... or older... 2013-2014 internal units)). But, again, a MIM-H03 has multiple units on it, and only 1 single IP (i'm able to manage all units with curl from CLI, read and set only by one IP for 4 units by adressing each with the correct device_ID), as you can see: `

[root@balboa ~]# curl  -k -H "Content-Type: application/json" -H "Authorization: Bearer totoken" --cert /root/Documents/HA/climate_ip/ac14k_m.pem -X GET https://192.168.99.99:8888/devices | jq | grep -A1 '\"id\": \"032'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3820  100  3820    0     0   3673      0  0:00:01  0:00:01 --:--:--  3669

      "id": "032001000",
      "name": "Chambre 3",
--
      "id": "032001001",
      "name": "Chambre 2",
--
      "id": "032001002",
      "name": "Chambre 1 - Bureau",
--
      "id": "032001003",
      "name": "Salon",`
lucadjc commented 1 year ago

I'm not expert on 8888 devices, I've 2878, there if you've the token, you can specify into config.yaml file the proper setting for that device too (linking to the correct 2878 yaml configuration file) and that one should work properly too (mine are) about the unique ID, check my branch code and test if it is working for your setting too, unfortunately i don't have that device and I'm not able to test/reproduce them