Next you’re going to need a way to run this script (let’s call it python_script.update_total_sensors for this example.) I think something like this should work for you:
- alias: Update sensor.total_sensors
trigger:
platform: event
event_type: state_changed
event_data:
new_state:
domain: sensor
condition:
condition: template
value_template: "{{ trigger.event.data.entity_id.endswith('actueel') }}"
action:
service: python_script.update_total_sensors
EDIT: Added further filtering to only run the script if the domain is sensor. Not 100% sure this will work. If not, then the domain filtering can definitely be done in the template condition.