Delay in template switch

Is it possible to set a delay before checking the switching result?

It’s just that my kettle does not have time to send a response and the switch automatically returns to the off state.

1 Like

i tried to do this but it doesn’t work

Welcome.

Please have a read of this: Help us help you - particularly point 11. When possible don’t post pictures of configuration text. Post the correctly formatted text instead. That way it is easier for people to copy edit and paste your code to help you towards the solution to your issue.

Try this concept

  1. Make a new binary_sensor
  2. Use the binary_sensor value as kettle on/off status value
  3. In the turn_on and turn_off scripts make them run 4 steps
    1. Do the actual turn_on or turn_off action. (in your case water_heater.set_operation_mode)
    2. Set the binary_sensor as on or off (this will instantly set the kettle as on or off)
    3. Delay for a few seconds
    4. Update the binary_sensor status with your original method (in your case water_heater.kettle_rk_g210s == ‘electric’ or not) this will update your kettle state to the actual state in case the turn_on or turn_off action has failed.

Did you get this working and if so, could you share your code please?