Closed pilot1981 closed 3 years ago
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!
Thanks for raising this ticket. I have Koogeek light strip working with Home Assistant so hopefully we can figure out what is wrong with your smart plug.
I'm not sure what AP mode is - I have assumed it is "Access Point" mode. If not please ignore those points.
You have made a few different points and some of them may or may not be related, for example if HA can't see the plug when in AP mode - that is expected. If it can't see it when you have it paired with Apple Home - that is also expected. If it can't see it after you have done a hard reset of the device itself - that is also expected. But there are other cases when its not. So we need to construct a timeline of what you try and in what order and what happens.
When pairing with Home Assistant the device should not be in access point mode (if thats what AP mode is). And it should not be paired with your apple devices.
The normal pairing flow for a Koogeek device seems to be:
tcpdump -i eth0 udp port 5353
where eth0
is the interface that you are using as your primary gateway. Try restarting the KooGeek again. You should see tcpdump events as the Koogeek announces itself on your wifi. If you don't then you have a network problem.When paired, future communication is over TCP and the protocol is less reliant on mDNS, so hopefully if you do have reliability issues they will be greatly reduced after pairing is complete.
If you are still having trouble after following these steps then can you give a timeline of what you tried as bullet points. Try to capture as much information as possible. We don't have access to your device, your HA instance or your network setup so we only have what you tell us to go on. Ideally try and monitor your Koogeek starting with mDNS as described ^ as this can rule out networking issues quickly.
mDNS (the mechanism used for discovery) may not be fully functional depending on your network setup. So please also include details of your network. Do you have vlans? Do you have one flat subnet for wifi and ethernet? Or are there 2 subnets? What brand of networking gear do you use?
I do not use HASSIO myself, i use Home Assistant directly. And i only ever run it in a custom Docker container or from the command line of my development machine. So all the logs I look at are on stdout. I can't help you find where they are for your particular environment, unfortunately.
Also, if you get HA errors in the UI please include the text or a screenshot. There are many errors, and knowing exactly which one you see is very helpful
Hi, thanks for reply. I followed your suggestion, but it stop during paring procedure with HA, please see attachment that say HA don't accept PIN code because device seem to be locked form another controller:
I'm able to ping device before and after remove it from apple home app, and with tcpdump I found it:
11:31:17.625492 IP 192.168.1.113.mdns > 224.0.0.251.mdns: 0*- [0q] 5/0/0 (Cache flush) A 192.168.1.113, (Cache flush) AAAA fe80::a29d:c1ff:feb5:bd2, (Cache flush) SRV hap-B50BD2.local.:80 0 0, PTR Koogeek-P1-B50BD2._hap._tcp.local., (Cache flush) TXT "c#=1" "ff=1" "id=00:9A:13:1E:92:C6" "md=P1EU" "pv=1.1" "sf=1" "ci=7" "s#=1" "sh=RxGD7Q==" (337)
11:31:17.727825 IP6 fe80::a29d:c1ff:feb5:bd2.mdns > ff02::fb.mdns: 0*- [0q] 5/0/0 (Cache flush) A 192.168.1.113, (Cache flush) AAAA fe80::a29d:c1ff:feb5:bd2, (Cache flush) SRV hap-B50BD2.local.:80 0 0, PTR Koogeek-P1-B50BD2._hap._tcp.local., (Cache flush) TXT "c#=1" "ff=1" "id=00:9A:13:1E:92:C6" "md=P1EU" "pv=1.1" "sf=1" "ci=7" "s#=1" "sh=RxGD7Q==" (337)
11:31:17.830329 IP 192.168.1.113.mdns > 224.0.0.251.mdns: 0*- [0q] 5/0/0 (Cache flush) A 192.168.1.113, (Cache flush) AAAA fe80::a29d:c1ff:feb5:bd2, (Cache flush) SRV hap-B50BD2.local.:80 0 0, PTR Koogeek-P1-B50BD2._hap._tcp.local., (Cache flush) TXT "c#=1" "ff=1" "id=00:9A:13:1E:92:C6" "md=P1EU" "pv=1.1" "sf=1" "ci=7" "s#=1" "sh=RxGD7Q==" (337)
11:31:17.830773 IP6 fe80::a29d:c1ff:feb5:bd2.mdns > ff02::fb.mdns: 0*- [0q] 5/0/0 (Cache flush) A 192.168.1.113, (Cache flush) AAAA fe80::a29d:c1ff:feb5:bd2, (Cache flush) SRV hap-B50BD2.local.:80 0 0, PTR Koogeek-P1-B50BD2._hap._tcp.local., (Cache flush) TXT "c#=1" "ff=1" "id=00:9A:13:1E:92:C6" "md=P1EU" "pv=1.1" "sf=1" "ci=7" "s#=1" "sh=RxGD7Q==" (337)
I found the issue...I don't use dashes inserting PIN: now all work fine!!!!
thanks very much for your help!
You know also if I can take consumption value from it? which parameter I have to use?
regards
I tried to obtain Watt data in every way, but I'm not able to do this...it's possible? there is a way to modify this integration? it need custom integration for Koogeek?
Sorry I was out after my last message.
Right now we probably only support the "standard" HomeKit characteristics (the ones apple define).
It might be that Koogeek have defined some custom ones that we could read, but they are undocumented. We don't currently have a way to implement support for them, but I would like to.
In your config directory (where configuration.yaml lives) there should be a .storage folder and in there you should see a homekit_controller-entity-map
file. That contains all the characteristics your device exposes. If you can attach that I can see if I can see the data you are expecting.
(You might want to review the file first, it can contain serial numbers etc)
Hi, thanks for reply.
In attach you can find file required whitout real mac address and serial number; I found this lines:
"characteristics": [
{
"description": "1 REALTIME_ENERGY",
"ev": false,
"format": "float",
"iid": 22,
"perms": [
"pr",
"ev"
],
"type": "4AAAF931-0DEC-11E5-B939-0800200C9A66",
"value": 0.0
},
could be useful? I can use it to create my sensor template?
I don't use sensor templates myself but I might be able to make it appear as a state attribute on the entity if that would be useful.
yes, it will be great!!!!!
I wait for your update!
Hi @Jc2k , any news? I could expect this new feature in 0.100.3?
Hi @pilot1981 - haven't had much time to work on homekit_controller this past month as really busy and no hobby time. So unfortunately no progress to report. I'll let you know if I find any time to pick this up, but right now it is behind the asyncio rework branch that i am working on (enables events from the devices to work without having to poll).
Hi, any news about this develop?
No time to work on it still, sorry. Events still the priority when I do have time.
Hi, any news about my request?
Haven't forgot but very little free time. Events still priority when I do have time.
@pilot1981 wanted to give you an update on this. The events code i've been talking about for the past X months finally landed upstream and should be in the next release. With that out of the way I've also been able to do a bunch of refactoring to get ready for vendor specific extensions. Not quite there yet but it's getting closer slowly.
Great news!!!! Thanks very much. I wait for new release of HASSIO!
I see HA released 0.107 whit this change:
HomeKit Controller - Support for HomeKit controller’s legacy pairing data folder .homekit has been deprecated and in Home Assistant Core release 0.109.0 we plan to remove this code. Pairings have not been saved this way since Home Assistant 0.94, so if you are running Home Assistant 0.94 or later this does not affect you - your pairings were already migrated to configuration entries. If you are running an older release and do not upgrade soon you will not be able to automatically migrate your existing pairings at upgrade time and will have to manually re-pair them. - (@Jc2k - #32158) (homekit_controller docs)
already this include koogeek plug EU support?
Ah sorry, i think i've said something confusing.
Support for custom characteristics in the koogeek plugin is not available yet.
What i meant by my last update was just that most of the work i needed to do to start working on this was done. There is still a bit more that needs to be done, but it's getting closer.
To be clear though, the plug itself should work (turn on/off etc) just can't report watt data?
Yes
Hello all, I also would appreciate to be able to have this data, I have koogeek EU plugs and switches with power monitoring capabilities. Thank you in advance.
hi @Jc2k , any news?
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.
Hi @Jc2k, some time to take a look at this?? Thx!!
One day I hope!
please @Jc2k let's try it!
So the plan is to create secondary entities for stuff like that. That's clean because it doesn't complicate the core switch entity with unrelated vendor specific crap. It's also in line with the preferred HA style for decomposing complex accessories into multiple entities that are linked via the device registry.
I spent time than I had, 200 lines in and its a bit more work than expected. More work is needed in aiohomekit to deal with vendor characteristic types (makes assumptions it shouldnt). And think I need to totally change how it handles creating entities too.
Understood. In any case, Thanks a lot for your job @Jc2k!
Did the PR for this hit a snag?
It's waiting for a review. That can take a while.
great news here!! thx!!!
I know this issue is closed as we have now koogeek-O1EU real time entities but i can´t see those entities in my koogeek-SW2 or koogeek-DM switches.
Will be possible to add?
Please don't comment on closed tickets. This is a new new feature request. I do not have any of the devices mentioned so I will need you to provide an entity map (as discussed above). It's best not to raise gh tickets for new feature requests, ha policy is to post on the forums. But you can message me the map directly on the forums or via discord. I'm quite busy at the moment and until I've seen the map I can't till you if it's possible to do what you want, much less how easy it will be.
Home Assistant release with the issue: it isn't possible to integrate koogeek smart plug EU
Last working Home Assistant release (if known): 0.99.3
Operating environment (Hass.io/Docker/Windows/etc.): HASSIO
Integration: homekit controller
Description of problem: sometime, HA don't find plug, sometime after inserted PIN it answer not correct; I already tried with plug in AP mode or after removing it from apple home app...
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant): NATraceback (if applicable): NA I don't fine anything useful, if you need some log please say where find it...
Additional information: NA