You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
multiscrape:
- resource: https://pollencount.co.za/scan_interval: 21600# 60*60*6 or 4 updates per daytimeout: 30sensor:
- name: Overall Pollen Riskicon: mdi:flower-pollen-outlineselect: "#wpv-view-layout-300 > div > div > div.image-resize > div:nth-child(2) > div:nth-child(2) > div"attribute: "class"value_template: >- {# set value = ["pollen-darkorange"] #} {%- from 'pollen.jinja' import color_level_map -%} {%- set key = value | first -%} {{ color_level_map[key] if key in color_level_map else "unknown" }}on_error:
value: lastattributes:
- name: Labelselect: "#wpv-view-layout-300 > div > div > div.image-resize > div:nth-child(2) > div:nth-child(2) > div"attribute: "class"value_template: >- {%- from 'pollen.jinja' import color_label_map -%} {%- set key = value | first -%} {{ color_label_map[key] if key in color_label_map else "Unavailable" }}on_error:
value: last
Automation:
automation:
- alias: "Pollen Levels Update"id: "eeb7f4a7-367d-4aee-b4d5-cf84da3b1323"initial_state: truetrigger:
# If only entity_id is given, the trigger will fire for all state changes, even if only state attributes change.# https://www.home-assistant.io/docs/automation/trigger/#state-trigger
- platform: stateentity_id:
- sensor.overall_pollen_risk
- sensor.tree_pollen
- sensor.grass_pollen
- sensor.weed_pollen
- sensor.mould_sporesmode: singleaction:
- service: notify.familydata:
title: "⛑️ Health"# https://community.home-assistant.io/t/trigger-to-from-attribute/325345# https://community.home-assistant.io/t/access-attribute-of-from-state/380497message: >- {%- macro build_item(sensor, name) -%} {%- set attribute = sensor.split('.')[1] -%} {%- set from = trigger.from_state.attributes[attribute] | lower -%} {%- set to = trigger.to_state.attributes[attribute] | lower -%} {%- if from != to and (from != 'unavailable' or to != 'unavailable') -%} {{ name }}: {{ from }} → {{ to }} {%- else -%} {{ name }}: {{ to }} {%- endif -%} {%- endmacro -%} {%- set sensors = [('sensor.tree_pollen', 'Trees'), ('sensor.grass_pollen', 'Grasses'), ('sensor.weed_pollen', 'Weeds'), ('sensor.mould_spores', 'Mould')] -%} {%- set summary = '' -%} {%- set from_state_label = trigger.from_state.attributes.label | lower -%} {%- set to_state_label = trigger.to_state.attributes.label | lower -%} {%- if from_state_label != to_state_label -%} {%- set summary = 'Pollen levels changed from ' ~ from_state_label ~ ' to ' ~ to_state_label ~ '.' -%} {%- else -%} {%- set summary = 'Pollen levels are ' ~ to_state_label ~ '.' -%} {%- endif -%} {{ summary }} {%- for (sensor, name) in sensors %} - {{ build_item(sensor, name) }} {%- endfor %}data:
group: "environment"url: homeassistant://navigate/lovelace/environment
Describe the bug
When I (res)start HA, I get a false positive notification from my automation. Given my automation config, it must be triggering on an attribute change, not the state.
Debug log
Automation trace info for the trigger:
this:
entity_id: automation.pollen_levels_updatestate: 'on'attributes:
id: eeb7f4a7-367d-4aee-b4d5-cf84da3b1323last_triggered: '2024-10-06T11:45:09.215926+00:00'mode: singlecurrent: 0friendly_name: Pollen Levels Updatelast_changed: '2024-10-07T15:54:37.348863+00:00'last_reported: '2024-10-07T15:54:37.348863+00:00'last_updated: '2024-10-07T15:54:37.348863+00:00'context:
id: 01J9KV13X4HTPMYTBVH2MFABGMparent_id: nulluser_id: nulltrigger:
id: '0'idx: '0'alias: nullplatform: stateentity_id: sensor.overall_pollen_riskfrom_state:
entity_id: sensor.overall_pollen_riskstate: '2'attributes:
label: Lowtree_pollen: Lowgrass_pollen: Very Lowweed_pollen: Very Lowmould_spores: Very Lowfriendly_name: Overall Pollen Riskunit_of_measurement: indexlast_changed: '2024-10-07T15:54:27.458505+00:00'last_reported: '2024-10-07T15:54:27.458505+00:00'last_updated: '2024-10-07T15:54:27.458505+00:00'context:
id: 01J9KV0T8262FWVYS3RFCWNBZYparent_id: nulluser_id: nullto_state:
entity_id: sensor.overall_pollen_riskstate: '2'attributes:
label: Lowtree_pollen: Lowgrass_pollen: Very Lowweed_pollen: Very Lowmould_spores: Very Lowicon: mdi:flower-pollen-outline # <---------- this seems to be the only difference, except for the last_* valuesfriendly_name: Overall Pollen Riskunit_of_measurement: indexlast_changed: '2024-10-07T15:54:27.458505+00:00'last_reported: '2024-10-07T15:54:56.620638+00:00'last_updated: '2024-10-07T15:54:56.620638+00:00'context:
id: 01J9KV1PQC2M6XE5Z1V02DZ0DRparent_id: nulluser_id: nullfor: nullattribute: nulldescription: state of sensor.overall_pollen_risk
The text was updated successfully, but these errors were encountered:
I upgraded HA from 2024.9.1 (or was it 2024.9.3) to 2024.10.1.
I don't remember the previous multiscrape version I upgraded from, but I generally update all my integrations when I upgrade HA.
I didn't notice this issue before, as in, I didn't previously have my pollen automation run soon after an HA restart. Perhaps this always happened, but something in the start-up order or order of async events is causing this. I cannot really say.
I have the exact same issue which started happening from the latest release v8.0.2. On startup of HA a change of state is triggered while the state is identical to before restarting. The sensor has no attributes. Happens for all sensors, seems related to 06cdc8a
Version of the custom_component
8.0.2
Configuration
Automation:
Describe the bug
When I (res)start HA, I get a false positive notification from my automation. Given my automation config, it must be triggering on an attribute change, not the state.
Debug log
Automation trace info for the trigger:
The text was updated successfully, but these errors were encountered: