A binary sensors reports its state as on or off. Just look in the States page and you’ll see that. Your automation’s trigger should use on.
binary_sensor:
- platform: template
sensors:
washingmachine_idle:
friendly_name: 'Washing Machine Idle'
entity_id: switch.tvattmaskin
value_template: "{{ state_attr('switch.tvattmaskin', 'current_power_w') | replace(' W', '') | float < 1.5 }}"
automation:
alias: wm_done
trigger:
platform: state
entity_id: binary_sensor.washingmachine_idle
to: 'on'
action:
service: notify.ios_ivans_iphone
data:
title: "Washing is done."
message: "Washing machine stopped."