-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
polarity of contact sensor events #68
Comments
Not in my experience. The value in the history entry is the value of the ContactSensorState: https://github.com/KhaosT/HAP-NodeJS/blob/414cd96ca9708596b1f71304bd4e6dff5ab045fc/lib/gen/HomeKitTypes.js#L386-L388. What plugin are you using?
No, it's not. TimesOpened and LastActivation are characteristics of the ContactSensor service, not of the History service provided by fakegato-history. fakegato is unaware of any other services. Reset is a characteristic of the History service, but you need to reset TimesOpened when it's set. Afaik, there's no TimesClosed characteristic. |
hmm... very strange. I have to use 0 for window open and 1 for window close in the history. if write a 0 then the detailed list in eve will display a line like '- opened' so if I use the values from the readme the list will be wrong. I'm using my own homebridge-fhem platform plugin: https://github.com/justme-1968/homebridge-fhem of course the data is there. in the same way fakegato adds the history service it could (optionally) add the other characteristics to the ContactSensor service. just give it in an optional parameter. addEntry would then calculate the values and expose them in the additional characteristics. in my option this would be better than every plugin implementing this on its own. especially as fakegato for contact sensors is not really usable without them. regarding reset: I think it is also a characteristic of the ContactSensor. not of the history service. it relates to the reset of the TimesOpened characteristic not to the history list. I'm not sure how the clearing of the history is handled at the moment. I think the clearing of the persisted data is missing from fakegato. that was a typo. it should read TimesOpened, SecondsOpened and SecodsClosed. |
I just noticed something ... maybe the reason for the problem with the polarity is the meaning of window open/closed vs. contact open/closed. most/all contact sensors used with fhem (that is homematic for example) will send a contact closed event if the door/window is closed. this is translated to a CONTACT_DETECTED homebridge state. but this would not match the fakegato documentation. if you use sensors that use a reversed polarity (as it is also assumed in the alexa api) then it would match the documentation. so maybe just the documentation should be changed to remove the ambiguity between contact closed and door closed. eve uses open/closed as in door/window closed for the history. not contact closed. by the way: I think CONTACT_DETECTED for a closed window is much more fail save as it will report broken wires as an open window instead of a closed window. |
Just watching this dialog and 100% agree on Alexa being backwards |
one more data point: but it looks like this somehow brings eve to display the history for both characteristics. as it is the same history one is wrong. i will do some more experiments. |
Hi, Concerning the extra characteristics, this is something we discussed in the past on slack. The main idea behind fakegato-history was to provide a way to display history in Eve, which was not obviuos at all. Instead managing the extra characteristics is something more standard, so we decided to leave it to plugin developers. Nonetheless, if you would like to propose a PR for optionally adding all the extra characteristics it would be fine. However right now I don't have so much time for coordinating this work. The key point is that all the additions must be completely backward compatible since a lot of plugin are using fakegato and probably already manage that characteristics by their own. Also, I makes sense only if all characteristics are provided for all accessory types supported by fakegato. One problem that I see here is that Eve Aqua manages this extra data in a completely different manner (see wiki). |
Eve internally marks histories using some unknown combination of accessory name, serial number and services/characteristics exposed. So probably in your case Eve is assigning the same history to both the characteristics. Keep in mind that Eve protocol was not designed for public use, so the more your accessory is similar to original Elgato’s ones, the more reliable and meaningful will be the behavior of fakegato. |
Sorry for dragging open a two year old issue but thought i’d add my comments in case this helps anyone in the future (as this thread has helped me today!). From what I have noticed for an accessory with a GarageDoorOpener service and a ContactSensor service using the fakegato type It seems that the It’s probably fair to sum up that if the accessory has just the ContactSensor service then the documented entries Hope this helps anyone in the future that might be reading 👍 |
i have just added the fakegato-history to the homebridge-them platform plugin.
basic functionality is already very nice. but I have noticed some things:
I think the documented polarity for the contact sensor events is wrong. at least I have to store 1 for closed and 0 for open. otherwise the graph and the list of events is inverted.
maybe the values follow the style of the CurrentDoorState characteristic instead of the ContactSensorState style?
as the contact sensor history will not work without the TimesOpened, SecondsOpened and SecodsClosed characteristics it would be nicht if fakegato would add them automatically and also cunt the events. the data is there :).
the same would be true for the LastActivation
would you accept a patch that adds support for these three?
The text was updated successfully, but these errors were encountered: