#:########################################################################################:# # Package: Kogan Kettle MQTT Control # File: kogan_kettle.yaml # Version: v1.0.0 # Date: 2022-10-11 # # Purpose: # Provides kettle temperature monitoring, power control, and selectable # keep-warm temperatures through a Tasmota/TuyaMCU MQTT interface. # # Behaviour: # - Reads temperature data from the kettle's TuyaReceived MQTT payload. # - Controls kettle power through its MQTT power command topic. # - Maps the keep-warm selector to the kettle's TuyaSend4 commands. # # Dependencies: # - Home Assistant MQTT integration and broker connectivity. # - The configured Tasmota/TuyaMCU kettle MQTT topics and payload structure. # # Known Limitation: # - P013-F026 records that temperature parsing assumes a fixed nested JSON # payload. Malformed or unrelated messages may cause template errors. # # Version History: # - v1.0.0 (2022-10-11): Initial kettle monitoring and control package. #:########################################################################################:# 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] }} '