notoriousbdg / Home-AssistantConfig

Apache License 2.0
180 stars 49 forks source link

Entity with battery_alert_disabled: true still notifies #26

Closed thijsvanbloemendaal closed 3 years ago

thijsvanbloemendaal commented 4 years ago

Hi,

Thanks for this great package. Gives great insights on all of my battery powered devices! I added information of my car to Home Assistant which also has some battery info which is irrelevant to be notified about. So I looked up the battery_alert_disabled: true customization, but I still receive notifications on the notify.notify notifier.

Example of my customize.yaml:

sensor.last_trip_average_electric_consumption:
  battery_alert_disabled: 'true'

Thanks for your help!

whoisdecoy commented 3 years ago

Have you also deleted the battery sensor that was made?

thijsvanbloemendaal commented 3 years ago

Hi @whoisdecoy. Thanks for your help. I tried to set the delete input field and ran the automation to delete, but this crashed my HA with error:

2021-01-06 08:35:19 ERROR (MainThread) [homeassistant.components.automation.delete_battery_sensor] delete_battery_sensor: Error executing script. Invalid data for call_service at pos 1: MQTT topic name/filter must not be empty. for dictionary value @ data['topic']
2021-01-06 08:35:19 ERROR (MainThread) [homeassistant.components.automation.delete_battery_sensor] While executing automation automation.delete_battery_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 433, in async_trigger
    await self.action_script.async_run(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1010, in async_run
    await asyncio.shield(run.async_run())
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 245, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 253, in _async_step
    await getattr(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1405, in async_call
    processed_data = handler.schema(service_data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: MQTT topic name/filter must not be empty. for dictionary value @ data['topic']
whoisdecoy commented 3 years ago

Did you modify the package at all? Any of the automations? Do you have all the automations turned on?

You can manually delete the MQTT sensor that is created and add the customize code to stop creation of the sensor again.

thijsvanbloemendaal commented 3 years ago

No @whoisdecoy , I haven't changed the package. All automations are enabled. How can I manually delete the MQTT sensor? I think I need to get it out of the group.battery_status entity, but can't find out how.

Thanks!

thijsvanbloemendaal commented 3 years ago

@whoisdecoy I've looked into my MQTT. I see some topics related to batteries, but not the one which notifies while the attribute is set. That entity also misses the attribute delete_battery_sensor, which I do see on other entities. So I'm confused now, why does it notify when there is no MQTT sensor? I see the entity that notifies in the list group.battery_status.

thijsvanbloemendaal commented 3 years ago

Somehow I fixed the issue. I've tried su much, not sure what fixed it. But after reinstalling the package the entity customization was cleared. So I've added the fields again and since there were no notifications on these entities.