[BETA RELEASE] Unofficial Notion drivers for home sensors

Hi @dpasirst

I've added line 119:
def now = new Date()
you're using "now" in next line and it fails as it's not defined.
I did some more debug with the temperature and the "val" is "inside", as it's taken from the wrong field, I did some more digging and worked around it by modifying child driver as follows:

        } else if (listener.definition_id == SensorTypes.TEMPERATURE) {
            val = listener?.status_localized?.state

see listeners output below, it's different from what you have in child driver

[listeners: [
    [configuration: [lower: 14.56, offset: 0.0, upper: 29.44], created_at: 2023 - 09 - 20 T03: 48: 13.824 Z, definition_id: 3, id: d6fb8514 - 9 a27 - 4963 - b3b5 - cdcdf751a700, insights: [freeze: [data_received_at: 2023 - 09 - 20 T03: 48: 13.824 Z, origin: [: ], value: ], mold_risk: [data_received_at: 2023 - 09 - 23 T02: 55: 20.516 Z, origin: [id: 4 c92adee - ca69 - 4819 - b36b - b9552700fad7, type: Sensor], value: low], primary: [data_received_at: 2023 - 12 - 11 T13: 23: 32.424 Z, origin: [id: 08 f80d96 - 5925 - 4403 - 87 ae - 7742489 dfc43, type: Sensor], value: inside]], model_version: 3.1, pro_monitoring_status: eligible, sensor_id: 799 ef575 - 4 c55 - 4 a9c - b992 - 21e898909 f6d, status_localized: [description: 9: 04 am, state: 26°], type: sensor],
    [configuration: [: ], created_at: 2023 - 09 - 20 T03: 39: 12.367 Z, definition_id: 0, id: 3897 f985 - e2e9 - 4287 - 8 d35 - c9be199c1732, insights: [decay: [data_received_at: 2023 - 09 - 20 T03: 39: 12.367 Z, origin: [: ], value: ], primary: [data_received_at: 2023 - 09 - 20 T03: 39: 12.367 Z, origin: [: ], value: high]], model_version: 4.2, pro_monitoring_status: ineligible, sensor_id: 799 ef575 - 4 c55 - 4 a9c - b992 - 21e898909 f6d, status_localized: [description: Sep 20 at 11: 39 am, state: High], type: sensor],
    [configuration: [: ], created_at: 2023 - 09 - 20 T03: 39: 12.390 Z, definition_id: 10, id: 83 c90e6a - 4 d0c - 4e43 - 9 d60 - 2681 a69d433f, insights: [primary: [data_received_at: 2023 - 12 - 08 T05: 06: 12.775 Z, origin: [id: 0454 ffaa - 724 a - 4683 - 832 c - b90c3ae2b9d1, type: Sensor], value: not_missing]], model_version: 2.1, pro_monitoring_status: ineligible, sensor_id: 799 ef575 - 4 c55 - 4 a9c - b992 - 21e898909 f6d, status_localized: [description: Dec 8 at 1: 06 pm, state: Connected], type: sensor],
    [configuration: [: ], created_at: 2023 - 09 - 20 T03: 39: 12.417 Z, definition_id: 24, id: 3 a5cdfa0 - f2ac - 4070 - b164 - 55e66 ab0d2dd, insights: [primary: [data_received_at: 2023 - 09 - 20 T03: 39: 12.417 Z, origin: [: ], value: idle]], model_version: 1.0, pro_monitoring_status: ineligible, sensor_id: 799 ef575 - 4 c55 - 4 a9c - b992 - 21e898909 f6d, status_localized: [description: Sep 20 at 11: 39 am, state: Idle], type: sensor],
    [configuration: [lifecycle_state: [calibrated_at: 2023 - 09 - 20 T03: 45: 43.413 Z], orientation: horizontal], created_at: 2023 - 09 - 20 T03: 44: 12.798 Z, definition_id: 13, id: 02 ec9e78 - 79 b4 - 406 a - be48 - 1 b617bd4df3c, insights: [primary: [data_received_at: 2023 - 12 - 12 T01: 01: 52.716 Z, origin: [id: 66 c1fe77 - a800 - 43 b0 - 8 a7c - ee7cc346c052, type: Sensor], value: closed]], model_version: 3.3, pro_monitoring_status: eligible, sensor_id: 799 ef575 - 4 c55 - 4 a9c - b992 - 21e898909 f6d, status_localized: [description: 9: 01 am, state: Closed], type: sensor],
    [configuration: [: ], created_at: 2023 - 09 - 20 T02: 48: 00.867 Z, definition_id: 10, id: ff54e544 - 0b 33 - 43 d5 - a9a8 - 03 a5ea30b088, insights: [primary: [data_received_at: 2023 - 12 - 08 T05: 06: 37.374 Z, origin: [id: 550 afbb3 - 2 b17 - 424 a - 90 f9 - 17 bc1fe8114c, type: Sensor], value: not_missing]], model_version: 2.1, pro_monitoring_status: ineligible, sensor_id: 7 dfeaca1 - 4544 - 46 a5 - a40c - 954 b331615ef, status_localized: [description: Dec 8 at 1: 06 pm, state: Connected], type: sensor],
    [configuration: [: ], created_at: 2023 - 09 - 20 T02: 48: 00.891 Z, definition_id: 24, id: c223852f - 23 c6 - 41 d1 - 8 d33 - dae05a72f91e, insights: [primary: [data_received_at: 2023 - 09 - 20 T02: 48: 00.891 Z, origin: [: ], value: idle]], model_version: 1.0, pro_monitoring_status: ineligible, sensor_id: 7 dfeaca1 - 4544 - 46 a5 - a40c - 954 b331615ef, status_localized: [description: Sep 20 at 10: 48 am, state: Idle], type: sensor],
    [configuration: [: ], created_at: 2023 - 09 - 20 T02: 48: 00.839 Z, definition_id: 0, id: 2 a3a0522 - df54 - 4612 - b6bd - 621 f21178993, insights: [decay: [data_received_at: 2023 - 09 - 20 T02: 48: 00.839 Z, origin: [: ], value: ], primary: [data_received_at: 2023 - 11 - 21 T02: 07: 53.802 Z, origin: [id: a3450dd5 - d0cc - 4e2 d - 826 c - 1 aa0980727fa, type: Sensor], value: medium]], model_version: 4.2, pro_monitoring_status: ineligible, sensor_id: 7 dfeaca1 - 4544 - 46 a5 - a40c - 954 b331615ef, status_localized: [description: Nov 21 at 10: 07 am, state: Medium], type: sensor],
    [configuration: [: ], created_at: 2023 - 09 - 20 T02: 48: 46.939 Z, definition_id: 7, id: 9349740 a - 6987 - 49 ec - a9a4 - 18 ee1e4900a6, insights: [primary: [data_received_at: 2023 - 09 - 20 T02: 50: 29.237 Z, origin: [id: 09 aaca68 - a76f - 4059 - a3e2 - 8335 b94b59af, type: Chronal], value: no_alarm]], model_version: 3.1, pro_monitoring_status: eligible, sensor_id: 7 dfeaca1 - 4544 - 46 a5 - a40c - 954 b331615ef, status_localized: [description: Sep 20 at 10: 50 am, state: No Sound], type: sensor],
    [configuration: [lower: 15.56, offset: 0.0, upper: 29.44], created_at: 2023 - 09 - 20 T03: 32: 29.536 Z, definition_id: 3, id: e9b5f265 - 2 ba5 - 4633 - 8625 - a801544cb88e, insights: [freeze: [data_received_at: 2023 - 09 - 20 T03: 32: 29.536 Z, origin: [: ], value: ], mold_risk: [data_received_at: 2023 - 09 - 23 T03: 11: 44.892 Z, origin: [id: 4 da4060e - 26 d8 - 4649 - a62f - e9144917c2d4, type: Sensor], value: low], primary: [data_received_at: 2023 - 09 - 20 T03: 32: 29.536 Z, origin: [: ], value: upper]], model_version: 3.1, pro_monitoring_status: eligible, sensor_id: 7 dfeaca1 - 4544 - 46 a5 - a40c - 954 b331615ef, status_localized: [description: 9: 03 am, state: 24°], type: sensor],
    [configuration: [: ], created_at: 2023 - 09 - 20 T03: 02: 16.582 Z, definition_id: 0, id: eaafabe7 - 0 fcc - 4351 - 9 b8f - cdf973596902, insights: [decay: [data_received_at: 2023 - 09 - 20 T03: 02: 16.582 Z, origin: [: ], value: ], primary: [data_received_at: 2023 - 09 - 20 T03: 02: 16.582 Z, origin: [: ], value: high]], model_version: 4.2, pro_monitoring_status: ineligible, sensor_id: fee95a15 - eaad - 4270 - b10e - 6327 cdff6d30, status_localized: [description: Sep 20 at 11: 02 am, state: High], type: sensor],
    [configuration: [: ], created_at: 2023 - 09 - 20 T03: 02: 16.615 Z, definition_id: 10, id: 106 b5b9d - 0 f48 - 4 eca - ac20 - 5695 f9f9c8ed, insights: [primary: [data_received_at: 2023 - 12 - 08 T05: 07: 18.387 Z, origin: [id: 6 d50d3bc - c01d - 4947 - 9 b18 - 4 f47e7fd0710, type: Sensor], value: not_missing]], model_version: 2.1, pro_monitoring_status: ineligible, sensor_id: fee95a15 - eaad - 4270 - b10e - 6327 cdff6d30, status_localized: [description: Dec 8 at 1: 07 pm, state: Connected], type: sensor],
    [configuration: [: ], created_at: 2023 - 09 - 20 T03: 02: 16.636 Z, definition_id: 24, id: df860493 - 9695 - 4213 - b135 - 19 f3ac1775c7, insights: [primary: [data_received_at: 2023 - 09 - 20 T03: 02: 16.636 Z, origin: [: ], value: idle]], model_version: 1.0, pro_monitoring_status: ineligible, sensor_id: fee95a15 - eaad - 4270 - b10e - 6327 cdff6d30, status_localized: [description: Sep 20 at 11: 02 am, state: Idle], type: sensor],
    [configuration: [: ], created_at: 2023 - 09 - 20 T03: 03: 11.391 Z, definition_id: 4, id: 1 c85ec70 - 4 afd - 4462 - 84 d7 - 98038672e25 e, insights: [primary: [data_received_at: 2023 - 09 - 20 T03: 14: 41.654 Z, origin: [id: e4606511 - dcc1 - 4 d1d - ab02 - bf136f251a12, type: Sensor], value: no_leak]], model_version: 2.3, pro_monitoring_status: eligible, sensor_id: fee95a15 - eaad - 4270 - b10e - 6327 cdff6d30, status_localized: [description: Sep 20 at 11: 14 am, state: No Leak], type: sensor],
    [configuration: [: ], created_at: 2023 - 09 - 20 T03: 30: 58.775 Z, definition_id: 2, id: f6421106 - 1 eac - 412 b - 88e5 - 3885e1 d509b8, insights: [primary: [data_received_at: 2023 - 09 - 23 T04: 35: 30.980 Z, origin: [id: 0 f2afc61 - 033e-4 fe4 - baf3 - 4 c76dc062410, type: Sensor], value: low]], model_version: 1.1, pro_monitoring_status: ineligible, sensor_id: fee95a15 - eaad - 4270 - b10e - 6327 cdff6d30, status_localized: [description: 8: 06 am, state: Low], type: sensor]
]]

Hi @xintra
The drivers are updated with fixes (hopefully) for both date and temp. I also, added in some parsing for mold_risk and freeze if values are available that your sensors seem to report. Would you mind testing as your data seems to be a little different than what I receive?

In looking at the data you shared, there are some differences with what Notion feeds me, perhaps because you have newer sensors.

In particular, temp is in the same location for both of us, but you have additional data that is reported such as mold risk (with a value), freeze (no value, not sure what that value would be), and primary with a value of "upper" . Since I'm not sure what primary is really communicating, I'm leaving that out for now, but I added some support for the others if a value is present.

Hi @dpasirst
Thanks, it's working, although mold risk is currently link to the garage door, when in reality it's reported by bathroom water sensor, that also set to report mold risk.
I've got 3 sensor with my Honey insurance:
1st is in bathroom and reports water leak + mold risk
2nd is garage door open/closed and temperature
3rd is in hallway next to smoke detector, so it would alarm me in case of smoke alarm + also reporting temperature.
I've got a lot of cheap xiaomi water sensors as a main source of leakage data :slight_smile:

@xintra ,
Great to hear. It seems your model of sensors report additional data with the listeners. In this case, given the data you posted/shared, there are 2 temperature listeners and each include the mold_risk and a value for it. Hopefully, now in Hubitat, the mold_risk should be displayed with each device reporting temp assuming the sensor model reports it...with one exception, if the mold_risk is present but the value is not populated in the data, then the driver will not display it.

It's also interesting to see that you have a listener of type definition_id: 24 which I have not seen before; however, it is unclear as to what it is reporting.

Hi @dpasirst

In that case you might want to look at
https://api.getnotion.com/api/listener_definitions