luc-ass/homebridge-sense

Collection of Characteristics

luc-ass opened this issue · 21 comments

Temperature
exports.CURRENT_TEMPERATURE_CTYPE = stPre + "11" + stPost;
00000011-0000-1000-8000-0026BB765291

Humidity
exports.CURRENT_RELATIVE_HUMIDITY_CTYPE = stPre + "10" + stPost;
00000010-0000-1000-8000-0026BB765291

Sound (Volume) (not sure if I want to include this)
00000119-0000-1000-8000-0026BB765291

Particulate
E863F10B-079E-48FF-8F27-9C2605A29F52
Custom characteristic from https://gist.github.com/gomfunkel/b1a046d729757120907c

Light (CurrentAmbientLightLevel)
0000006B-0000-1000-8000-0026BB765291
from https://github.com/KhaosT/HAP-NodeJS/blob/e2779cb5332f2fb47b5d2c8f058831d0c8c28765/lib/gen/HomeKitTypes.js

I am deeply impressed

@Luftloch80: What characteristics do you need the most? Sound (i.e. noise) does not really exist. Don't know wether we can really use it. Particulate is measured as AQI (Air Quality Index) whereas Elgato measures µg/m³... I will have to look into how we can convert from one unit to the other...

Ambient light level, Temperature and Humidity should be straight forward.

Tempreture is most favoured
Great progress

Quick note - Particulate (Air Quality) is measured using µg/m³ as per Elgato. While their response records the unit as AQI they contradict themselves in both the app and their reponse... "ideal_conditions":

"For the best sleep, the air in your bedroom should be as clean as possible. Ideally, it should be below 80µg/m³."

However the entire Sense range is 0-400 with Elgato's 'Excellent' range being 0-700...

I'd be inclined to say that this metric isn't too relevant for the current scope of Home Automation - at least not for the vast majority - Sound also falls within this realm (imo)
The other values all have a quality to them that can be directly impacted...

Temperature - adjust thermostat
Humidity - Turn (de)humidifier on/off
Light - Too dark: turn lights on. Too bright: close blinds.

@Luftloch80 @pureMidi

good news! First working version is now online. As I could not test it in my home environment (rather only external) I did not upload it to NPM jet. In the meantime you can install it via: npm install -g https://github.com/luc-ass/homebridge-sense.git.

It now supports Ambient Light, Temperature and Humidity.

I'd love to have some feedback!

Works great so far.
I hacked together a dirty workaround over the weekend - this is pulling in the same info which is great.

I'll continue to leave this running and will report back if I notice any bugs.

Okay. I just added particulate density and air quality but have no idea what the possible responses for air quality are... mine are almost always "IDEAL"...

value is stored in json.particulates.condition;

I've noticed the same thing. I've tried to do some reading about this to get some more info but it seems to be hard to come by

I could light a fire and see what happens :D

Okay, I could not find any further Information on this topic. I will probably just calculate air quality from particulate density from the ranges I already started documenting... seems way easyer

The plugin can now be installed from NPM. It also now includes air quality calculated from particulates and the particulate density itself. Have fun... and let me know if something is not working!

Dude, awesome! It worked right away, not a single error 😃👍

love to hear that! - any idea how to tell other Sense-users about this?

Tweet at Hello, hope for a retweet?

Working like a charm.

Thanks. I will probably restructure the plugin to that it gets somewhat faster when polling data but for the time being this should be sufficient.

Do you think it might be possible to get an information when the alarm rings?

Would be great to integrate this as a trigger to activate lights, loudspeakers, etc. ;)

In case I can make this happen, what type of device should this be?

puhhh, hard to say.
I think a switch would be the easiest:

alarm rings
-> switch = on
alarm stopped or not ringing
-> switch = off

Hm... so it would be a "while ringing"-Characteristic... I am not sure how to do that because the API does not push data... it is request only.
As far as I know I can only request when certain alarms are set. That would not include "adaptive" alarms... This needs some more thinking...

I can't think of a way to integrate this within the bounds of homekit.

Running a query every 10mins for the currently set alarms could then go on to trigger something outside of homekit sounds very doable.

Workflow for this would be:

Check set alarm status (e.g. 6:30am)
Queue scene 'wake up' to commence at 6:30am.

As far as I know homekit wouldn't support this kind of integration (in this sense) however most third parties could receive a trigger like this.

If you can figure out a way to implement it with homekit I'd love to see what you come up with @luc-ass