Closed egbaci closed 5 years ago
I have running homebridge in a separate server. when i use in iphone homekit all the decives work well. when i try to put in homeassistant only shows 1 of the 3 devices. Always is the same, but only one.
Please fill out the issue template.
I filled the issue. Thanks
Hey there @Jc2k, mind taking a look at this issue as its been labeled with a integration (homekit_controller
) you are listed as a codeowner for? Thanks!
This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people.
@egbaci I have a couple of questions I need you to answer to be able to help:
Are you able to post the contents of your /config/.storage/homekit_controller-entity-map
file? (/config
is where your configuration.yaml is).
I'm keen to work out why the other 2 devices are not found, but I should warn you that compatibility with homebridge is broken for other reasons (see https://github.com/home-assistant/home-assistant/issues/24094).
Hello Jc2K.
This is my config.son of homebridge
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},
"description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
"ports": {
"start": 52100,
"end": 52150,
"comment": "This section is used to control the range of ports that separate accessory (like camera or television) should be bind to."
},
"accessories": [
{"accessory":"Solidmation-Dimmer",
"name":"Dimmer Led Central",
"email":"MAIL",
"password":"PASS",
"deviceName":"Dimmer Led Central",
"homeId":29600,
"deviceId":66711
},
{
"accessory":"Solidmation-Dimmer",
"name":"Dimmer Led Lateral",
"email":"MAIL",
"password":"PASS",
"deviceName":"Dimmer Led Lateral",
"homeId":29600,
"deviceId":66710
},
{
"accessory": "Solidmation-Smart",
"name": "Aire Living",
"email": "MAIL",
"password": "PASS",
"deviceName": "Aire Living",
"homeId": "29600",
"deviceId": "72868"
},
{
"accessory": "Solidmation-Smart",
"name": "Aire Matias",
"email": "MAIL",
"password": "PASS",
"deviceName": "Aire Matias",
"homeId": "29600",
"deviceId": "72869"
},
{
"accessory": "Solidmation-Smart",
"name": "Aire Mio",
"email": "MAIL",
"password": "PASS",
"deviceName": "Aire Mio",
"homeId": "29600",
"deviceId": "72870"
}
]
}
And This is Homekit_controler-entity-map
{
"data": {
"pairings": {
"CC:22:3D:E3:CE:30": {
"accessories": [
{
"aid": 1,
"services": [
{
"characteristics": [
{
"description": "Identify",
"format": "bool",
"iid": 2,
"perms": [
"pw"
],
"type": "00000014-0000-1000-8000-0026BB765291"
},
{
"description": "Manufacturer",
"format": "string",
"iid": 3,
"perms": [
"pr"
],
"type": "00000020-0000-1000-8000-0026BB765291",
"value": "Nick Farina"
},
{
"description": "Model",
"format": "string",
"iid": 4,
"perms": [
"pr"
],
"type": "00000021-0000-1000-8000-0026BB765291",
"value": "Homebridge"
},
{
"description": "Name",
"format": "string",
"iid": 5,
"perms": [
"pr"
],
"type": "00000023-0000-1000-8000-0026BB765291",
"value": "Homebridge"
},
{
"description": "Serial Number",
"format": "string",
"iid": 6,
"perms": [
"pr"
],
"type": "00000030-0000-1000-8000-0026BB765291",
"value": "CC:22:3D:E3:CE:30"
},
{
"description": "Firmware Revision",
"format": "string",
"iid": 7,
"perms": [
"pr"
],
"type": "00000052-0000-1000-8000-0026BB765291",
"value": "0.4.49"
}
],
"hidden": false,
"iid": 1,
"primary": false,
"stype": "accessory-information",
"type": "0000003E-0000-1000-8000-0026BB765291"
},
{
"characteristics": [
{
"description": "State",
"format": "uint8",
"iid": 9,
"maxValue": 1,
"minStep": 1,
"minValue": 0,
"perms": [
"pr",
"ev"
],
"type": "77474A2F-FA98-485E-97BE-4762458774D8",
"value": 0
},
{
"description": "Version",
"format": "string",
"iid": 10,
"perms": [
"pr",
"ev"
],
"type": "FD9FE4CC-D06F-4FFE-96C6-595D464E1026",
"value": "1.0"
},
{
"description": "Control Point",
"format": "data",
"iid": 11,
"perms": [
"pr",
"pw",
"ev"
],
"type": "5819A4C2-E1B0-4C9D-B761-3EB1AFF43073",
"value": null
}
],
"hidden": false,
"iid": 2000000008,
"primary": false,
"stype": "Unknown Service: 49FB9D4D-0FEA-4BF1-8FA6-E7B18AB86DCE",
"type": "49FB9D4D-0FEA-4BF1-8FA6-E7B18AB86DCE"
}
]
},
{
"aid": 2,
"services": [
{
"characteristics": [
{
"description": "Identify",
"format": "bool",
"iid": 2,
"perms": [
"pw"
],
"type": "00000014-0000-1000-8000-0026BB765291"
},
{
"description": "Manufacturer",
"format": "string",
"iid": 3,
"perms": [
"pr"
],
"type": "00000020-0000-1000-8000-0026BB765291",
"value": "Solidmation"
},
{
"description": "Model",
"format": "string",
"iid": 4,
"perms": [
"pr"
],
"type": "00000021-0000-1000-8000-0026BB765291",
"value": "Unknown"
},
{
"description": "Name",
"format": "string",
"iid": 5,
"perms": [
"pr"
],
"type": "00000023-0000-1000-8000-0026BB765291",
"value": "Dimmer Led Central"
},
{
"description": "Serial Number",
"format": "string",
"iid": 6,
"perms": [
"pr"
],
"type": "00000030-0000-1000-8000-0026BB765291",
"value": "FFFFFFFFFFFF"
},
{
"description": "Firmware Revision",
"format": "string",
"iid": 7,
"perms": [
"pr"
],
"type": "00000052-0000-1000-8000-0026BB765291",
"value": "1.0"
}
],
"hidden": false,
"iid": 1,
"primary": false,
"stype": "accessory-information",
"type": "0000003E-0000-1000-8000-0026BB765291"
},
{
"characteristics": [
{
"description": "Name",
"format": "string",
"iid": 9,
"perms": [
"pr"
],
"type": "00000023-0000-1000-8000-0026BB765291",
"value": "Dimmer Led Central"
},
{
"description": "On",
"format": "bool",
"iid": 10,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000025-0000-1000-8000-0026BB765291",
"value": false
},
{
"description": "Brightness",
"format": "int",
"iid": 11,
"maxValue": 100,
"minStep": 1,
"minValue": 0,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000008-0000-1000-8000-0026BB765291",
"unit": "percentage",
"value": 0
}
],
"hidden": false,
"iid": 8,
"primary": false,
"stype": "lightbulb",
"type": "00000043-0000-1000-8000-0026BB765291"
}
]
},
{
"aid": 3,
"services": [
{
"characteristics": [
{
"description": "Identify",
"format": "bool",
"iid": 2,
"perms": [
"pw"
],
"type": "00000014-0000-1000-8000-0026BB765291"
},
{
"description": "Manufacturer",
"format": "string",
"iid": 3,
"perms": [
"pr"
],
"type": "00000020-0000-1000-8000-0026BB765291",
"value": "Solidmation"
},
{
"description": "Model",
"format": "string",
"iid": 4,
"perms": [
"pr"
],
"type": "00000021-0000-1000-8000-0026BB765291",
"value": "Unknown"
},
{
"description": "Name",
"format": "string",
"iid": 5,
"perms": [
"pr"
],
"type": "00000023-0000-1000-8000-0026BB765291",
"value": "Dimmer Led Lateral"
},
{
"description": "Serial Number",
"format": "string",
"iid": 6,
"perms": [
"pr"
],
"type": "00000030-0000-1000-8000-0026BB765291",
"value": "FFFFFFFFFFFF"
},
{
"description": "Firmware Revision",
"format": "string",
"iid": 7,
"perms": [
"pr"
],
"type": "00000052-0000-1000-8000-0026BB765291",
"value": "1.0"
}
],
"hidden": false,
"iid": 1,
"primary": false,
"stype": "accessory-information",
"type": "0000003E-0000-1000-8000-0026BB765291"
},
{
"characteristics": [
{
"description": "Name",
"format": "string",
"iid": 9,
"perms": [
"pr"
],
"type": "00000023-0000-1000-8000-0026BB765291",
"value": "Dimmer Led Lateral"
},
{
"description": "On",
"format": "bool",
"iid": 10,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000025-0000-1000-8000-0026BB765291",
"value": false
},
{
"description": "Brightness",
"format": "int",
"iid": 11,
"maxValue": 100,
"minStep": 1,
"minValue": 0,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000008-0000-1000-8000-0026BB765291",
"unit": "percentage",
"value": 0
}
],
"hidden": false,
"iid": 8,
"primary": false,
"stype": "lightbulb",
"type": "00000043-0000-1000-8000-0026BB765291"
}
]
},
{
"aid": 4,
"services": [
{
"characteristics": [
{
"description": "Identify",
"format": "bool",
"iid": 2,
"perms": [
"pw"
],
"type": "00000014-0000-1000-8000-0026BB765291"
},
{
"description": "Manufacturer",
"format": "string",
"iid": 3,
"perms": [
"pr"
],
"type": "00000020-0000-1000-8000-0026BB765291",
"value": "BGH"
},
{
"description": "Model",
"format": "string",
"iid": 4,
"perms": [
"pr"
],
"type": "00000021-0000-1000-8000-0026BB765291",
"value": "Unknown"
},
{
"description": "Name",
"format": "string",
"iid": 5,
"perms": [
"pr"
],
"type": "00000023-0000-1000-8000-0026BB765291",
"value": "Aire Living"
},
{
"description": "Serial Number",
"format": "string",
"iid": 6,
"perms": [
"pr"
],
"type": "00000030-0000-1000-8000-0026BB765291",
"value": "FFFFFFFFFFFF"
},
{
"description": "Firmware Revision",
"format": "string",
"iid": 7,
"perms": [
"pr"
],
"type": "00000052-0000-1000-8000-0026BB765291",
"value": "1.0"
}
],
"hidden": false,
"iid": 1,
"primary": false,
"stype": "accessory-information",
"type": "0000003E-0000-1000-8000-0026BB765291"
},
{
"characteristics": [
{
"description": "Name",
"format": "string",
"iid": 9,
"perms": [
"pr"
],
"type": "00000023-0000-1000-8000-0026BB765291",
"value": "Aire Living"
},
{
"description": "Current Heating Cooling State",
"format": "uint8",
"iid": 10,
"maxValue": 2,
"minValue": 0,
"perms": [
"pr",
"ev"
],
"type": "0000000F-0000-1000-8000-0026BB765291",
"valid-values": [
0,
1,
2
],
"value": 0
},
{
"description": "Target Heating Cooling State",
"format": "uint8",
"iid": 11,
"maxValue": 3,
"minValue": 0,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000033-0000-1000-8000-0026BB765291",
"valid-values": [
0,
1,
2,
3
],
"value": 0
},
{
"description": "Current Temperature",
"format": "float",
"iid": 12,
"maxValue": 100,
"minStep": 0.1,
"minValue": 0,
"perms": [
"pr",
"ev"
],
"type": "00000011-0000-1000-8000-0026BB765291",
"unit": "celsius",
"value": 0
},
{
"description": "Target Temperature",
"format": "float",
"iid": 13,
"maxValue": 38,
"minStep": 0.1,
"minValue": 10,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000035-0000-1000-8000-0026BB765291",
"unit": "celsius",
"value": 10
},
{
"description": "Temperature Display Units",
"format": "uint8",
"iid": 14,
"maxValue": 1,
"minValue": 0,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000036-0000-1000-8000-0026BB765291",
"valid-values": [
0,
1
],
"value": 0
}
],
"hidden": false,
"iid": 8,
"primary": false,
"stype": "thermostat",
"type": "0000004A-0000-1000-8000-0026BB765291"
}
]
},
{
"aid": 5,
"services": [
{
"characteristics": [
{
"description": "Identify",
"format": "bool",
"iid": 2,
"perms": [
"pw"
],
"type": "00000014-0000-1000-8000-0026BB765291"
},
{
"description": "Manufacturer",
"format": "string",
"iid": 3,
"perms": [
"pr"
],
"type": "00000020-0000-1000-8000-0026BB765291",
"value": "BGH"
},
{
"description": "Model",
"format": "string",
"iid": 4,
"perms": [
"pr"
],
"type": "00000021-0000-1000-8000-0026BB765291",
"value": "Unknown"
},
{
"description": "Name",
"format": "string",
"iid": 5,
"perms": [
"pr"
],
"type": "00000023-0000-1000-8000-0026BB765291",
"value": "Aire Matias"
},
{
"description": "Serial Number",
"format": "string",
"iid": 6,
"perms": [
"pr"
],
"type": "00000030-0000-1000-8000-0026BB765291",
"value": "FFFFFFFFFFFF"
},
{
"description": "Firmware Revision",
"format": "string",
"iid": 7,
"perms": [
"pr"
],
"type": "00000052-0000-1000-8000-0026BB765291",
"value": "1.0"
}
],
"hidden": false,
"iid": 1,
"primary": false,
"stype": "accessory-information",
"type": "0000003E-0000-1000-8000-0026BB765291"
},
{
"characteristics": [
{
"description": "Name",
"format": "string",
"iid": 9,
"perms": [
"pr"
],
"type": "00000023-0000-1000-8000-0026BB765291",
"value": "Aire Matias"
},
{
"description": "Current Heating Cooling State",
"format": "uint8",
"iid": 10,
"maxValue": 2,
"minValue": 0,
"perms": [
"pr",
"ev"
],
"type": "0000000F-0000-1000-8000-0026BB765291",
"valid-values": [
0,
1,
2
],
"value": 0
},
{
"description": "Target Heating Cooling State",
"format": "uint8",
"iid": 11,
"maxValue": 3,
"minValue": 0,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000033-0000-1000-8000-0026BB765291",
"valid-values": [
0,
1,
2,
3
],
"value": 0
},
{
"description": "Current Temperature",
"format": "float",
"iid": 12,
"maxValue": 100,
"minStep": 0.1,
"minValue": 0,
"perms": [
"pr",
"ev"
],
"type": "00000011-0000-1000-8000-0026BB765291",
"unit": "celsius",
"value": 0
},
{
"description": "Target Temperature",
"format": "float",
"iid": 13,
"maxValue": 38,
"minStep": 0.1,
"minValue": 10,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000035-0000-1000-8000-0026BB765291",
"unit": "celsius",
"value": 10
},
{
"description": "Temperature Display Units",
"format": "uint8",
"iid": 14,
"maxValue": 1,
"minValue": 0,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000036-0000-1000-8000-0026BB765291",
"valid-values": [
0,
1
],
"value": 0
}
],
"hidden": false,
"iid": 8,
"primary": false,
"stype": "thermostat",
"type": "0000004A-0000-1000-8000-0026BB765291"
}
]
},
{
"aid": 6,
"services": [
{
"characteristics": [
{
"description": "Identify",
"format": "bool",
"iid": 2,
"perms": [
"pw"
],
"type": "00000014-0000-1000-8000-0026BB765291"
},
{
"description": "Manufacturer",
"format": "string",
"iid": 3,
"perms": [
"pr"
],
"type": "00000020-0000-1000-8000-0026BB765291",
"value": "BGH"
},
{
"description": "Model",
"format": "string",
"iid": 4,
"perms": [
"pr"
],
"type": "00000021-0000-1000-8000-0026BB765291",
"value": "Unknown"
},
{
"description": "Name",
"format": "string",
"iid": 5,
"perms": [
"pr"
],
"type": "00000023-0000-1000-8000-0026BB765291",
"value": "Aire Mio"
},
{
"description": "Serial Number",
"format": "string",
"iid": 6,
"perms": [
"pr"
],
"type": "00000030-0000-1000-8000-0026BB765291",
"value": "FFFFFFFFFFFF"
},
{
"description": "Firmware Revision",
"format": "string",
"iid": 7,
"perms": [
"pr"
],
"type": "00000052-0000-1000-8000-0026BB765291",
"value": "1.0"
}
],
"hidden": false,
"iid": 1,
"primary": false,
"stype": "accessory-information",
"type": "0000003E-0000-1000-8000-0026BB765291"
},
{
"characteristics": [
{
"description": "Name",
"format": "string",
"iid": 9,
"perms": [
"pr"
],
"type": "00000023-0000-1000-8000-0026BB765291",
"value": "Aire Mio"
},
{
"description": "Current Heating Cooling State",
"format": "uint8",
"iid": 10,
"maxValue": 2,
"minValue": 0,
"perms": [
"pr",
"ev"
],
"type": "0000000F-0000-1000-8000-0026BB765291",
"valid-values": [
0,
1,
2
],
"value": 0
},
{
"description": "Target Heating Cooling State",
"format": "uint8",
"iid": 11,
"maxValue": 3,
"minValue": 0,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000033-0000-1000-8000-0026BB765291",
"valid-values": [
0,
1,
2,
3
],
"value": 0
},
{
"description": "Current Temperature",
"format": "float",
"iid": 12,
"maxValue": 100,
"minStep": 0.1,
"minValue": 0,
"perms": [
"pr",
"ev"
],
"type": "00000011-0000-1000-8000-0026BB765291",
"unit": "celsius",
"value": 0
},
{
"description": "Target Temperature",
"format": "float",
"iid": 13,
"maxValue": 38,
"minStep": 0.1,
"minValue": 10,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000035-0000-1000-8000-0026BB765291",
"unit": "celsius",
"value": 10
},
{
"description": "Temperature Display Units",
"format": "uint8",
"iid": 14,
"maxValue": 1,
"minValue": 0,
"perms": [
"pr",
"pw",
"ev"
],
"type": "00000036-0000-1000-8000-0026BB765291",
"valid-values": [
0,
1
],
"value": 0
}
],
"hidden": false,
"iid": 8,
"primary": false,
"stype": "thermostat",
"type": "0000004A-0000-1000-8000-0026BB765291"
}
]
}
],
"config_num": 0
}
}
},
"key": "homekit_controller-entity-map",
"version": 1
}
Hello,
The problem is that in the homekit_controller-entity-map homeassistant puts the same serial number for each device. I try to change this from the homebridge confij.json but I do not find the way. that each device has a different serial number.
Hi sorry for the delay in getting back to you, i've been a bit busy.
Homebridge ie exporting 6 accessories:
As you say they all have the same serial number and they also have the same service id (2). A service id is unique within an accessory, so as long as the serial number is unique we can have multiple sensors from a single accessory.
We could change the entity_id to use 3 pieces of information - the pairing id, accessory id and service id. According to the spec:
After a firmware update services and characteristics types that remain unchanged must retain their previous instance ids, newly added services and characteristics must not reuse instance ids from services and characteristics that were removed in the firmware update.
So it should be safe to do that, but unfortunately there are lots of installations out there using the existing ids. We'd need to be able to migrate them to the new scheme.
Additionally, even if homekit_controller handled the situation i'm not sure how the device registry could be made to cope. It would think these devices were actually part of the same physical device - im not sure if you'd be able to e.g. put them in seperate areas.
Another problem is that even if we fixed this, it turns out homebridge is sending unsolicited event packets as a form of keepalive. The current client doesn't support that and gets very confused. I'm working on a new asyncio native client that will resolve that, but it is a few cycles away yet.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
This issue still remains. For homebridge configurations, if you have more than 1 device with the same plug-in, home-assistant will only integrate a single device. which means for your homebridge, if you have a setup like this:
{
"accessory": "Syno",
"name": "sn1",
...
...
...
},
{
"accessory": "Syno",
"name": "sn2",
...
...
...
},
{
"accessory": "NetworkDevice",
"name": "device1",
...
...
...
}
{
"accessory": "NetworkDevice",
"name": "device2",
...
...
...
}
{
"accessory": "NetworkDevice",
"name": "device3",
...
...
...
}
{
"accessory": "NetworkDevice",
"name": "device4",
...
...
...
}
It will only integrate 1 device for each accessory (sn1 and device1). I am also hoping for a resolution for this.
As above, homekit_controller only supports devices that have unique serial numbers. Entities having a stable long term unique_id is vital for things like entity ids to be stable or for names to be stable between restarts.
Serial number is a required field in the HomeKit spec and it is required to be non-empty. iOS does function if it is invalid, though. But in practice certified devices do set it correctly and this is only a problem for home brew (that often doesn't)
Your homebridge plugin doesn't set the serial number field of its accessory information service to something unique, so is not currently supported in Home Assistant.
This can be somewhat easily fixed on the homebridge side by exporting a full accessory information service with a valid and unique serial number. If the accessory doesn't have one then it's ok for it to export a dummy one, it just must be unique.
On the homeassistant side it is harder to fix. To start with we'd have to switch to a weaker unique id. For example we could use the long term public key or the pairing identifier combined with an aid and service iid. This should be stable within a pairing lifetime, but only for devices that strictly follow the spec. But if you tried to re-pair your accessory Home Assistant wouldn't know it was in anyway related as all it's identifiers would change. I think this leads to duplicate entity registry entries etc. For certified accessories (which have the field set properly) using the serial number is just about perfect, and is about as good as a HA unique ID can be.
If an alternate scheme was desirable then the next problem is how to migrate existing installs. Just stopping using the serial number field and using some other field is easy. But it would be a massive breaking change hitting every homekit user. So we need to migrate all database entries that rely on the serial number to the new scheme. And if we get that wrong it could make a mess of people's setups. Last time I looked it seemed that this kind of migration was rare (if it had even been attempted before). It's wasn't something with a trivial well tested API.
It is on my radar though. I hope to get to it eventually. But i can't give you a timeframe at the moment. Although unfortunately due to time constraints it's likely far enough away that even if there was a GH ticket it would go stale and close itself before it was done 😞
Hmm, I get your point. Thanks for pointing out the issue. I am eagerly waiting though. :) I will try to contact the developer on the HB side to see if it can be easily fixed.
**Home Assistant release with the issue: 0.95.4
**Last working Home Assistant release (if known): none
**Operating environment (Hass.io/Docker/Windows/etc.): Rasperry pi3b
**Component/platform: Homebridge
**Description of problem: Homekit controller only shows 1 accesory of 3
**Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant): Using Homekit accesry integration
Traceback (if applicable):
**Additional information:I have running homebridge in a separate server. when i use in iphone homekit all the decives work well. when i try to put in homeassistant only shows 1 of the 3 devices. Always is the same, but only one.