Skip to content

Commit

Permalink
Changes, Tesla BLE
Browse files Browse the repository at this point in the history
  • Loading branch information
aneisch committed Jan 3, 2025
1 parent d21696d commit fb6ef35
Show file tree
Hide file tree
Showing 511 changed files with 17,407 additions and 576 deletions.
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://github.com/aneisch/home-assistant-config/actions/workflows/check-ha-release-compatibility.yml/badge.svg)](https://github.com/aneisch/home-assistant-config/actions)
[![GitHub last commit](https://img.shields.io/github/last-commit/aneisch/home-assistant-config)](https://github.com/aneisch/home-assistant-config/commits/master)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/y/aneisch/home-assistant-config)](https://github.com/aneisch/home-assistant-config/graphs/commit-activity)
[![HA Version](https://img.shields.io/badge/Running%20Home%20Assistant-2024.12.1%20(Latest)-brightgreen)](https://github.com/home-assistant/home-assistant/releases/latest)
[![HA Version](https://img.shields.io/badge/Running%20Home%20Assistant%20-2025.1.0b9%20(Out%20of%20Date)-Red)](https://github.com/home-assistant/home-assistant/releases/latest)
<br><a href="https://www.buymeacoffee.com/aneisch" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-black.png" width="150px" height="35px" alt="Buy Me A Coffee" style="height: 35px !important;width: 150px !important;" ></a>

I do my best to keep [Home Assistant](https://github.com/home-assistant/home-assistant) on the [latest release](https://github.com/home-assistant/home-assistant/releases/latest). I'm heavily utilizing [AppDaemon](http://appdaemon.readthedocs.io/en/latest/) and [NodeRed](https://flows.nodered.org/node/node-red-contrib-home-assistant-websocket) for advanced/templated automations. See [Appdaemon config](https://github.com/aneisch/home-assistant-config/tree/master/extras/appdaemon) and my NodeRed screenshots below for details. Most of my setup is run as Docker containers (see [docker-compose](https://github.com/aneisch/home-assistant-config/tree/master/extras/docker-compose) for container list).
Expand Down Expand Up @@ -58,22 +58,22 @@ Home Assistant and other containers have ingress handled automatically by [Traef
## Some statistics about my installation:
Description | value
-- | --
Lines of ESPHome YAML | 3297
Lines of Home Assistant YAML | 10853
[Integrations](https://www.home-assistant.io/integrations/) in use | 66
Lines of ESPHome YAML | 3301
Lines of Home Assistant YAML | 11025
[Integrations](https://www.home-assistant.io/integrations/) in use | 68
Zigbee devices in [`zha`](https://www.home-assistant.io/integrations/zha/) | 26
Z-Wave devices in [`zwave_js`](https://www.home-assistant.io/integrations/zwave_js/) | 37

Description | value
-- | --
Entities in the [`automation`](https://www.home-assistant.io/components/automation) domain | 136
Entities in the [`binary_sensor`](https://www.home-assistant.io/components/binary_sensor) domain | 175
Entities in the [`button`](https://www.home-assistant.io/components/button) domain | 53
Entities in the [`camera`](https://www.home-assistant.io/components/camera) domain | 16
Entities in the [`automation`](https://www.home-assistant.io/components/automation) domain | 140
Entities in the [`binary_sensor`](https://www.home-assistant.io/components/binary_sensor) domain | 183
Entities in the [`button`](https://www.home-assistant.io/components/button) domain | 68
Entities in the [`camera`](https://www.home-assistant.io/components/camera) domain | 15
Entities in the [`climate`](https://www.home-assistant.io/components/climate) domain | 1
Entities in the [`conversation`](https://www.home-assistant.io/components/conversation) domain | 2
Entities in the [`conversation`](https://www.home-assistant.io/components/conversation) domain | 3
Entities in the [`counter`](https://www.home-assistant.io/components/counter) domain | 1
Entities in the [`cover`](https://www.home-assistant.io/components/cover) domain | 16
Entities in the [`cover`](https://www.home-assistant.io/components/cover) domain | 19
Entities in the [`datetime`](https://www.home-assistant.io/components/datetime) domain | 6
Entities in the [`device_tracker`](https://www.home-assistant.io/components/device_tracker) domain | 6
Entities in the [`event`](https://www.home-assistant.io/components/event) domain | 14
Expand All @@ -86,27 +86,29 @@ Entities in the [`input_number`](https://www.home-assistant.io/components/input_
Entities in the [`input_select`](https://www.home-assistant.io/components/input_select) domain | 19
Entities in the [`input_text`](https://www.home-assistant.io/components/input_text) domain | 18
Entities in the [`light`](https://www.home-assistant.io/components/light) domain | 39
Entities in the [`lock`](https://www.home-assistant.io/components/lock) domain | 4
Entities in the [`media_player`](https://www.home-assistant.io/components/media_player) domain | 20
Entities in the [`lock`](https://www.home-assistant.io/components/lock) domain | 5
Entities in the [`media_player`](https://www.home-assistant.io/components/media_player) domain | 19
Entities in the [`notify`](https://www.home-assistant.io/components/notify) domain | 2
Entities in the [`number`](https://www.home-assistant.io/components/number) domain | 18
Entities in the [`number`](https://www.home-assistant.io/components/number) domain | 22
Entities in the [`person`](https://www.home-assistant.io/components/person) domain | 2
Entities in the [`plant`](https://www.home-assistant.io/components/plant) domain | 1
Entities in the [`remote`](https://www.home-assistant.io/components/remote) domain | 4
Entities in the [`script`](https://www.home-assistant.io/components/script) domain | 52
Entities in the [`select`](https://www.home-assistant.io/components/select) domain | 4
Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 605
Entities in the [`script`](https://www.home-assistant.io/components/script) domain | 54
Entities in the [`select`](https://www.home-assistant.io/components/select) domain | 6
Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 617
Entities in the [`setter`](https://www.home-assistant.io/components/setter) domain | 1
Entities in the [`siren`](https://www.home-assistant.io/components/siren) domain | 1
Entities in the [`stt`](https://www.home-assistant.io/components/stt) domain | 1
Entities in the [`sun`](https://www.home-assistant.io/components/sun) domain | 1
Entities in the [`switch`](https://www.home-assistant.io/components/switch) domain | 197
Entities in the [`switch`](https://www.home-assistant.io/components/switch) domain | 204
Entities in the [`timer`](https://www.home-assistant.io/components/timer) domain | 7
Entities in the [`tts`](https://www.home-assistant.io/components/tts) domain | 1
Entities in the [`tts`](https://www.home-assistant.io/components/tts) domain | 2
Entities in the [`update`](https://www.home-assistant.io/components/update) domain | 83
Entities in the [`vacuum`](https://www.home-assistant.io/components/vacuum) domain | 1
Entities in the [`wake_word`](https://www.home-assistant.io/components/wake_word) domain | 1
Entities in the [`weather`](https://www.home-assistant.io/components/weather) domain | 1
Entities in the [`zone`](https://www.home-assistant.io/components/zone) domain | 8
**Total state objects** | **1618**
**Total state objects** | **1678**
## The HACS integrations/plugins that I use:

**Appdaemon**:<br>
Expand Down
5 changes: 5 additions & 0 deletions alexa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ smart_home:
- script.vacuum_clean_guest_bedroom
- script.vacuum_locate
- script.kitchen_launch_timers
- script.tesla_hvac
- sensor.master_bedroom_temperature
- switch.bethany_office_ceiling_fan
- switch.master_bedroom_ceiling_fan
Expand Down Expand Up @@ -210,6 +211,10 @@ smart_home:
description: "Vacuum the Guest Bedroom"
display_categories: SCENE_TRIGGER

script.tesla_hvac:
name: Tesla HVAC
display_categories: SCENE_TRIGGER

sensor.master_bedroom_temperature:
name: "Master Bedroom Temperature"
display_categories: TEMPERATURE_SENSOR
Expand Down
13 changes: 7 additions & 6 deletions automations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@
trigger: state
for:
hours: 0
minutes: 1
seconds: 0
minutes: 0
seconds: 5
conditions:
- condition: template
value_template: '{{ states(''input_boolean.goodnight'') == ''off'' and states(''group.trackers'')
Expand All @@ -380,16 +380,17 @@
trigger: state
for:
hours: 0
minutes: 1
seconds: 0
minutes: 0
seconds: 5
enabled: false
- entity_id:
- binary_sensor.xbox_power
to: 'off'
trigger: state
for:
hours: 0
minutes: 1
seconds: 0
minutes: 0
seconds: 30
conditions:
- condition: template
value_template: '{{ states(''input_boolean.goodnight'') == ''off'' and states(''group.trackers'')
Expand Down
5 changes: 0 additions & 5 deletions binary_sensor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
# host: 10.0.1.100
# count: 2

# - platform: ping
# name: Kurt Tunnel
# host: 192.168.88.1
# count: 2

# - platform: ping
# name: internet_reachability
# host: 1.1.1.1
Expand Down
2 changes: 1 addition & 1 deletion configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homeassistant:
internal_url: http://10.0.1.22:8123
country: US
elevation: !secret elevation
unit_system: imperial
#unit_system: imperial
latitude: !secret home_lat
longitude: !secret home_long
time_zone: America/Chicago
Expand Down
13 changes: 7 additions & 6 deletions custom_components/alexa_media/alexa_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ def is_local(appliance: dict[str, Any]) -> bool:
return not is_skill(appliance)

# Ledvance/Sengled bulbs connected via bluetooth are hard to detect as locally connected
# Amazon devices are not local but bypassing the local check allows for control by the integration
# There is probably a better way, but this works for now.
if (
appliance.get("manufacturerName") == "Ledvance"
or appliance.get("manufacturerName") == "Sengled"
):
manufacturerNames = ["Ledvance", "Sengled", "Amazon"]
if appliance.get("manufacturerName") in manufacturerNames:
return not is_skill(appliance)

# Zigbee devices are guaranteed to be local and have a particular pattern of id
Expand All @@ -108,8 +107,10 @@ def is_alexa_guard(appliance: dict[str, Any]) -> bool:

def is_temperature_sensor(appliance: dict[str, Any]) -> bool:
"""Is the given appliance the temperature sensor of an Echo."""
return is_local(appliance) and has_capability(
appliance, "Alexa.TemperatureSensor", "temperature"
return (
is_local(appliance)
and has_capability(appliance, "Alexa.TemperatureSensor", "temperature")
and appliance["friendlyDescription"] != "Amazon Indoor Air Quality Monitor"
)


Expand Down
53 changes: 31 additions & 22 deletions custom_components/alexa_media/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
"""Initialize options flow."""
self.config = OrderedDict()
self.config_entry = config_entry
self._config_entry = config_entry

async def async_step_init(
self, user_input: dict[str, Any] | None = None
Expand All @@ -883,7 +883,7 @@ async def async_step_init(
(
vol.Optional(
CONF_PUBLIC_URL,
default=self.config_entry.data.get(
default=self._config_entry.data.get(
CONF_PUBLIC_URL, DEFAULT_PUBLIC_URL
),
),
Expand All @@ -892,28 +892,28 @@ async def async_step_init(
(
vol.Optional(
CONF_INCLUDE_DEVICES,
default=self.config_entry.data.get(CONF_INCLUDE_DEVICES, ""),
default=self._config_entry.data.get(CONF_INCLUDE_DEVICES, ""),
),
str,
),
(
vol.Optional(
CONF_EXCLUDE_DEVICES,
default=self.config_entry.data.get(CONF_EXCLUDE_DEVICES, ""),
default=self._config_entry.data.get(CONF_EXCLUDE_DEVICES, ""),
),
str,
),
(
vol.Optional(
CONF_SCAN_INTERVAL,
default=self.config_entry.data.get(CONF_SCAN_INTERVAL, 120),
default=self._config_entry.data.get(CONF_SCAN_INTERVAL, 120),
),
int,
),
(
vol.Optional(
CONF_QUEUE_DELAY,
default=self.config_entry.data.get(
default=self._config_entry.data.get(
CONF_QUEUE_DELAY, DEFAULT_QUEUE_DELAY
),
),
Expand All @@ -922,7 +922,7 @@ async def async_step_init(
(
vol.Optional(
CONF_EXTENDED_ENTITY_DISCOVERY,
default=self.config_entry.data.get(
default=self._config_entry.data.get(
CONF_EXTENDED_ENTITY_DISCOVERY,
DEFAULT_EXTENDED_ENTITY_DISCOVERY,
),
Expand All @@ -932,7 +932,7 @@ async def async_step_init(
(
vol.Optional(
CONF_DEBUG,
default=self.config_entry.data.get(CONF_DEBUG, DEFAULT_DEBUG),
default=self._config_entry.data.get(CONF_DEBUG, DEFAULT_DEBUG),
),
bool,
),
Expand All @@ -941,27 +941,36 @@ async def async_step_init(

if user_input is not None:
"""Preserve these parameters"""
if CONF_URL in self.config_entry.data:
user_input[CONF_URL] = self.config_entry.data[CONF_URL]
if CONF_EMAIL in self.config_entry.data:
user_input[CONF_EMAIL] = self.config_entry.data[CONF_EMAIL]
if CONF_PASSWORD in self.config_entry.data:
user_input[CONF_PASSWORD] = self.config_entry.data[CONF_PASSWORD]
if CONF_SECURITYCODE in self.config_entry.data:
user_input[CONF_SECURITYCODE] = self.config_entry.data[
if CONF_URL in self._config_entry.data:
user_input[CONF_URL] = self._config_entry.data[CONF_URL]
if CONF_EMAIL in self._config_entry.data:
user_input[CONF_EMAIL] = self._config_entry.data[CONF_EMAIL]
if CONF_PASSWORD in self._config_entry.data:
user_input[CONF_PASSWORD] = self._config_entry.data[CONF_PASSWORD]
if CONF_SECURITYCODE in self._config_entry.data:
user_input[CONF_SECURITYCODE] = self._config_entry.data[
CONF_SECURITYCODE
]
if CONF_OTPSECRET in self.config_entry.data:
user_input[CONF_OTPSECRET] = self.config_entry.data[CONF_OTPSECRET]
if CONF_OAUTH in self.config_entry.data:
user_input[CONF_OAUTH] = self.config_entry.data[CONF_OAUTH]
if CONF_OTPSECRET in self._config_entry.data:
user_input[CONF_OTPSECRET] = self._config_entry.data[CONF_OTPSECRET]
if CONF_OAUTH in self._config_entry.data:
user_input[CONF_OAUTH] = self._config_entry.data[CONF_OAUTH]
"""Ensure public_url ends with trailing slash"""
if CONF_PUBLIC_URL in self.config_entry.data:
if CONF_PUBLIC_URL in self._config_entry.data:
if not user_input[CONF_PUBLIC_URL].endswith("/"):
user_input[CONF_PUBLIC_URL] = user_input[CONF_PUBLIC_URL] + "/"
"""Remove leading/trailing spaces in device strings"""
if CONF_INCLUDE_DEVICES in self._config_entry.data:
user_input[CONF_INCLUDE_DEVICES] = user_input[
CONF_INCLUDE_DEVICES
].strip()
if CONF_EXCLUDE_DEVICES in self._config_entry.data:
user_input[CONF_EXCLUDE_DEVICES] = user_input[
CONF_EXCLUDE_DEVICES
].strip()

self.hass.config_entries.async_update_entry(
self.config_entry, data=user_input, options=self.config_entry.options
self._config_entry, data=user_input, options=self._config_entry.options
)
return self.async_create_entry(title="", data={})

Expand Down
10 changes: 9 additions & 1 deletion custom_components/alexa_media/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
PERCENTAGE,
)

__version__ = "5.0.2"
__version__ = "5.3.0"
PROJECT_URL = "https://github.com/alandtse/alexa_media_player/"
ISSUE_URL = f"{PROJECT_URL}issues"
NOTIFY_URL = f"{PROJECT_URL}wiki/Configuration%3A-Notification-Component#use-the-notifyalexa_media-service"
Expand Down Expand Up @@ -67,6 +67,7 @@
DEFAULT_SCAN_INTERVAL = 60

SERVICE_UPDATE_LAST_CALLED = "update_last_called"
SERVICE_RESTORE_VOLUME = "restore_volume"
SERVICE_FORCE_LOGOUT = "force_logout"

RECURRING_PATTERN = {
Expand Down Expand Up @@ -110,6 +111,13 @@
ATTR_MESSAGE = "message"
ATTR_EMAIL = "email"
ATTR_NUM_ENTRIES = "entries"
STREAMING_ERROR_MESSAGE = (
"Sorry, direct music streaming isn't supported. "
"This limitation is set by Amazon, and not by Alexa-Media-Player, Music-Assistant, nor Home-Assistant."
)
PUBLIC_URL_ERROR_MESSAGE = (
"To send TTS, please set the public URL in integration configuration."
)
STARTUP = f"""
-------------------------------------------------------------------
{DOMAIN}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"issue_tracker": "https://github.com/alandtse/alexa_media_player/issues",
"loggers": ["alexapy", "authcaptureproxy"],
"requirements": ["alexapy==1.29.5", "packaging>=20.3", "wrapt>=1.14.0"],
"version": "5.0.2"
"version": "5.3.0"
}
Loading

0 comments on commit fb6ef35

Please sign in to comment.