Yea, that would be a nightmare . It’s already half a nightmare with all the HomeKit stuff flying around and MQTT, etc. I’ll wait for your test before I pull that particular trigger.
I can confirm your issue. Working on it, still unclear
Being a developer myself, I understand. When you are writing an upgrade that required a bunch of configuration.yaml entries and move to a more user friendly UI instead, yours probably worked great because those entries were there to start with and created all the required “hooks” needed to run things the way you expect, but a fresh install doesn’t have them. It’s easy to miss stuff like that, I’ve done it more than a few times myself .
The thing is that config_flow is still pretty mysterious to me. Once entries are added to the config flow it won’t load anymore (call the setup function) so it’s hard to test without reverting the VM and trying again.
Ouch, that sucks for testing!
I think I’ve found it. It was indeed config flow messed up. Doing a new full test and will release 2.0.3 in the next mins
PR in case you’re curious https://github.com/jseidl/hass-magic_areas/pull/87/files
That seems to have done the trick!
When I try setup magic areas in the integration page I get this message, when I search for area entities they are not showing area’s
Being quite new to Home Assistant, I get an error trying to use/integrate magic areas.
I’ve tried so far different possibilities, resulting all in the same error.
My configuration.yaml looks like:
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
http:
ssl_certificate: /config/.ssl/fullchain.pem
ssl_key: /config/.ssl/privkey.pem
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
logger: !include logger.yaml
sensor: !include_dir_merge_list sensors/
binary_sensor: !include_dir_merge_list binary_sensors/
device_tracker: !include_dir_merge_list device_tracker/
media_player: !include_dir_merge_list media_players/
switch: !include_dir_merge_list switches/
magic_areas: !include magicareas.yaml
homeassistant:
#customize: !include customize.yaml
customize: !include_dir_merge_named customize
and I’ve created a file called magicareas.yaml in the same directory with the following content:
buro:
include_entities:
- switch.allnet_plug
Even if I put everything in configuration.yaml, or if I do not add anything below magic_areas: in the configuration.yaml, I get the following error on startup:
Logger: homeassistant.setup
Source: custom_components/magic_areas/__init__.py:63
First occurred: 14:08:59 (1 occurrences)
Last logged: 14:08:59
Error during setup of component magic_areas
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
result = await task
File "/config/custom_components/magic_areas/__init__.py", line 63, in async_setup
areas.append(AreaEntry(name=meta_area, id=meta_area.lower()))
TypeError: __init__() missing 1 required positional argument: 'normalized_name'
Any ideas, what I’m doing wrong?
I’m getting this error also, was working fine until latest HA update
Was corrected.
After having seen the updated version (2.0.4) I finally got magic areas running, however, I’ve got some basic questions which I couldn’t find an answer in the description or elsewhere.
-
Are only binary sensors and media players supported? What about switches? If I use a custom switch, do I need to define a binary sensor to have the switch integrated in magic areas?
-
I still try to figure out how to use the configuration. Is it possible to include the configuration for magic areas in a separate file, using the !include-functin of HA? And if so, how do I achieve this?
-
I tried several ways to include a self defined binary sensor. The sensor itself works. I was not able to include the sensor.
I have several (shelly) devices which are assigned to areas but running magic_areas they are not auto assigned to the auto created areas of magic_areas. I tried putting the devices in the included_entries-section or by checking the sensors or switches directly in the integrations section. No success.
I also noticed, that changes to the presence_sensor_device_class in the integrations section, e. g. checking “power”, doesn’t do anything, whereas adding it in the configuration.yaml file seems to work (a look in the logfile shows that “power” was added)
Maybe someone can share his configuration or parts of it. Would be very helpful.
Thanks!
I’m trying to remove the magic areas. Uninstalled from hacs. Deleted all the areas entities. Deleted all the magic areas in integrations and the magic area integration disapeared but comes back always after reboot.Removed magic areas from yaml. It still shows up under integrations every reboot and I get this error on start up
Invalid config
The following integrations and platforms could not be set up:
- magic_areas
Please check your config and logs.
and this error in logs:
Logger: homeassistant.setup
Source: setup.py:172
First occurred: 10:37:29 PM (1 occurrences)
Last logged: 10:37:29 PM
Setup failed for magic_areas: Integration not found.
What am I missing?
Sorry for the delay, did you managed to get it working?
Are only binary sensors and media players supported? What about switches? If I use a custom switch, do I need to define a binary sensor to have the switch integrated in magic areas?
Binary sensors, media players and device_trackers are currently supported. If you want to use a switch you will indeed need a template binary sensor (prolly presence device class) to be able to use in MA
I still try to figure out how to use the configuration. Is it possible to include the configuration for magic areas in a separate file, using the !include-functin of HA? And if so, how do I achieve this?
Documentation has been lacking since the move from config_flow (2.x.x). Sorry about that. If you’re using packages, you can create a magic_areas.yaml with the magic_areas:
line on it. Everything else now is configured via the Web UI. To add new areas just create a regular area in HA and restart.
I tried several ways to include a self defined binary sensor. The sensor itself works. I was not able to include the sensor.
The binary sensor must be in one of those device classes hass-magic_areas/custom_components/magic_areas/const.py at 894bacd5e4881f5306d14d2fb3bee41c14b3eefa · jseidl/hass-magic_areas · GitHub or you can configure additional device classes in the area configuration in the UI
I have several (shelly) devices which are assigned to areas but running magic_areas they are not auto assigned to the auto created areas of magic_areas. I tried putting the devices in the included_entries-section or by checking the sensors or switches directly in the integrations section. No success.
They might be missing the appropriate device_class. Try adding via customize
I also noticed, that changes to the presence_sensor_device_class in the integrations section, e. g. checking “power”, doesn’t do anything, whereas adding it in the configuration.yaml file seems to work (a look in the logfile shows that “power” was added)
YAML configuration shouldn’t being used anymore. Try using the latest version because changing config should reload the area and start using your new power binary_sensor
I’m trying to remove the magic areas. Uninstalled from hacs. Deleted all the areas entities. Deleted all the magic areas in integrations and the magic area integration disapeared but comes back always after reboot.Removed magic areas from yaml. It still shows up under integrations every reboot and I get this error on start up
This is weird but I must admit that i never gave removal the proper testing, can you open an issue on github?
Hello,
i don’t want to open an issue.
I want to know, how you implatet an manual_on state in magic areas? in my case, i want to override automatic light, when i push a butten, or manual turn on light, or use google assistant…
I’m new in HA and want to implement these feature
Hi, I’m getting to love this integration!! But is there any way to populate a Lovelace control with the Magic Areas information? For example, populate an Entities control with all the lights in an Area?
I appreciate this can be done using filters - but Magic Areas already has this information so it would be good if this could be automatically be used to populate (and update on any changes) a control,