mqtt: sensor: - unique_id: kettle.temp name: "Kettle Temperature" state_topic: "tele/tasmo-kkettle-3773-portable/RESULT" availability_topic: "tele/tasmo-kkettle-3773-portable/LWT" payload_available: "Online" payload_not_available: "Offline" value_template: > {% if value_json.TuyaReceived['5'].DpIdData %} {{ value_json.TuyaReceived['5'].DpIdData | int(base=16) }} {% else %} {{ states('sensor.kettle_temp') }} {% endif %} unit_of_measurement: "°C" switch: - unique_id: kettle.power name: kettle state_topic: "stat/tasmo-kkettle-3773-portable/POWER" command_topic: "cmnd/tasmo-kkettle-3773-portable/POWER" availability_topic: "tele/tasmo-kkettle-3773-portable/LWT" payload_on: "ON" payload_off: "OFF" payload_available: "Online" payload_not_available: "Offline" retain: false input_select: kettle_set: name: Keep Kettle Warm initial: "OFF" options: - "OFF" - "40°C" - "50°C" - "60°C" - "80°C" - "90°C" automation: - id: set_the_kettle initial_state: true alias: Set the Kettle trigger: platform: state entity_id: input_select.kettle_set action: service: mqtt.publish data: topic: cmnd/tasmo-kkettle-3773-portable/TuyaSend4 payload: '{% set mapping = { "OFF":"102,5", "40°C":"102,0", "50°C":"102,1", "60°C":"102,2", "80°C":"102,3", "90°C":"102,4" } %} {% set dta = trigger.to_state.state %} {{ mapping[dta] }} '