c-st / auto_areas Goto Github PK
View Code? Open in Web Editor NEW๐ค A custom component for Home Assistant which automates your areas.
License: MIT License
๐ค A custom component for Home Assistant which automates your areas.
License: MIT License
version | core-2023.6.3
installation_type | Home Assistant OS
dev | false
hassio | true
docker | true
user | root
virtualenv | false
python_version | 3.11.4
os_name | Linux
os_version | 6.1.21-v8
arch | aarch64
host_os | Home Assistant OS 10.3
update_channel | stable
supervisor_version | supervisor-2023.06.2
agent_version | 1.5.1
docker_version | 23.0.6
The app itself works well, but there are problems with the switches.
Sometimes I have the problem that, for example, the sleep mode can be activated initially. Later (sporadically) it jumps back to disabled and can no longer be switched on.
I just noticed it when I deleted another integration.
When I restart Homeassistant, this error is briefly resolved.
The whole thing also affects every created room and not just individual ones.
2023-06-26 15:01:46.498 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.501 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.505 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.507 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.510 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.512 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.514 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.517 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.521 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.525 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.528 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.530 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.533 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
2023-06-26 15:01:46.535 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.kuche or it is/they are currently not available
No response
Measurement values for
temperature
(avg)humidity
(max)illuminance
(min)from multiple devices are aggregated per area and exposed as additional sensors (for example sensor.area_temperature_bedroom
).
Is your feature request related to a problem? Please describe.
I do not need automatic lighting in all areas.
"Downstairs", "Garage" & "Bathroom" would be the only areas needing 24x7 artificial lighting.
Describe the solution you'd like
Additional entitiies utilized to control automatic lighting.
Eg.
Describe alternatives you've considered
Create automations to control the area_presence_lock entity, which is kludgy!
Additional context
None.
A new cover
entity for all covers in an area is created. This can be used to quickly
all shades in an area at the same time.
Considerations:
v1.0.3
auto_areas:
bedroom:
is_sleeping_area: true
"It checks each of your areas for relevant devices and starts managing them automatically. Additionally, it creates a few sensors and switches which allow you to adjust its behaviour as needed." - As it stands now, it manages all of my areas, even if there are no motion, occupancy or presence sensors in the area.
N/A
This system is very cool but until the user sets it up completely, there should be a general on/off switch that turns Auto Areas completely on and off so it doesn't interfere with existing automations.
Currently auto_areas assumes that ALL lights assigned to a room should be turned on (full) upon entry to the room.
Ideally, a scene could be assigned for room entry which allows setting which lights to turn on, at what dimmable level, as well as other devices in a room that might be turned on (e.g. a fan, or climate setting). For leaving a room, a second scene would be needed to set the "away" settings for a room.
area_id
for automatically created entitiesLights do not stay off if a minimum illuminance is configured.
n/a
Any
n/a
This custom integration uses deprecated DEVICE_CLASS_*
constants in its codebase.
The DEVICE_CLASS_*
constants have been deprecated and replaced in Home Assistant Core 2021.12 (over a year ago). I would highly suggest updating/migrating this integration to the new enums.
For example, for the device classes supported by the sensor
platform, there is now a SensorDeviceClass
enum. So if a sensor previously used the DEVICE_CLASS_ENERGY
constant, it should now use SensorDeviceClass.ENERGY
. Other platforms (like binary_sensor
, and number
) provide similar enumerations for their supported device classes.
The migration thus only consists of replacing constants with an enumeration member and is, therefore, very low impact and should be fairly straightforward.
If I can help resolve any questions regarding this change or migration, feel free to ask or respond to this issue. I'm happy to help!
Kindest regards,
../Frenck
n/a
Auto Areas uses deprecated functionality from HA:
2023-01-10 21:58:25.604 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that uses deprecated `async_get_registry` to access area registry, use async_get instead. Please report issue to the custom integration author for auto_areas using this method at custom_components/auto_areas/binary_sensor.py, line 27: area_registry: AreaRegistry = await hass.helpers.area_registry.async_get_registry()
2023-01-10 21:58:25.611 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that uses deprecated `async_get_registry` to access entity registry, use async_get instead. Please report issue to the custom integration author for auto_areas using this method at custom_components/auto_areas/binary_sensor.py, line 29: await hass.helpers.entity_registry.async_get_registry()
2023-01-10 21:58:25.619 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that uses deprecated `async_get_registry` to access device registry, use async_get instead. Please report issue to the custom integration author for auto_areas using this method at custom_components/auto_areas/binary_sensor.py, line 32: await hass.helpers.device_registry.async_get_registry()
version | core-2023.5.3 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.10.11 |
os_name | Linux |
os_version | 6.1.25 |
arch | aarch64 |
timezone | Europe/Amsterdam |
config_dir | /config |
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 5000 |
Installed Version | 1.32.1 |
Stage | running |
Available Repositories | 1294 |
Downloaded Repositories | 57 |
HACS Data | ok |
can_reach_server | ok |
---|---|
remaining_requests | 26 |
logged_in | true |
---|---|
subscription_expiration | August 1, 2023 at 2:00 AM |
relayer_connected | true |
relayer_region | eu-central-1 |
remote_enabled | true |
remote_connected | true |
alexa_enabled | false |
google_enabled | true |
remote_server | eu-central-1-10.ui.nabu.casa |
certificate_status | ready |
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
host_os | Home Assistant OS 10.1 |
---|---|
update_channel | stable |
supervisor_version | supervisor-2023.04.1 |
agent_version | 1.5.1 |
docker_version | 23.0.3 |
disk_total | 117.3 GB |
disk_used | 38.0 GB |
healthy | true |
supported | true |
board | odroid-n2 |
supervisor_api | ok |
version_api | ok |
installed_addons | Home Assistant Google Drive Backup (0.107.2), AppDaemon (0.13.0), File editor (5.6.0), Glances (0.19.2), Mosquitto broker (6.2.1), Samba share (10.0.1), Terminal & SSH (9.7.0), Log Viewer (0.15.1), ESPHome (2023.5.3), Studio Code Server (5.6.0), Rhasspy Assistant (2.5.11), Dutch TTS voice (rdh) (1.0.3), FTP (4.7.0), InfluxDB (4.7.0), Grafana (8.3.0), Music Assistant BETA (2.0.0b30), Node-RED (14.2.0) |
dashboards | 1 |
---|---|
resources | 30 |
views | 16 |
mode | yaml |
oldest_recorder_run | May 13, 2023 at 2:22 PM |
---|---|
current_recorder_run | May 23, 2023 at 3:58 PM |
estimated_db_size | 1624.13 MiB |
database_engine | sqlite |
database_version | 3.40.1 |
version | 3.5.1 (122751c) |
---|---|
cloud_online | 1 / 2 |
local_online | 1 / 1 |
logged_in | true |
---|---|
can_reach_micloud_server | ok |
accounts_count | 1 |
account_devices_count | 4 |
added_devices | 1 |
When I try to configure an area I get the following error:
Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble
...
see attachment
NA
Hey, this looks great but also closely resembles magic_areas integration. Maybe you can combine forces?
https://github.com/jseidl/hass-magic_areas
Have 1 integration that is better than choosing between 2
See above
None needed
brightness below n lux
)Define how to handle:
If scenes are found which are named according to a given pattern, they will automatically be used - no configuration necessary.
Suggestion by @rsnodgrass
# Auto discovery of scenes ... decided EXPLICIT scene setting is better for V1
# self.presence_scene_entity_id = f"scene.{self.area_name}_presence"
# self.goodbye_scene_entity_id = f"scene.{self.area_name}_goodbye"
# for entity in all_entities:
# if not entity.domain in SCENE_DOMAIN:
# continue
# if 'Presence' in entity.name:
# self.presence_scene_entity_id = ''
The motivation behind presence lock is to keep the light from going out if there is not much movement in an area. However, if forgotten It will keep the lights on indefinitely.
Discover how it could be reset automatically:
Additionally it should be disabled if:
It seems a shame Magic Areas couldn't be improved to add your requirements, given MA's wide feature set and Jan's appreciation for dev support.
Measurement values for
temperature
humidity
illuminance
pressure
from multiple devices are aggregated per area (median) and exposed as additional sensors (for example sensor.area_temperature_bedroom
).
Also the presence of all areas could be aggregated in a single binary_sensor.any_area_occupied
that determines if ANY of the areas occupancy switches are on (device_class: presence
) (cc @rsnodgrass)
Sometimes an area is occupied but the motion sensors are not receiving enough movement. For example this could be happening if someone is reading. In order to avoid clearing presence an additional switch could be added.
If enabled, this switch locks presence and avoids that the lights turn off.
I would like to include switches as well as lights, as we have zonoff mini switches in our bathrooms that control fans and lights and so I can't control just the light without the switch also being on.
For an Area to have the option to include switches as well that are triggered along with the lights.
Automations, but this would just make life easier as they can be a pain.
None
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.