Skip to content

Commit

Permalink
Add Android NFC state sensor to the docs (#992)
Browse files Browse the repository at this point in the history
* Extend core/sensors.md with the new Android NFC state sensor

* Fix some typos in sensors.md

* Extend wear-os/sensors.md with the new Android NFC state sensor

* Add beta tags to the NFC sensor
  • Loading branch information
marazmarci authored Oct 5, 2023
1 parent 6c474fd commit 4ce8d48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/core/sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ You can change the frequency of sensor updates by navigating to [Settings](https
| --------- | --------- | ----------- |
| `binary_sensor.doze` | [See Below](#doze-sensor) | Whether or not the device is in doze mode. |
| `binary_sensor.interactive` | None | Whether or not the device is in an interactive state. |
| `binary_sensor.nfc_state` | None | <span class='beta'>BETA</span> Whether or not the device has its NFC sensor enabled. |
| `binary_sensor.power_save` | None | Whether or not the device is in power saving mode. |
| [Activity Sensors](#activity-sensors) | See Below | The current activity type, sleep confidence and sleep segment as computed by Google. Requires activity recognition permissions on supported devices. |
| `binary_sensor.android_auto` | [See Below](#android-auto-sensor) | A binary sensor to indicate if the device is connected to Android Auto. |
Expand Down Expand Up @@ -126,7 +127,7 @@ You can change the frequency of sensor updates by navigating to [Settings](https
| `sensor.sim_2` | [See Below](#cellular-provider-sensor) | Name of your cellular provider. |
| `sensor.screen_brightness` | [See Below](#screen-brightness-sensor) | The current value of screen brightness. |
| `sensor.screen_off_timeout` | None | The current value of screen off timeout setting. |
| `sensor.steps` | None | The number of steps taken from the user since the last device reboot. Requires activity recognition permissions on supported devies. |
| `sensor.steps` | None | The number of steps taken from the user since the last device reboot. Requires activity recognition permissions on supported devices. |
| [Storage Sensors](#storage-sensor) | [See Below](#storage-sensor) | The amount of total and available internal & external storage on your Android device. |
| [Traffic Stats Sensor](#traffic-stats-sensor) | None | Amount of data transmitted and received from mobile and total device usage since last reboot. |
| [WiFi Sensors](#connection-type-sensor) | None | Several different sensors around the state of WiFi. |
Expand Down Expand Up @@ -456,19 +457,20 @@ Geocoding is handled directly by iOS's [MapKit](https://developer.apple.com/docu
![Android](/assets/android.svg) This sensors state will reflect if the device has [high accuracy mode](location.md#high-accuracy-mode) currently enabled or not. This sensor will update as soon as the state of high accuracy mode changes, the sensor will not appear until high accuracy mode is enabled for the first time.

## High Accuracy Update Interval
![Android](/assets/android.svg) This sensors state will reflect the update interval for the device in seconds for [high accuracy mode](location.md#high-accuracy-mode). This sensor will update as soon as the value changes either manaully or by the [notification command](../notifications/commands.md#high-accuracy-mode).
![Android](/assets/android.svg) This sensors state will reflect the update interval for the device in seconds for [high accuracy mode](location.md#high-accuracy-mode). This sensor will update as soon as the value changes either manually or by the [notification command](../notifications/commands.md#high-accuracy-mode).

## Interactive Sensor
![Android](/assets/android.svg) This sensors state will reflect if the device is in an interactive state. This is typically when the screen comes on and off but may vary from device to device. This sensor will update as soon state changes are detected, data is provided by [PowerManager](https://developer.android.com/reference/android/os/PowerManager.html).

Using the [History Stats Integration](https://www.home-assistant.io/integrations/history_stats/), it is possible to monitor both the daily screen time `type: time` as well as the amount of times the screen has been turned on that day `type: count`.


## Keyguard Sensors
![Android](/assets/android.svg)

These sensors will reflect various states from the [Keyguard Manager](https://developer.android.com/reference/android/app/KeyguardManager). You will be able to determine if the device is actively locked, has a password setup or even if the device requires a password to unlock. These sensors will update with the periodic sensor interval.

## NFC State Sensor
![Android](/assets/android.svg) <span class='beta'>BETA</span> This sensors state will reflect if the device has its NFC sensor currently enabled or not. This sensor will update as soon state changes are detected. Data is provided by [NfcAdapter](https://developer.android.com/reference/android/nfc/NfcAdapter).

## Notification Sensors
![Android](/assets/android.svg)<br />
Expand All @@ -477,7 +479,7 @@ Note: Sensors with Allow Lists will not appear as new entities in Home Assistant

### Last Notification

This sensor will reflect the last notification posted on the device. This sensor requires a special permission that the app will take the user to so they can grant access to notifications. This sensors state will default to the text of the notification or if not available the posting package name. This sensor offers a setting for an Allow List to let the user select which packages they wish to get notification data from, notifications sent by Home Assistant are always ignored. You need to either create an allow list or enable the setting to "Disable Allow List Requirement". Keep in mind without an allow list this sensor has the potential to drain a lot of battery. We highly recommend creating an allow list over diasbling this requirement. This can be very useful to integrate any app that sends a notification but does not offer direct integration (ex: food delivery apps or 2FA SMS codes). There are several attributes a user can expect to see, although not all attributes will contain data. This sensor makes use of the [NotificationListenerService API](https://developer.android.com/reference/android/service/notification/NotificationListenerService#onNotificationRemoved(android.service.notification.StatusBarNotification)). More details on each attribute can be found in the [Notification Extras](https://developer.android.com/reference/android/app/Notification).
This sensor will reflect the last notification posted on the device. This sensor requires a special permission that the app will take the user to so they can grant access to notifications. This sensors state will default to the text of the notification or if not available the posting package name. This sensor offers a setting for an Allow List to let the user select which packages they wish to get notification data from, notifications sent by Home Assistant are always ignored. You need to either create an allow list or enable the setting to "Disable Allow List Requirement". Keep in mind without an allow list this sensor has the potential to drain a lot of battery. We highly recommend creating an allow list over disabling this requirement. This can be very useful to integrate any app that sends a notification but does not offer direct integration (ex: food delivery apps or 2FA SMS codes). There are several attributes a user can expect to see, although not all attributes will contain data. This sensor makes use of the [NotificationListenerService API](https://developer.android.com/reference/android/service/notification/NotificationListenerService#onNotificationRemoved(android.service.notification.StatusBarNotification)). More details on each attribute can be found in the [Notification Extras](https://developer.android.com/reference/android/app/Notification).

### Last Removed Notification

Expand Down
1 change: 1 addition & 0 deletions docs/wear-os/sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ There is currently no support for sensor settings. Some sensors may not be fully
| [Last Update](../core/sensors.md#last-update-trigger-sensor) | None | The state will reflect the intent that caused the last update to get sent. |
| `sensor.light_sensor` | None | The current level of illuminance the device detects. |
| [Mobile Data Sensors](../core/sensors.md#mobile-data-sensors) | None | Several different sensors around the state of mobile data. |
| `binary_sensor.nfc_state` | None | <span class='beta'>BETA</span> Whether or not the device has its NFC sensor enabled. |
| `sensor.phone_state` | None | The only tracked states are `idle`, `ringing` or `offhook`, no other information is accessed. |
| `sensor.pressure_sensor` | None | The pressure reading from the device. |
| `sensor.proximity_sensor` | None | The current proximity reading from the device, certain devices will only show boolean value of `near` or `far`. |
Expand Down

0 comments on commit 4ce8d48

Please sign in to comment.