Xiaomi Wall switch + Kettle + Load Power automation help

Hey all,

So I’m trying to get my dumb kettle automated with HA.

I am using a Xiaomi Zigbee Wall switch to turn the kettle on.
I have created an automation that turns the switch off after 2 minutes (maximum time it takes to boil my kettle) and then sends a notification telling me the kettle is boiled.

However, I want the switch to turn off (and send the notification) based on the load_power attribute.
The problem is, the xiaomi switch doesn’t update the load_power attribute for about 4 minutes. It updates in real time in the Mi Home app, but for some reason it takes roughly 4 minutes in HA.

My question:
Does anyone know how to get the load_power attribute to update in real time (or close to) please?


For anyone curious, this is my current setup.

Automations.yaml:

- action:
  - delay: 00:02:00
  - data:
      entity_id: switch.plug_158d0001xxxxxxx
    service: switch.turn_off
  - data:
      message: Your kettle is boiled and ready to go.
      title: Kettle
    service: notify.ios_josephs_iphone
  alias: Kettle Off after 2 minutes
  condition: []
  id: '1518998764824'
  trigger:
  - entity_id: switch.plug_158d0001xxxxxx
    from: 'off'
    platform: state
    to: 'on'

Sensors.yaml:

  - platform: template
    sensors:
        kettle_current_power:
        friendly_name: 'Kettle Current Power'
        value_template: '{{float(states.switch.plug_158d0001xxxxxx.attributes.load_power)}}'
        unit_of_measurement: W

Groups.yaml:

kitchen:
name: Kitchen
entities:
- switch.plug_158d0001xxxxxx
- sensor.kettle_current_power

kettle

Try setting the scan_interval: https://home-assistant.io/docs/configuration/platform_options

I tried that. Config throws an error.

EDIT: Actually, where should I add this? In my customize.yaml file?

Okay, added scan_interval into customise.yaml and it now shows up when I tap/click the device.
However, load_power still doesn’t update relative to the scan interval.

Obviously the kettle isn’t staying on long enough, so I’m currently testing this with a lamp plugged into the switch.