Mqtt.cover - can't find the "value_template"

I’ve had several of these warning for a while now, but have been unable to locate where to solve it:

2021-06-03 08:26:45 WARNING (MainThread) [homeassistant.components.mqtt.cover] Using 'value_template' for 'position_topic' is deprecated and will be removed from Home Assistant in version 2021.6, please replace it with 'position_template'

Now that 2021.6 is here, need to figure this out. I cannot find the “value_template” it is complaining about. I did a search in my yaml files for “cover”:

$ grep cover *.yaml
automations.yaml:  - service: cover.set_cover_position
automations.yaml:    entity_id: cover.all_cams_move_left_right
configuration.yaml:cover: !include covers.yaml
covers.yaml:   - cover.outside_cam_move_left_right
covers.yaml:   - cover.office_cam_move_left_right
covers.yaml:   - cover.livingroom_cam_move_left_right

Pretty much just 2 files. The “cover.yaml” seems like a place to start:

$ cat covers.yaml 
- platform: group
  name: all_cams_move_left_right
  entities:
   - cover.outside_cam_move_left_right
   - cover.office_cam_move_left_right
   - cover.livingroom_cam_move_left_right

No sign of a “value_template” here. Looking at automation.yaml:

  - service: cover.set_cover_position
    data:
      position: '100'
    entity_id: cover.all_cams_move_left_right

I’m not sure where to look next. Suggestions?

It’s coming from whatever is making your mqtt cover

Same here, i also can’t find it

What’s creating your mqtt entities? That’s the cause.

My mqtt broker? Or zigbee2mqtt?

It would be zigbe2mqtt

External addons use mqtt discovery in home assistant. The information being sent from zigbee2mqtt for discovery is what’s causing it.

The cover works only in zigbee2mqtt, not in HA.
U don’t have an example?

Why would I have an example? That’s automatically done by zigbee2mqtt. You should reach out to the dev unless you created the discovery info

Sorry, i am new to HA, do you mean devoloper tools?

No, the person who creates zigbee2mqtt. Or you have to create the discovery info for your cover.

Check out this, it might point you in the right direction

Ok, i will look on the zigbee2mqtt page from Koenkk

Thanks Petro

1 Like

Best I can tell these are auto-discovered by MQTT integration. I point MQTT integration in HA to my broker and it detected the connected defang cameras on the broker. The process created switch, camera and cover entities.

I still can’t find the cover entities in any yaml file I have control over to covert some value_template to a position_template. I can only find the entities in core.entity_registry but still nothing with a value_template there.

The auto discovery process is where this is occurring. Whatever is creating the discovery info in your mqtt server is what needs to be fixed. FYI this is not going to be home assistant or it’s configuration files

Think of it this way: home assistant is receiving messages from some outside source and it’s bitching at you about the messages it’s receiving. You should be looking at your cover, maybe it has a setup in its app for mqtt?

1 Like

I found a reference to this on defang github: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/1738

Not exactly the same message, as I haven’t moved to 2021.6 yet since my current warning becomes an error condition if I do. I’m making an assumption what I see now becomes what that person reports as it appeared with HA 2021.6 beta.

1 Like

I had the same issue and it was due to outdated Zigbee2Mqtt add on. I have an Ikea blind running via the integration. I noticed I was running v1.18.1 and it was not showing a newer version was available even though github was up to V1.19.1-1. I checked my repository for the add on and it was different to the one on their site. SO I must have missed this switchover and others might have too.

see : GitHub - zigbee2mqtt/hassio-zigbee2mqtt: Zigbee2mqtt Home Assistant add-on

After updating the message went away, I then upgraded to HA 2021.6 and all is working fine.

I used the following steps.

  1. Using link above go and copy repo URL and add in as a new repository as recommended
  2. Stop the existing Zigbee2Mqtt add-on and disable auto start-up
  3. Install the newer Xigbee2Mqtt add-on from the new repo in add-ons screen
  4. Copy config from old Z2M to the new Z2M, save and start the new Z2M.
  5. Verify all is working, delete old Z2M add on and remove the old repo link also.

For people using the “Defang” camera firmware (https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks) and covers for pan & tilt, appears latest firmware for the cams fixes the MQTT to HA auto-discovery. After upgrading all cameras I restarted HA and no longer getting the warning message.

Log into Camera WEB Admin page.

  1. Click System Control > Update
    1. Should have a notice about how many commits behind master you are
  2. Click [ Update Firmware (STABLE) ] button
  3. Wait for camera to reboot
  4. Once all cameras are upgraded, restart HA to confirm warning message no longer appear in the log files.