The 'value_template' option is deprecated, please replace it with 'state_value_template'

Hey all

I have some warning on log constantly popping out:
“The ‘value_template’ option is deprecated, please replace it with ‘state_value_template’”

I’ve searched on my configuration, however I cannot find where should i fix this. It should be an error coming from light.mqtt.

my configuration.yaml code:

- platform: mqtt
  name: "Sala da Pranzo"
  state_topic: "shellies/shelly1-E8DB84D256C0/relay/0"
  command_topic: "shellies/shelly1-E8DB84D256C0/relay/0/command"
  qos: 0
  payload_on: "on"
  payload_off: "off"
  optimistic: false
  retain: false
- platform: mqtt
  schema: template
  name: 'Soggiorno1'
  command_topic: 'cmnd/soggiorno/Backlog'
  command_on_template: >-
      {%- if transition is defined -%}
      Speed {% if transition < 21 %}{{ transition * 2 }}{% else %}40{% endif %}; Fade 1; 
      {% else %}
      Speed 1; Fade 1;
      {% endif %}
      {% if brightness is defined %}
      Dimmer {{ (brightness / 2.55) | int }}; 
      {% endif %}
      {%- if red is defined and green is defined and blue is defined -%}
      Color2 {{ "%02X" | format(red | int) }}{{ "%02X" | format(green | int) }}{{ "%02X" | format(blue | int) }}; 
      {%- endif -%}
      {% if state is defined %}
      Power 1; 
      {% endif %}
      {%- if color_temp is defined -%}
      CT {{ color_temp }}; 
      {%- endif -%}
    - "None"
    - "Wakeup"
    - "Color Cycle"
    - "Reverse Cycle"
    - "Random"
  effect_template: >-
    {% if value_json.Scheme == 0 %}
    {% elif value_json.Scheme == 1 %}
    {% elif value_json.Scheme == 2 %}
    Color Cycle 
    {% elif value_json.Scheme == 3 %}
    Reverse Cycle 
    {% elif value_json.Scheme == 4 %}
    {% endif %}
  command_off_template: 'Power 0'
  state_topic: 'tele/soggiorno/STATE'
  state_template: '{{ value_json.POWER | lower }}'
  availability_topic: 'tele/soggiorno/LWT'
  payload_available: 'Online'
  payload_not_available: 'Offline'
  brightness_template: '{{ (value_json.Dimmer * 2.55) | int }}'
  red_template: '{{ value_json.Color[0:2] | int(base=16) }}'
  green_template: '{{ value_json.Color[2:4] | int(base=16) }}'
  blue_template: '{{ value_json.Color[4:6] | int(base=16) }}'
  color_temp_template: '{{ value_json.CT }}'
  max_mireds: 500
  min_mireds: 153

I know is just a deprecation warning, but i want to be sure that when going to update everything works, or i get a divorce :rofl:


1 Like

Are you sure?

The error is complaining about “value_template”. You don’t have that in the code you posted.

Logger says it comes from mqtt.light

Do you have any lights connected via MQTT discovery? I suspect it would cause that warning if the discovery payload has value_template instead of state_value_template.

Yes I have 4 lights tasmotized and all are set with mqtt discovery.

Should I just turn off that?

Check with mqtt explorer if it comes from them. If so, you could upgrade to a newer Tasmota version.

You’ll want to upgrade to Tasmota 9.2 or newer, set up the Tasmota integration, and do so19 0 on your Tasmota devices. The Tasmota integration still uses MQTT and still automatically creates Devices and Entities in HA for your Tasmota devices, but it will prevent issues like this from happening again. HA MQTT discovery is no longer being developed in Tasmota.

1 Like

Updating to tasmota 10.0 fixed the issue.

^Wow, this guy has no fear playing high stakes home automation :astonished:

Also, I’d like to add that @Tediore 's upgrade & Tasmota CLI trick solved the momentary status toggling issue I was having with my TreatLife 3-Way Switch (SS02) running Tasmota 9.5.0. I had to make a template light that toggled the switch’s relay_1 entity but read its status from the main entity that was reporting the POWER1 topic from the device’s MQTT.

I thought I had upgraded to tasmota.bin version 10.0.0 via the TasmoAdmin community add-on, but it appears the update didn’t take when I refreshed my list of devices. It could just be a weird glitch and the upgrade to v10.0.0 combined with so19 0solved it (the weird status issue, not the old firmware being reported), or my user-error using this HA add-on failed to apply the new firmware (but I definitely executed the CLI according to the console).

1 Like