Mqtt new format - need help with existing tasmota devices

Can anyone help me convert these fan/light configurations to the new format?

I installed 5 fan/light controllers following this DIY writeup:

I get these log warnings:

* Manually configured MQTT light(s) found under platform key 'light', please move to the mqtt integration key, see https://www.home-assistant.io/integrations/light.mqtt/#new_format
* Manually configured MQTT fan(s) found under platform key 'fan', please move to the mqtt integration key, see https://www.home-assistant.io/integrations/fan.mqtt/#new_format

Currently I have these configurations

In configuration.yaml:

light: !include_dir_merge_list lights/
fan: !include_dir_merge_list fans/

In lights I have a tasmota.yaml:

- platform: mqtt
  name: "Living Room Light"
  unique_id: "living_room_light"
  state_topic: "tele/tasmota_67DB38/STATE"
  state_value_template: "{{ value_json.POWER2 }}"
  command_topic: "cmnd/tasmota_67DB38/POWER2"
  availability_topic: "tele/tasmota_67DB38/LWT"
  brightness_state_topic: "tele/tasmota_67DB38/STATE"
  brightness_command_topic: "cmnd/tasmota_67DB38/Dimmer"
  brightness_scale: 100
  brightness_value_template: "{{ value_json.Dimmer }}"
  payload_on: "ON"
  payload_off: "OFF"
  payload_available: "Online"
  payload_not_available: "Offline"

and in fans I have a tasmota.yaml:

- platform: mqtt
  name: "Living Room Fan"
  unique_id: "living_room_fan"
  qos: 1
  state_topic: "stat/tasmota_67DB38/POWER1"
  command_topic: "cmnd/tasmota_67DB38/POWER1"
  availability_topic: "tele/tasmota_67DB38/LWT"
  percentage_state_topic: "stat/tasmota_67DB38/speed"
  percentage_value_template: '{{ ((value | replace("3,","")) | int + 1) * 25 }}'
  percentage_command_topic: "cmnd/tasmota_67DB38/tuyasend4"
  percentage_command_template: "3,{{ ((value | int - 1) / 25) | int }}"
  preset_mode_state_topic: "stat/tasmota_67DB38/speed"
  preset_mode_value_template: '{{ value | replace("3,0", "turtle") | replace("3,1", "low") | replace("3,2", "medium") | replace("3,3", "high") }}'
  preset_mode_command_topic: "cmnd/tasmota_67DB38/tuyasend4"
  preset_mode_command_template: '{{ value | replace("turtle", "3,0") | replace("low", "3,1") | replace("medium", "3,2") | replace("high", "3,3") }}'
  preset_modes:
    - "turtle"
    - "low"
    - "medium"
    - "high"
  payload_available: "Online"
  payload_not_available: "Offline"
  payload_on: "ON"
  payload_off: "OFF"

So I tried to convert the light one over first and despite getting a valid configuration it won’t create the entities anymore:

in configuration.yaml I have substituted:

> light: !include_dir_merge_list lights/

with:
mqtt: !include_dir_merge_list mqtt/

and added this in the mqtt directory:

light:
  - name: "Living Room Light"
    unique_id: "living_room_light"
    state_topic: "tele/tasmota_67DB38/STATE"
    state_value_template: "{{ value_json.POWER2 }}"
    command_topic: "cmnd/tasmota_67DB38/POWER2"    
    availability_topic: "tele/tasmota_67DB38/LWT"
    brightness_state_topic: "tele/tasmota_67DB38/STATE"
    brightness_command_topic: "cmnd/tasmota_67DB38/Dimmer"
    brightness_scale: 100
    brightness_value_template: "{{ value_json.Dimmer }}"
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"

but it won’t create the light. what am I missing? I didn’t even try the fan.

1 Like

oh yep screwed that up.

fixed it works now.

# v lights_mqtt/
#   > tasmota.yaml
# v fans_mqtt/
#   > tasmota.yaml
mqtt:
  light: !include_dir_merge_list lights_mqtt/
  fan: !include_dir_merge_list fans_mqtt/