vacuum: - platform: template vacuums: kabum500: friendly_name: KaBuM! Smart 500 unique_id: kabum500 value_template: "{{ states('sensor.kabum500_state') }}" battery_level_template: "{{ states('sensor.kabum500_battery') }}" fan_speed_template: "{{ states('input_select.kabum500_suction') }}" start: service: script.kabum500_start pause: service: switch.turn_off entity_id: switch.kabum500_power_go stop: service: input_select.select_option data: entity_id: input_select.kabum500_mode option: "Em Espera" return_to_base: service: input_select.select_option data: entity_id: input_select.kabum500_mode option: "Retornar" locate: service: script.kabum500_locate set_fan_speed: service: input_select.select_option data_template: entity_id: input_select.kabum500_suction option: "{{ fan_speed }}" fan_speeds: - "Mínimo" - "Médio" - "Máximo" attribute_templates: status: "{{ states('sensor.kabum500_state_ptbr') }}" mqtt: sensor: - unique_id: kabum500_state name: "KaBuM500 State" state_topic: tele/kabum500/RESULT value_template: > {% if value_json['TuyaReceived'].DpType4Id28 is defined %} {% set value = value_json.TuyaReceived['28'].DpIdData %} {% if value == "00" %} idle {% elif value == "01" %} cleaning {% elif value == "02" %} error {% elif value == "03" %} idle {% elif value == "04" %} idle {% elif value == "05" %} docked {% elif value == "06" %} docked {% elif value == "07" %} paused {% elif value == "08" %} cleaning {% elif value == "09" %} cleaning {% elif value == "0A" %} returning {% endif %} {% else %} {{ states('sensor.kabum500_state') }} {% endif %} - unique_id: kabum500_state_ptbr name: "KaBuM500 State ptbr" state_topic: tele/kabum500/RESULT value_template: > {% if value_json['TuyaReceived'].DpType4Id28 is defined %} {% set value = value_json.TuyaReceived['28'].DpIdData %} {% if value == "00" %} Em Espera {% elif value == "01" %} Trabalhando {% elif value == "02" %} Erro {% elif value == "03" %} Dormindo {% elif value == "04" %} Trabalho Finalizado {% elif value == "05" %} Recarregando {% elif value == "06" %} Recarga Completa {% elif value == "07" %} Pausado {% elif value == "08" %} Aspirando {% elif value == "09" %} Passando Pano {% elif value == "0A" %} Retornando {% endif %} {% else %} {{ states('sensor.kabum500_state_ptbr') }} {% endif %} - unique_id: kabum500_suction_speed name: "KaBuM500 Suction Speed" state_topic: tele/kabum500/RESULT value_template: > {% if value_json['TuyaReceived'].DpType4Id30 is defined %} {% set value = value_json.TuyaReceived['30'].DpIdData %} {% if value == "00" %} Mínimo {% elif value == "01" %} Médio {% elif value == "02" %} Máximo {% endif %} {% else %} {{ states('sensor.kabum500_suction_speed') }} {% endif %} - unique_id: kabum500_battery name: "KaBuM500 Battery" state_topic: tele/kabum500/RESULT device_class: battery value_template: > {% if value_json['TuyaReceived'].DpType2Id14 is defined %} {{ int(value_json['TuyaReceived'].DpType2Id14) }} {% else %} {{ states('sensor.kabum500_battery') }} {% endif %} - unique_id: kabum500_area name: "KaBuM500 Area" state_topic: tele/kabum500/RESULT value_template: > {% if value_json['TuyaReceived'].DpType2Id32 is defined %} {{ int(value_json['TuyaReceived'].DpType2Id32) }} {% else %} {{ states('sensor.kabum500_area') }} {% endif %} - unique_id: kabum500_time name: "KaBuM500 Time" state_topic: tele/kabum500/RESULT value_template: > {% if value_json['TuyaReceived'].DpType2Id33 is defined %} {{ int(value_json['TuyaReceived'].DpType2Id33) }} {% else %} {{ states('sensor.kabum500_time') }} {% endif %} - unique_id: kabum500_error name: "KaBuM500 Error" state_topic: tele/kabum500/RESULT value_template: > {% if value_json['TuyaReceived'].DpType5Id11 is defined %} {% set value = value_json.TuyaReceived['11'].DpIdData %} {% if value == "00" %} Sem erro {% elif value == "04" %} ??? 04 {% elif value == "10" %} Robô fora do chão {% elif value == "20" %} ??? 20 {% elif value == "0200" %} ??? 0200 {% elif value == "8000" %} Mova o robô para uma área aberta {% elif value == "0800" %} Motor enroscado {% else %} {% set value = "Erro desconhecido: " ~ value %} {{ value }} {% endif %} {% elif states('sensor.kabum500_error') == "unknown" %} Sem erro {% else %} {{ states('sensor.kabum500_error') }} {% endif %} switch: - unique_id: kabum500_sleep_wake name: "KaBuM500 Sleep" icon: mdi:robot-vacuum state_topic: tele/kabum500/RESULT command_topic: cmnd/kabum500/TuyaSend1 value_template: > {% if value_json['TuyaReceived'].DpType1Id1 is defined %} {% if value_json['TuyaReceived'].DpType1Id1 == 0 %} OFF {% else %} ON {% endif %} {% else %} {{ states('switch.kabum500_sleep_wake') }} {% endif %} payload_on: "1,1" payload_off: "1,0" state_on: "ON" state_off: "OFF" qos: 1 retain: false - unique_id: kabum500_power_go name: "KaBuM500 Power go" icon: mdi:robot-vacuum state_topic: tele/kabum500/RESULT command_topic: cmnd/KaBuM500/TuyaSend1 value_template: > {% if value_json['TuyaReceived'].DpType1Id25 is defined %} {% if value_json['TuyaReceived'].DpType1Id25 == 0 %} OFF {% else %} ON {% endif %} {% else %} {{ states('switch.kabum500_power_go') }} {% endif %} payload_on: "25,1" payload_off: "25,0" state_on: "ON" # Start state_off: "OFF" # Pause qos: 1 retain: false - unique_id: kabum500_mute name: "KaBuM500 Mute" icon: mdi:robot-vacuum state_topic: tele/kabum500/RESULT command_topic: cmnd/KaBuM500/TuyaSend1 value_template: > {% if value_json['TuyaReceived'].DpType1Id31 is defined %} {% if value_json['TuyaReceived'].DpType1Id31 == 0 %} OFF {% else %} ON {% endif %} {% else %} {{ states('switch.kabum500_mute') }} {% endif %} payload_on: "25,1" payload_off: "25,0" state_on: "ON" # Start state_off: "OFF" # Pause qos: 1 retain: false input_select: kabum500_mode: name: KaBuM500 Modes initial: "Em Espera" options: - "Em Espera" - "Inteligente" - "Espiral" - "Single" - "Cantos" - "Retornar" kabum500_user_mode: name: KaBuM500 User Modes initial: "Inteligente" options: - "Inteligente" - "Espiral" - "Single" - "Cantos" kabum500_suction: name: KaBuM500 suction initial: "Médio" options: - "Mínimo" - "Médio" - "Máximo" script: kabum500_start: sequence: - service: input_select.select_option data: entity_id: input_select.kabum500_mode option: "Inteligente" - service: switch.turn_on entity_id: switch.kabum500_power_go #Working Mode kabum500_send_working_mode: sequence: - service: mqtt.publish data_template: topic: cmnd/kabum500/TuyaSend4 payload_template: > {% if is_state("input_select.kabum500_mode", "Em Espera") %} 27,0 {% elif is_state("input_select.kabum500_mode", "Inteligente") %} 27,1 {% elif is_state("input_select.kabum500_mode", "Espiral") %} 27,2 {% elif is_state("input_select.kabum500_mode", "Single") %} 27,3 {% elif is_state("input_select.kabum500_mode", "Cantos") %} 27,4 {% elif is_state("input_select.kabum500_mode", "Retornar") %} 27,5 {% endif %} #Suction Power kabum500_send_suction: sequence: - service: mqtt.publish data_template: topic: cmnd/kabum500/TuyaSend4 payload_template: > {% if is_state("input_select.kabum500_suction", "Mínimo") %} 30,0 {% elif is_state("input_select.kabum500_suction", "Médio") %} 30,1 {% elif is_state("input_select.kabum500_suction", "Máximo") %} 30,2 {% endif %} #Front kabum500_dpid26_direction_front: sequence: - service: mqtt.publish data_template: topic: cmnd/kabum500/TuyaSend4 payload: 26,0 #Back kabum500_dpid26_direction_back: sequence: - service: mqtt.publish data_template: topic: cmnd/kabum500/TuyaSend4 payload: 26,1 #Turn Left kabum500_dpid26_direction_left: sequence: - service: mqtt.publish data_template: topic: cmnd/kabum500/TuyaSend4 payload: 26,2 #Turn Right kabum500_dpid26_direction_right: sequence: - service: mqtt.publish data_template: topic: cmnd/kabum500/TuyaSend4 payload: 26,3 #Stop kabum500_dpid26_direction_stop: sequence: - service: mqtt.publish data_template: topic: cmnd/kabum500/TuyaSend4 payload: 26,4 #Pause kabum500_dpid26_direction_pause: sequence: - service: mqtt.publish data_template: topic: cmnd/kabum500/TuyaSend1 payload: 25,0 #Resume kabum500_dpid26_direction_resume: sequence: - service: mqtt.publish data_template: topic: cmnd/kabum500/TuyaSend1 payload: 25,1 #Locate kabum500_locate: sequence: - service: mqtt.publish data_template: topic: cmnd/kabum500/TuyaSend1 payload: 29,1 automation: - alias: "KaBuM500 Send Working Mode" trigger: - platform: state entity_id: input_select.kabum500_mode action: service: script.kabum500_send_working_mode - alias: "KaBuM500 Send Suction" trigger: - platform: state entity_id: input_select.kabum500_suction action: service: script.kabum500_send_suction