G-Two / homeassistant-subaru

Subaru STARLINK custom component for Home Assistant.
Apache License 2.0
54 stars 7 forks source link

Feature Request - Starlink Alerts #55

Closed tango2590 closed 1 year ago

tango2590 commented 2 years ago

Starlink will send push notifications and email alerts when things like windshield wiper fluid are low. Are those alerts visible through the api? If so, can these be added as sensors?

stboch commented 2 years ago

These notifications are not available via API and are directly sent by Subaru to your device. If you have an android device you can use Home-Assistant Companion App to get these into a home-assistant automation. Alert Trigger:

platform: state
entity_id: sensor.phone_active_notification_count
to: >-
  <Example Subaru Message to Listen For>
attribute: android.bigText_com.subaru.telematics.app.remote

Hopefully this helps.

G-Two commented 1 year ago

For things that trigger certain warning lights in a Subaru, it looks like the API provides information via the data returned by vehicleHealth.json. This could probably be implemented as a "Trouble" sensor with additional attributes being a list of the MIL(s) that are actively reporting a fault. This needs to be parsed by subarulink and returned as a bool and accompanying list.

{'data': {'lastUpdatedDate': 1670753986000,
                            'vehicleHealthItems': [{'b2cCode': 'abs',
                                                    'featureCode': 'ABS_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 6},
                                                   {'b2cCode': 'oilTemp',
                                                    'featureCode': 'ATF_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 4},
                                                   {'b2cCode': 'awd',
                                                    'featureCode': 'AWD_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 5},
                                                   {'b2cCode': 'blindspot',
                                                    'featureCode': 'BSDRCT_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 39},
                                                   {'b2cCode': 'engineFail',
                                                    'featureCode': 'CEL_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 2},
                                                   {'b2cCode': 'ebd',
                                                    'featureCode': 'EBD_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 8},
                                                   {'b2cCode': 'oilWarning',
                                                    'featureCode': 'EOL_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 3},
                                                   {'b2cCode': 'epas',
                                                    'featureCode': 'EPAS_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 11},
                                                   {'b2cCode': 'pkgBrake',
                                                    'featureCode': 'EPB_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 44},
                                                   {'b2cCode': 'eyesight',
                                                    'featureCode': 'ESS_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 12},
                                                   {'b2cCode': 'hybridSystem',
                                                    'featureCode': 'HEV_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 15},
                                                   {'b2cCode': 'chargeSystem',
                                                    'featureCode': 'HEVCM_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 19},
                                                   {'b2cCode': 'oilPres',
                                                    'featureCode': 'OPL_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 53},
                                                   {'b2cCode': 'revBrake',
                                                    'featureCode': 'RAB_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 69},
                                                   {'b2cCode': 'airbag',
                                                    'featureCode': 'SRS_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 10},
                                                   {'b2cCode': 'telematics',
                                                    'featureCode': 'TEL_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 14},
                                                   {'b2cCode': 'tpms',
                                                    'featureCode': 'TPMS_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 9},
                                                   {'b2cCode': 'vdc',
                                                    'featureCode': 'VDC_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 7},
                                                   {'b2cCode': 'washer',
                                                    'featureCode': 'WASH_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 1},
                                                   {'b2cCode': 'ahbl',
                                                    'featureCode': 'AHBL_MIL',
                                                    'isTrouble': False,
                                                    'onDaiId': 0,
                                                    'onDates': [],
                                                    'warningCode': 30}]},
                   'dataName': None,
                   'errorCode': None,
                   'success': True}
}