Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aneisch committed Apr 27, 2024
1 parent 4d0da09 commit 8ef82bd
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 41 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,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.4.3%20(Latest)-brightgreen)](https://github.com/home-assistant/home-assistant/releases/latest)
[![HA Version](https://img.shields.io/badge/Running%20Home%20Assistant-2024.4.4%20(Latest)-brightgreen)](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>


Expand Down Expand Up @@ -57,15 +57,15 @@ Also using Grafana/Influx for graphing, both running in Docker containers on NUC
Description | value
-- | --
Lines of ESPHome YAML | 2801
Lines of Home Assistant YAML | 8998
Lines of Home Assistant YAML | 9008
[Integrations](https://www.home-assistant.io/integrations/) in use | 59
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 | 120
Entities in the [`binary_sensor`](https://www.home-assistant.io/components/binary_sensor) domain | 138
Entities in the [`automation`](https://www.home-assistant.io/components/automation) domain | 121
Entities in the [`binary_sensor`](https://www.home-assistant.io/components/binary_sensor) domain | 135
Entities in the [`button`](https://www.home-assistant.io/components/button) domain | 15
Entities in the [`camera`](https://www.home-assistant.io/components/camera) domain | 14
Entities in the [`climate`](https://www.home-assistant.io/components/climate) domain | 1
Expand All @@ -74,7 +74,7 @@ Entities in the [`cover`](https://www.home-assistant.io/components/cover) domain
Entities in the [`device_tracker`](https://www.home-assistant.io/components/device_tracker) domain | 4
Entities in the [`fan`](https://www.home-assistant.io/components/fan) domain | 3
Entities in the [`group`](https://www.home-assistant.io/components/group) domain | 17
Entities in the [`image`](https://www.home-assistant.io/components/image) domain | 8
Entities in the [`image`](https://www.home-assistant.io/components/image) domain | 7
Entities in the [`input_boolean`](https://www.home-assistant.io/components/input_boolean) domain | 29
Entities in the [`input_datetime`](https://www.home-assistant.io/components/input_datetime) domain | 38
Entities in the [`input_number`](https://www.home-assistant.io/components/input_number) domain | 6
Expand All @@ -89,7 +89,7 @@ Entities in the [`plant`](https://www.home-assistant.io/components/plant) domain
Entities in the [`remote`](https://www.home-assistant.io/components/remote) domain | 1
Entities in the [`script`](https://www.home-assistant.io/components/script) domain | 56
Entities in the [`select`](https://www.home-assistant.io/components/select) domain | 3
Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 430
Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 429
Entities in the [`siren`](https://www.home-assistant.io/components/siren) 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 | 167
Expand All @@ -99,7 +99,7 @@ Entities in the [`update`](https://www.home-assistant.io/components/update) doma
Entities in the [`vacuum`](https://www.home-assistant.io/components/vacuum) 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 | 6
**Total state objects** | **1216**
**Total state objects** | **1212**
## The HACS integrations/plugins that I use:
**Appdaemon**:<br>
[aneisch/follow_me_appdaemon](https://github.com/aneisch/follow_me_appdaemon)<br>
Expand Down
12 changes: 12 additions & 0 deletions automations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@
- sensor.guest_bathroom_toilet_water_detector_battery_level
- sensor.master_bathroom_water_detector_battery_level
- sensor.kitchen_sink_water_detector_battery_level
- sensor.dishwasher_water_detector_battery_level
- sensor.motion_1_battery_level
- sensor.living_room_motion_battery_level
- sensor.hallway_motion_battery
Expand Down Expand Up @@ -711,6 +712,17 @@
- delay: 00:00:30
- service: switch.turn_on
entity_id: switch.docker_appdaemon
- alias: Restart cellular_message_relay_sim7080g
id: restart_cellular_message_relay_sim7080g
trigger:
platform: time
at: 01:35:00
action:
- service: switch.turn_off
entity_id: switch.docker_cellular_message_relay_sim7080g
- delay: 00:00:45
- service: switch.turn_on
entity_id: switch.docker_cellular_message_relay_sim7080g
- alias: Deep Freeze Temperature
id: deep_freeze_temperature
initial_state: true
Expand Down
2 changes: 1 addition & 1 deletion custom_components/bhyve/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"documentation": "https://github.com/sebr/bhyve-home-assistant/blob/main/README.md",
"iot_class": "cloud_push",
"requirements": [],
"version": "3.2.2"
"version": "3.2.4"
}
10 changes: 8 additions & 2 deletions custom_components/bhyve/sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Support for Orbit BHyve sensors."""

import logging
from datetime import timedelta

Expand Down Expand Up @@ -145,7 +146,7 @@ def _on_ws_data(self, data):
#
event = data.get("event")
if event in (EVENT_BATTERY_STATUS):
battery_level = self.parse_battery_level(event)
battery_level = self.parse_battery_level(data)

self._state = battery_level
self._attrs[ATTR_BATTERY_LEVEL] = battery_level
Expand All @@ -172,8 +173,13 @@ def parse_battery_level(battery_data):
Returns:
float: The battery level as a percentage.
"""

if not isinstance(battery_data, dict):
_LOGGER.warning("Unexpected battery data, returning 0: %s", battery_data)
return 0

battery_level = battery_data.get("percent", 0)
if "mv" in battery_data:
if "mv" in battery_data and "percent" not in battery_data:
battery_level = min(battery_data.get("mv", 0) / 3000 * 100, 100)
return battery_level

Expand Down
20 changes: 10 additions & 10 deletions custom_components/sonoff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,16 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
raise ConfigEntryAuthFailed(e)
raise ConfigEntryNotReady(e)

if not config_entry.update_listeners:
config_entry.add_update_listener(async_update_options)

config_entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, registry.stop)
)

# important to run before registry.setup_devices (for remote childs)
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)

devices: list[dict] | None = None
store = Store(hass, 1, f"{DOMAIN}/{config_entry.data['username']}.json")

Expand Down Expand Up @@ -215,16 +225,6 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
else:
entities = None

if not config_entry.update_listeners:
config_entry.add_update_listener(async_update_options)

config_entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, registry.stop)
)

# this may only happen if async_setup_entry will fail
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)

if mode in ("auto", "cloud") and config_entry.data.get(CONF_PASSWORD):
registry.cloud.start(**config_entry.data)

Expand Down
13 changes: 4 additions & 9 deletions custom_components/sonoff/core/ewelink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,9 @@ def update_device(self, device: XDevice):

# SPM-4Relay - four channels, separate update for each channel
elif uiid == 130:
if self.can_local(device):
asyncio.create_task(self.update_spm_pow(device, False))
# https://github.com/AlexxIT/SonoffLAN/issues/1366
if self.can_cloud(device):
asyncio.create_task(self.update_spm_pow(device, True))
asyncio.create_task(self.update_spm_pow(device))

# checks if device still available via LAN
if "local_ts" not in device or device["local_ts"] > time.time():
Expand All @@ -353,16 +352,12 @@ def update_device(self, device: XDevice):
if self.local.online:
asyncio.create_task(self.check_offline(device))

async def update_spm_pow(self, device: XDevice, cloud_mode: bool):
async def update_spm_pow(self, device: XDevice):
for i in range(4):
if i > 0:
await asyncio.sleep(5)
params = {"uiActive": {"outlet": i, "time": 60}}
if cloud_mode:
await self.cloud.send(device, params, timeout=0)
else:
params["subDevId"] = device["deviceid"]
await self.local.send(device["parent"], params, command="statistics")
await self.cloud.send(device, params, timeout=0)

def can_cloud(self, device: XDevice) -> bool:
if not self.cloud.online:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/sonoff/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"requirements": [
"pycryptodome>=3.6.6"
],
"version": "3.7.1"
"version": "3.7.2"
}
2 changes: 1 addition & 1 deletion extras/Node-RED/flows.json

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions extras/docker-compose/other/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -460,15 +460,23 @@ services:
restart: 'always'
image: sickcodes/docker-osx:naked
labels:
com.centurylinklabs.watchtower.enable: "false"
- com.centurylinklabs.watchtower.enable=false
# HTTPS for CF
- traefik.enable=true
- traefik.http.routers.bb.entrypoints=websecure
- traefik.http.routers.bb.tls=true
- traefik.http.routers.bb.rule=Host(`bb.domain.com`)
- traefik.http.services.bb.loadbalancer.server.port=1234
- traefik.http.routers.bb.service=bb
ports:
- 50922:10022
- 127.0.0.1:1234:1234 # Bluebubbles API
- 5999:5999 # vnc
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- /opt/macos/mac.qcow2:/image # Backed up on nas /Backup/home-assistant/
networks:
- macos_network
# networks:
# - macos_network
environment:
- DISPLAY=${DISPLAY:-:0.0}
- GENERATE_SPECIFIC=true
Expand All @@ -479,6 +487,8 @@ services:
- MAC_ADDRESS=MAC
- EXTRA=-display none -vnc 0.0.0.0:99,password-secret=secvnc0 -object secret,id=secvnc0,data=vncpass
- TZ=America/Chicago
- ADDITIONAL_PORTS=hostfwd=tcp::1234-:1234,

devices:
- /dev/kvm
user: root
Expand Down
16 changes: 13 additions & 3 deletions extras/docker-compose/unified/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -674,15 +674,23 @@ services:
restart: 'always'
image: sickcodes/docker-osx:naked
labels:
com.centurylinklabs.watchtower.enable: "false"
- com.centurylinklabs.watchtower.enable=false
# HTTPS for CF
- traefik.enable=true
- traefik.http.routers.bb.entrypoints=websecure
- traefik.http.routers.bb.tls=true
- traefik.http.routers.bb.rule=Host(`bb.domain.com`)
- traefik.http.services.bb.loadbalancer.server.port=1234
- traefik.http.routers.bb.service=bb
ports:
- 50922:10022
- 127.0.0.1:1234:1234 # Bluebubbles API
- 5999:5999 # vnc
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- /opt/macos/mac.qcow2:/image # Backed up on nas /Backup/home-assistant/
networks:
- macos_network
# networks:
# - macos_network
environment:
- DISPLAY=${DISPLAY:-:0.0}
- GENERATE_SPECIFIC=true
Expand All @@ -693,6 +701,8 @@ services:
- MAC_ADDRESS=MAC
- EXTRA=-display none -vnc 0.0.0.0:99,password-secret=secvnc0 -object secret,id=secvnc0,data=vncpass
- TZ=America/Chicago
- ADDITIONAL_PORTS=hostfwd=tcp::1234-:1234,

devices:
- /dev/kvm
user: root
Expand Down
2 changes: 1 addition & 1 deletion extras/traefik/dynamic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ http:
theme: ghost
group: default
sablierUrl: http://sablier:10000
sessionDuration: 5m
sessionDuration: 30m

serversTransports:
skipVerify:
Expand Down
Binary file modified images/nodered_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/nodered_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions packages/leak_detection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ automation:
- if: "{{ trigger.id == 'minutes'
and states('sensor.flume_sensor_home_current') | float > 0
and is_state('switch.irrigation_master_valve', 'off')
and not (now().hour == 12 and now().minute in [0,1,2,3,4,5])
and not is_state('switch.bhyve_1','on')
and is_state('group.trackers', 'not_home' )
and is_state('input_boolean.guest_mode', 'off') }}"
Expand All @@ -60,7 +59,6 @@ automation:
- if: "{{ trigger.id == 'minutes'
and states('sensor.flume_sensor_home_current') | float > 2.5
and is_state('switch.irrigation_master_valve', 'off')
and not (now().hour == 12 and now().minute in [0,1,2,3,4,5])
and not is_state('switch.bhyve_1','on')
and is_state('group.trackers', 'home' )
and is_state('input_boolean.guest_mode', 'off') }}"
Expand Down Expand Up @@ -123,7 +121,7 @@ automation:
- binary_sensor.water_shutoff_water_detector
- binary_sensor.laundry_room_water_detector
- binary_sensor.kitchen_water_detector
- binary_sensor.misc_water_detector_in_office_cabinet_unused
- binary_sensor.dishwasher_water_detector
to: "on"
- platform: state
id: non_critial
Expand Down

0 comments on commit 8ef82bd

Please sign in to comment.