Closed thorrrr closed 2 years ago
Hey @thorrrr, so sorry the documentation is not working for you. One thing that might have confused you is that the wiki is written for the upcoming 3.0.0 release which differs in some aspects from the current stable 2.x. The blog post is entirely on 2.x tho.
This integration is a bit unorthodox as the configuration has a bit on yaml and a the rest over the UI.
In your configuration.yaml
you just need to add
magic_areas:
and after that the integration will be officially "installed". Upon first restart, the integration will cycle through all Areas you have created in Home Assistant and create a Magic Area
integration instance for it which you can manage through the UI.
The following explanation is considering the new 3.0.0-beta branch as I've been testing it for months and don't really remember how the configuration looks like on the 2.x much but the concepts are the same
Magic Areas works with the concepts of features, which you can read as "plug-ins" which provide different functionality. Users can opt into which ones they want to enable. The configuration flow has an initial screen which you have a few basic area settings and the next one will be where you tie the secondary states to arbitrary entity states from Home Assistant. These secondary states are used further in the features/plugins for different purposes (for example, the Automatic Light control aspect of the Light Groups feature requires an Area to have the dark
secondary state).
All the configuration options have some explanation on the configuration UI, let me know what other questions you have that I can help answering.
PS: Yes it takes a while to load as several calculations are done for some features and also we have to wait for other integrations to be done so we can have a full list of entities to work with. I'm still on the "make it work" phase of building this integration and I do plan in the future on doing some profiling to enhance those load times.
HI Jan Cheers for quick reply it is not your docs more my mental bock. I have in my setup Dwaines Dashboard so i can use HA on a wall mount. Part of that is setting up groups for each room I tried to think if your integration could be used but gave up as it didn’t get it . Like i mentioned do you have few examples of how you use it in an automation so i can see it visually ? I like what i read and it sounds like it helps a lot but it is not computing in my head :), I have asked other on Discord but they are a little stumped. I did look on Youtube to see if thee were anny guides but did not see any.
The idea is that Magic Areas offloads a lot of automations through the feature system. For example, automation for turning lights on and off automatically are handled by the Light Group (3.x) / Light Control (2.x) feature and so on but you can create your own.
Whenever you first install, Magic Areas will create a binary sensor for the area that will track if an area is occupied or not via the presence sensors in that area. Here's an example of one of my Area's binary_sensor
As you can see, there's a lot of entities that are used as presence state. You could use this binary_sensor as a trigger for when you want to perform actions whenever the room is occupied or not. I also have views for each room as you have and I use the "Aggregates" feature to show the overall motion, temp and luminosity levels and so on
Here's a shot of the aggregate sensor for temperature
Another feature (this one is on 3.x only) is the light groups and climate groups features that will automatically control lights and climate devices based on the occupancy status of an area
On the top row you see the light groups created by Magic Areas (Overhead, Task etc)
Here's the "Area Climate" group which will turn on any climate device in the area after it has been occupied for a while and off when the room is clear.
Hope that helps, let me know if you have other questions
HI Jan I have just installed Beta 3 to try new features and everything in MR has broke all entities saying not available ?
Did you got it from the releases tab or from the branch?
HI I picked it from HACS i had show Beta ?
Hmm that one might be slightly outdated. Lemme generate a new one
Logger: homeassistant.components.binary_sensor Source: custom_components/magic_areas/binary_sensor.py:223 Integration: Binary Sensor (documentation, issues) First occurred: 18:46:58 (44 occurrences) Last logged: 18:47:00
Error adding entities for domain binary_sensor with platform magic_areas Error while setting up magic_areas platform for binary_sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 747, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/magic_areas/binary_sensor.py", line 265, in async_added_to_hass await self._initialize() File "/config/custom_components/magic_areas/binary_sensor.py", line 290, in _initialize self.load_attributes() File "/config/custom_components/magic_areas/binary_sensor.py", line 223, in load_attributes for feature_name, opts in self.area.config.get( AttributeError: 'list' object has no attribute 'items'
Logger: custom_components.magic_areas.media_player Source: custom_components/magic_areas/media_player.py:114 Integration: Magic Areas (documentation, issues) First occurred: 18:46:58 (1 occurrences) Last logged: 18:46:58
No areas with media_player entities. Skipping creation of area-aware-media-player
Anyway it will break you current install because the configuration has been changed, you'll need to remove all instances of the integration from HA through the configuration UI and restart to have them re-created. I'm generating a new beta release now
So do i just mark it as remove in HACS?
Go to the integrations area on Home Assistant, you'll see something like this
Then click the entry, then the dots button and select Delete
Do this for all areas and restart.
Once I get the new release out you can update through HACS and then get it to deleting and restarting
i have deleted all areas and it disappeared so i restarted. Please let me know when Beta is ready
Even after restart
Logger: homeassistant.helpers.entity Source: helpers/entity.py:549 First occurred: 19:02:32 (21 occurrences) Last logged: 19:02:34
Entity binary_sensor.area_garden (<class 'custom_components.magic_areas.binary_sensor.AreaPresenceBinarySensor'>) implements device_state_attributes. Please report it to the custom component author. Entity binary_sensor.area_guest_bedroom_one (<class 'custom_components.magic_areas.binary_sensor.AreaPresenceBinarySensor'>) implements device_state_attributes. Please report it to the custom component author. Entity binary_sensor.area_global (<class 'custom_components.magic_areas.binary_sensor.AreaPresenceBinarySensor'>) implements device_state_attributes. Please report it to the custom component author. Entity binary_sensor.area_interior (<class 'custom_components.magic_areas.binary_sensor.AreaPresenceBinarySensor'>) implements device_state_attributes. Please report it to the custom component author. Entity binary_sensor.area_exterior (<class 'custom_components.magic_areas.binary_sensor.AreaPresenceBinarySensor'>) implements device_state_attributes. Please report it to the custom component author.
This is fixed on beta1, release is out https://github.com/jseidl/hass-magic_areas/releases/tag/3.0.0-beta1. It might take a bit for HACS to update it
Sorry for being thick how is it best to load this ?
When i try to remove from HACS i get this popup see here
Don't need to remove it, just update with the beta1 whenever it pops up.
If you DO need to remove it here's how to do it: https://github.com/jseidl/hass-magic_areas/wiki/Uninstalling
And thanks for testing out 3.x, it really helps and I understand it's quite a hassle to reconfigure the areas
If you go to hacs > integrations > search for Magic Areas and click the more button, you can force to pull the latest beta1 by clicking "Update infromation" then the beta1 should become available for updating
not sure what has happened none of my HACS intergrations are showing up on HACS page
That is weird, I just updated Magic Areas through HACS to beta1 and it worked fine.
Try reloading page / restarting?
i might have to re load a backup
i might have to re load a backup
That's really weird, integrations would not affect HACS itself AFAICT even if they were broken. Can you navigate to https://$YOUR_HA_IP:8123/hacs/integrations
ok got it back do i still need to removes each areas ? Like you said in https://github.com/jseidl/hass-magic_areas/issues/158#issuecomment-1005994506
If you had removed it before than the 3.x-beta shall have reconstructed it correctly and the update (beta1) wouldn't change it much. You only need to delete/restart/let it recreate if upgrading from 2x.
Did it worked?
I have rstored from 8 hours ago so everything is as it was nothing removed i now see a HACS upgrad for Magic Rooms
What i am saying is i am currently on ver 2 can i directly update now? Or do i still need to remove each room ?
Update, then before you restart remove all rooms then restart
it has loaded but not picked up my living room the old one did new ver not seeing it ???
You need to enable the Media player groups
feature. If you mean to use the media player as a presence sensor, then you need also to add playing
to the on_states
on the first configuration screen
No i mean it is not even picking up the motion sensors in the Living Room
Can you post a screenshot of the attributes of the binary_sensor.living_room
? Also double check that the sensors are in the Living Room
area in Home Assistant
Weird, didn't seems like it created any. Can you post a screenshot of the integration page, like this
Do you see "Living Room" on the list? If so, can you click the >
arrow then entities and post screenshot?
Nope that’s what i mean it is not in the list
wth... alright time to pull out the big guns
Can you set the log level for custom_components.magic_areas.binary_sensor
to debug
? If you don't currently have it defined, the full statement would look like this
logger:
default: warn
logs:
custom_components.magic_areas.binary_sensor: debug
Then restart & check/post the logs
Hmmm weird it seems to completely ignore the existence of the "Living Room" area.
Let's change a bit:
logger:
default: warn
logs:
custom_components.magic_areas: debug
custom_components.magic_areas.binary_sensor: warn
custom_components.magic_areas.light: warn
custom_components.magic_areas.climate: warn
custom_components.magic_areas.media_player: warn
custom_components.magic_areas.sensor: warn
custom_components.magic_areas.switch: warn
custom_components.magic_areas.cover: warn
custom_components.magic_areas.config_flow: warn
This shall give us the initializer logs while suppressing the other features for now. Don't forget to restart!
It's like the area didn't existed but I recall in a previous screenshot some devices assigned to a Living Room area. Just for peace of mind, can you double check the Areas section on Home Assistant and see if Living Room doesn't have any funny business? Should look something like this
Are there other areas not loading or only Living Room?
So Kitchen and Living Room are missing from my count. That is WEIRD. Trying to think of what's going on there....
Hey Jseidl I have had this installed for 12 months and i have read the professionally written blog and Wiki but my poor brain does not grasp how it works. Do you have any other blogs or examples on how you would use this in an example config format? I use many other installs which most i fully understand but this for some reason is a mental block for me.
On a side note this install is taking 89 to 110 seconds to load which seems terribly slow. Is this normal for this integration?