bruxy70 / Garbage-Collection

🗑 Custom Home Assistant sensor for scheduling garbage collection (or other regularly re-occurring events - weekly on given days, semi-weekly or monthly)
MIT License
382 stars 90 forks source link

Issue adding schedule with blank frequency #351

Closed r-poulsen closed 2 years ago

r-poulsen commented 2 years ago

Before you submit a new bug report, please check that

Describe the bug

When adding a collection schedule with frequency blank, I am prompted to input additional parameters, with no parameters to input.

billede

Configuration

{ "home_assistant": { "installation_type": "Home Assistant OS", "version": "2022.2.5", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.9.7", "docker": true, "arch": "aarch64", "timezone": "Europe/Copenhagen", "os_name": "Linux", "os_version": "5.10.98", "supervisor": "2022.01.1", "host_os": "Home Assistant OS 7.4", "docker_version": "20.10.9", "chassis": "embedded", "run_as_root": true }, "custom_components": { "huesyncbox": { "version": "1.17.0", "requirements": [ "aiohuesyncbox==0.0.20" ] }, "iphonedetect": { "version": "1.4.0", "requirements": [] }, "eloverblik": { "version": "0.2.0", "requirements": [ "pyeloverblik==0.1.0" ] }, "zoom": { "version": "v0.8.2", "requirements": [] }, "ourgroceries": { "version": "1.3.10", "requirements": [ "ourgroceries==1.3.9" ] }, "average": { "version": "2.2.1", "requirements": [] }, "hacs": { "version": "1.22.0", "requirements": [ "aiogithubapi>=21.11.0" ] }, "slack_user": { "version": "0.4.1", "requirements": [ "slackclient==2.5.0" ] }, "spotcast": { "version": "v3.6.24", "requirements": [ "spotify_token==1.0.0" ] }, "garbage_collection": { "version": "4.4.2", "requirements": [ "python-dateutil>=2.8.1" ] }, "fuelfinder": { "version": "0.0.1", "requirements": [] } }, "integration_manifest": { "domain": "garbage_collection", "name": "Garbage Collection", "version": "4.4.2", "documentation": "https://github.com/bruxy70/Garbage-Collection/", "issue_tracker": "https://github.com/bruxy70/Garbage-Collection/issues", "iot_class": "calculated", "dependencies": [], "config_flow": true, "codeowners": [ "@bruxy70" ], "requirements": [ "python-dateutil>=2.8.1" ], "is_built_in": false }, "data": { "entity_id": "sensor.mad_restaffald", "state": 2, "attributes": { "next_date": "2022-02-17T00:00:00+01:00", "days": 7, "last_collection": "2022-02-03T10:27:58.388235+01:00", "last_updated": "2022-02-10T14:52:30.918758+01:00", "device_class": "garbage_collection__schedule" }, "config_entry": { "entry_id": "63cb9a14caa16dcecfbe691ec78e4abe", "version": 4, "domain": "garbage_collection", "title": "Mad/Restaffald", "data": { "unique_id": "7e84baea-cd4a-4077-9563-7a6944285e05", "frequency": "group", "icon_normal": "mdi:trash-can", "icon_today": "mdi:delete-restore", "icon_tomorrow": "mdi:delete-circle", "verbose_format": "on {date}, in {days} days", "date_format": "%d-%b-%Y", "entities": [ "sensor.mad_restaffald_hver_2_torsdag", "sensor.mad_restaffald_ekstra_afhentning" ] }, "options": {}, "pref_disable_new_entities": false, "pref_disable_polling": false, "source": "user", "unique_id": null, "disabled_by": null } } }

Debug logs

2022-02-10 15:09:52 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration iphonedetect which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-10 15:09:52 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration eloverblik which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-10 15:09:52 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration ourgroceries which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-10 15:09:52 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration huesyncbox which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-10 15:09:52 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration zoom which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-10 15:09:52 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration garbage_collection which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-10 15:09:52 WARNING (SyncWorker_8) [homeassistant.loader] We found a custom integration files which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-10 15:09:52 ERROR (SyncWorker_8) [homeassistant.loader] The custom integration 'files' does not have a version key in the manifest file and was blocked from loading. See https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes#versions for more details
2022-02-10 15:09:52 WARNING (SyncWorker_5) [homeassistant.loader] We found a custom integration average which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-10 15:09:52 WARNING (SyncWorker_7) [homeassistant.loader] We found a custom integration spotcast which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-10 15:09:52 WARNING (SyncWorker_6) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-10 15:09:52 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration fuelfinder which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-10 15:09:52 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration slack_user which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-02-10 15:10:12 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472998274864] Received invalid command: mobile_app/push_notification_channel
2022-02-10 15:10:14 WARNING (SyncWorker_5) [homeassistant.components.google] The 'max_results' option is deprecated, please remove it from your configuration
2022-02-10 15:10:14 WARNING (SyncWorker_5) [homeassistant.components.google] The 'max_results' option is deprecated, please remove it from your configuration
2022-02-10 15:10:14 DEBUG (MainThread) [custom_components.garbage_collection] Setting Mad/Restaffald - Hver 2. torsdag (odd-weeks) from ConfigFlow
2022-02-10 15:10:14 DEBUG (MainThread) [custom_components.garbage_collection] Setting Mad/Restaffald - Ekstra afhentning (even-weeks) from ConfigFlow
2022-02-10 15:10:14 DEBUG (MainThread) [custom_components.garbage_collection] Setting Metal/Glas (every-n-days) from ConfigFlow
2022-02-10 15:10:14 DEBUG (MainThread) [custom_components.garbage_collection] Setting Papir/Plastic og Fødevarekartoner (even-weeks) from ConfigFlow
2022-02-10 15:10:14 DEBUG (MainThread) [custom_components.garbage_collection] Setting Mad/Restaffald (group) from ConfigFlow
2022-02-10 15:10:14 DEBUG (MainThread) [custom_components.garbage_collection] Setting Pap (annual) from ConfigFlow
2022-02-10 15:10:15 WARNING (MainThread) [homeassistant.components.statistics.sensor] The configuration parameter 'state_characteristic' will become mandatory in a future release of the statistics integration. Please add 'state_characteristic: mean' to the configuration of sensor 'Eloverblik Monthly Statistics' to keep the current behavior. Read the documentation for further details: https://www.home-assistant.io/integrations/statistics/
2022-02-10 15:10:17 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'None' has no attribute 'name' when rendering '{{ states.switch.plug01.name}} Forbrug'
2022-02-10 15:10:17 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'None' has no attribute 'name' when rendering '{{ states.switch.plug01.name}} State'
2022-02-10 15:10:18 DEBUG (MainThread) [custom_components.garbage_collection.sensor] Creating garbage_collection calendar
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:19 WARNING (MainThread) [aiohue.util] Value {} of type <class 'dict'> is invalid for Device.identify, expected value of type typing.Optional[aiohue.v2.models.feature.IdentifyFeature]
2022-02-10 15:10:20 WARNING (MainThread) [homeassistant.components.climate] Platform netatmo not ready yet: None; Retrying in background in 30 seconds
2022-02-10 15:10:20 WARNING (MainThread) [homeassistant.components.light] Platform netatmo not ready yet: None; Retrying in background in 30 seconds
2022-02-10 15:10:20 WARNING (MainThread) [homeassistant.config_entries] Config entry 'My Smart Plug' for tplink integration not ready yet: Unable to connect to the device: None; Retrying in background
2022-02-10 15:10:20 WARNING (MainThread) [zigpy.zcl] Unknown cluster 61184
2022-02-10 15:10:20 WARNING (MainThread) [homeassistant.components.sensor] Platform netatmo not ready yet: None; Retrying in background in 30 seconds
2022-02-10 15:10:21 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.our_groceries (<class 'custom_components.ourgroceries.sensor.OurGroceriesSensor'>) implements device_state_attributes. Please report it to the custom component author.
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'int' got invalid input 'unknown' when rendering template '{% if ( states('sensor.time').replace(':','')|int >= states('sensor.time_quiet_start').replace(':','')|int or states('sensor.time').replace(':','')|int <= states('sensor.time_quiet_end').replace(':','')|int ) %}
  true
{% else %}
  false
{% endif %}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'int' got invalid input 'unknown' when rendering template '{% if ( states('sensor.time').replace(':','')|int >= states('sensor.time_quiet_start').replace(':','')|int or states('sensor.time').replace(':','')|int <= states('sensor.time_quiet_end').replace(':','')|int ) %}
  true
{% else %}
  false
{% endif %}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input '15:05' when rendering template '{{ states.sensor.groen_stroem_greenest_period_1_24.attributes["best-period-start"] | timestamp_custom("%H:%M") }}' but no default was specified. Currently 'timestamp_custom' will return '15:05', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input '15:05' when rendering template '{{ states.sensor.groen_stroem_greenest_period_1_24.attributes["best-period-start"] | timestamp_custom("%H:%M") }}' but no default was specified. Currently 'timestamp_custom' will return '15:05', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input '15:05' when rendering template '{{ states.sensor.groen_stroem_greenest_period_2_24.attributes["best-period-start"] | timestamp_custom("%H:%M") }}' but no default was specified. Currently 'timestamp_custom' will return '15:05', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input '15:05' when rendering template '{{ states.sensor.groen_stroem_greenest_period_2_24.attributes["best-period-start"] | timestamp_custom("%H:%M") }}' but no default was specified. Currently 'timestamp_custom' will return '15:05', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input '10:45' when rendering template '{{ states.sensor.groen_stroem_greenest_period_4_24.attributes["best-period-start"] | timestamp_custom("%H:%M") }}' but no default was specified. Currently 'timestamp_custom' will return '10:45', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input '10:45' when rendering template '{{ states.sensor.groen_stroem_greenest_period_4_24.attributes["best-period-start"] | timestamp_custom("%H:%M") }}' but no default was specified. Currently 'timestamp_custom' will return '10:45', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input '15:05' when rendering template '{{ states.sensor.groen_stroem_greenest_period_2_12.attributes["best-period-start"] | timestamp_custom("%H:%M") }}' but no default was specified. Currently 'timestamp_custom' will return '15:05', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input '15:05' when rendering template '{{ states.sensor.groen_stroem_greenest_period_2_12.attributes["best-period-start"] | timestamp_custom("%H:%M") }}' but no default was specified. Currently 'timestamp_custom' will return '15:05', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input '15:05' when rendering template '{{ states.sensor.groen_stroem_greenest_period_4_12.attributes["best-period-start"] | timestamp_custom("%H:%M") }}' but no default was specified. Currently 'timestamp_custom' will return '15:05', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'timestamp_custom' got invalid input '15:05' when rendering template '{{ states.sensor.groen_stroem_greenest_period_4_12.attributes["best-period-start"] | timestamp_custom("%H:%M") }}' but no default was specified. Currently 'timestamp_custom' will return '15:05', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ states.climate.netatmo_sovevaerelse.attributes["current_temperature"] | float }}")
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 407, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1814, in _render_with_context
    return template.render(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1291, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1584, in forgiving_float_filter
    return float(value)
jinja2.exceptions.UndefinedError: 'mappingproxy object' has no attribute 'current_temperature'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 523, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 409, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: UndefinedError: 'mappingproxy object' has no attribute 'current_temperature'
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('UndefinedError: 'mappingproxy object' has no attribute 'current_temperature'') while processing template 'Template("{{ states.climate.netatmo_sovevaerelse.attributes["current_temperature"] | float }}")' for attribute '_attr_native_value' in entity 'sensor.netatmo_thermostat_temperature_sovevaerelse'
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ states.climate.netatmo_stue.attributes["current_temperature"] | float }}")
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 407, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1814, in _render_with_context
    return template.render(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1291, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1584, in forgiving_float_filter
    return float(value)
jinja2.exceptions.UndefinedError: 'mappingproxy object' has no attribute 'current_temperature'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 523, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 409, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: UndefinedError: 'mappingproxy object' has no attribute 'current_temperature'
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('UndefinedError: 'mappingproxy object' has no attribute 'current_temperature'') while processing template 'Template("{{ states.climate.netatmo_stue.attributes["current_temperature"] | float }}")' for attribute '_attr_native_value' in entity 'sensor.netatmo_thermostat_temperature_stue'
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ states.climate.netatmo_daniels_vaerelse.attributes["current_temperature"] | float }}")
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 407, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1814, in _render_with_context
    return template.render(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1291, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1584, in forgiving_float_filter
    return float(value)
jinja2.exceptions.UndefinedError: 'mappingproxy object' has no attribute 'current_temperature'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 523, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 409, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: UndefinedError: 'mappingproxy object' has no attribute 'current_temperature'
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('UndefinedError: 'mappingproxy object' has no attribute 'current_temperature'') while processing template 'Template("{{ states.climate.netatmo_daniels_vaerelse.attributes["current_temperature"] | float }}")' for attribute '_attr_native_value' in entity 'sensor.netatmo_thermostat_temperature_daniels_vaerelse'
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ ( states.sensor.philips_motion_kontor_temperature.state | float * 2 ) | round(0) / 2  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ ( states.sensor.philips_motion_kontor_temperature.state | float * 2 ) | round(0) / 2  }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ states('sensor.weather_humidity') + ( states('sensor.humidity_static_threshold') / 10 ) | float }}")
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 407, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1814, in _render_with_context
    return template.render(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1291, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
TypeError: unsupported operand type(s) for /: 'str' and 'int'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 523, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 409, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: TypeError: unsupported operand type(s) for /: 'str' and 'int'
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('TypeError: unsupported operand type(s) for /: 'str' and 'int'') while processing template 'Template("{{ states('sensor.weather_humidity') + ( states('sensor.humidity_static_threshold') / 10 ) | float }}")' for attribute '_attr_native_value' in entity 'sensor.moisture_threshold'
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ states('sensor.moisture_threshold_avg') | float * 0.975 }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ states('sensor.moisture_threshold_avg') | float * 0.975 }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ states('sensor.moisture_threshold_avg') | float * 1.025 }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ states('sensor.moisture_threshold_avg') | float * 1.025 }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ states.switch.plug01.attributes["current_power_w"] | float }}")
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 407, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1814, in _render_with_context
    return template.render(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1291, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1584, in forgiving_float_filter
    return float(value)
jinja2.exceptions.UndefinedError: 'mappingproxy object' has no attribute 'current_power_w'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 523, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 409, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: UndefinedError: 'mappingproxy object' has no attribute 'current_power_w'
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('UndefinedError: 'mappingproxy object' has no attribute 'current_power_w'') while processing template 'Template("{{ states.switch.plug01.attributes["current_power_w"] | float }}")' for attribute '_attr_native_value' in entity 'sensor.plug01_watts'
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{% if states('sensor.plug01_watts')|float > 100 %}
  tændt - lader
{% elif states('sensor.plug01_watts')|float > 1 %}
  tændt - lader ikke
{% else %}
  slukket
{% endif %}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{% if states('sensor.plug01_watts')|float > 100 %}
  tændt - lader
{% elif states('sensor.plug01_watts')|float > 1 %}
  tændt - lader ikke
{% else %}
  slukket
{% endif %}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{% if states('sensor.plug01_watts')|float > 100 %}
  tændt - lader
{% elif states('sensor.plug01_watts')|float > 1 %}
  tændt - lader ikke
{% else %}
  slukket
{% endif %}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unavailable' when rendering template '{% if states('sensor.plug01_watts')|float > 100 %}
  tændt - lader
{% elif states('sensor.plug01_watts')|float > 1 %}
  tændt - lader ikke
{% else %}
  slukket
{% endif %}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'mappingproxy object' has no attribute 'temperature' when rendering '{{ states.climate.netatmo_stue.attributes["temperature"] }}'
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'mappingproxy object' has no attribute 'temperature' when rendering '{{ states.climate.netatmo_stue.attributes["temperature"] }}'
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'mappingproxy object' has no attribute 'battery_level' when rendering '{{ states.climate.netatmo_stue.attributes["battery_level"] }}'
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'mappingproxy object' has no attribute 'battery_level' when rendering '{{ states.climate.netatmo_stue.attributes["battery_level"] }}'
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'mappingproxy object' has no attribute 'temperature' when rendering '{{ states.climate.netatmo_sovevaerelse.attributes["temperature"] }}'
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'mappingproxy object' has no attribute 'temperature' when rendering '{{ states.climate.netatmo_sovevaerelse.attributes["temperature"] }}'
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'mappingproxy object' has no attribute 'temperature' when rendering '{{ states.climate.netatmo_daniels_vaerelse.attributes["temperature"] }}'
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'mappingproxy object' has no attribute 'temperature' when rendering '{{ states.climate.netatmo_daniels_vaerelse.attributes["temperature"] }}'
2022-02-10 15:10:35 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'mappingproxy object' has no attribute 'battery_level' when rendering '{{ states.climate.netatmo_stue.attributes["battery_level"] }}'
2022-02-10 15:10:35 ERROR (MainThread) [pyemby.server] Error fetching Emby data: 401
2022-02-10 15:10:35 ERROR (MainThread) [pyemby.server] Unable to register emby client.
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.components.sensor] Platform netatmo does not generate unique IDs. ID 3765576605-09:00:00:01:e2:82-battery_percent already exists - ignoring sensor.radiator_1_battery_percent
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.components.sensor] Platform netatmo does not generate unique IDs. ID 2611736816-09:00:00:01:e6:00-battery_percent already exists - ignoring sensor.radiator_2_battery_percent
2022-02-10 15:10:35 ERROR (MainThread) [homeassistant.components.sensor] Platform netatmo does not generate unique IDs. ID 2160617349-09:00:00:04:5e:a8-battery_percent already exists - ignoring sensor.radiator_3_battery_percent
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Hver 2. torsdag) Calling update
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Hver 2. torsdag) Dates loaded, firing a garbage_collection_loaded event
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Hver 2. torsdag) Looking for next collection
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Hver 2. torsdag) next_date (2022-02-17), today (2022-02-10)
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Hver 2. torsdag) Found next collection date: 17-Feb-2022, that is in 7 days
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Ekstra afhentning) Calling update
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Ekstra afhentning) 2021-01-01 outside the range, searching from may
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Ekstra afhentning) 2021-09-09 outside the range, lookig from may next year
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Ekstra afhentning) 2022-09-08 outside the range, lookig from may next year
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Ekstra afhentning) 2023-09-07 outside the range, lookig from may next year
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Ekstra afhentning) Dates loaded, firing a garbage_collection_loaded event
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Ekstra afhentning) Looking for next collection
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Ekstra afhentning) next_date (2022-05-05), today (2022-02-10)
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald - Ekstra afhentning) Found next collection date: 05-May-2022, that is in 84 days
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Metal/Glas) Calling update
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Metal/Glas) Dates loaded, firing a garbage_collection_loaded event
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Metal/Glas) Looking for next collection
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Metal/Glas) next_date (2022-02-23), today (2022-02-10)
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Metal/Glas) Found next collection date: 23-Feb-2022, that is in 13 days
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Papir/Plastic og Fødevarekartoner) Calling update
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Papir/Plastic og Fødevarekartoner) Dates loaded, firing a garbage_collection_loaded event
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Papir/Plastic og Fødevarekartoner) Looking for next collection
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Papir/Plastic og Fødevarekartoner) next_date (2022-02-23), today (2022-02-10)
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Papir/Plastic og Fødevarekartoner) Found next collection date: 23-Feb-2022, that is in 13 days
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Pap) Calling update
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Pap) Dates loaded, firing a garbage_collection_loaded event
2022-02-10 15:10:39 DEBUG (MainThread) [custom_components.garbage_collection] called add_date 2022-02-16 from sensor.pap
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection] called add_date 2022-03-16 from sensor.pap
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection] called add_date 2022-04-19 from sensor.pap
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection] called add_date 2022-05-18 from sensor.pap
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection] called add_date 2022-06-17 from sensor.pap
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection] called add_date 2022-07-19 from sensor.pap
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection] called add_date 2022-08-16 from sensor.pap
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection] called add_date 2022-09-16 from sensor.pap
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection] called add_date 2022-10-18 from sensor.pap
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection] called add_date 2022-11-15 from sensor.pap
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection] called add_date 2022-12-19 from sensor.pap
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection] called update_state for sensor.pap
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Pap) Looking for next collection
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Pap) next_date (2022-02-16), today (2022-02-10)
2022-02-10 15:10:40 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Pap) Found next collection date: 16-Feb-2022, that is in 6 days
2022-02-10 15:10:48 ERROR (MainThread) [zigpy.device] Failed to parse message (b'81840200') on cluster 32799, because Data is too short to contain 1 bytes
2022-02-10 15:10:49 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald) Calling update
2022-02-10 15:10:49 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald) Dates loaded, firing a garbage_collection_loaded event
2022-02-10 15:10:49 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald) Looking for next collection
2022-02-10 15:10:49 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald) next_date (2022-02-17), today (2022-02-10)
2022-02-10 15:10:49 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Mad/Restaffald) Found next collection date: 17-Feb-2022, that is in 7 days
2022-02-10 15:10:53 WARNING (SyncWorker_0) [custom_components.eloverblik] Exception: <class 'requests.exceptions.ReadTimeout'>
2022-02-10 15:11:06 ERROR (MainThread) [zigpy.device] Failed to parse message (b'8284011b') on cluster 32799, because Data is too short to contain 1 bytes
2022-02-10 15:11:20 ERROR (MainThread) [zigpy.device] Failed to parse message (b'8384011b') on cluster 32799, because Data is too short to contain 1 bytes
bruxy70 commented 2 years ago

ok, got it, missed that one. Thanks, will fix in next release.

bruxy70 commented 2 years ago

If this is not complicated for you, can you grab this from the repo https://github.com/bruxy70/Garbage-Collection/blob/master/custom_components/garbage_collection/config_flow.py Put in in your custom_components/garbage_collection, restart and let me know if everything else works? Thanks for help!

r-poulsen commented 2 years ago

Awesome, that works, thank you :-)