Error setting cover position from another component

Hi,

I’ve written a custom component that checks a REST endpoint for tilt and position data for covers, the intention is to have the covers in homeassistant changed to whatever the incoming data is. It’s all working except the last step of actually getting homeassistant to write out the position or tilt to the entities. I’m using MQTT connected covers and the mqtt systems seems to be borking.

Here’s some relavent code:
from homeassistant.components.cover import set_cover_position, set_cover_tilt_position`
entity_id = “cover.test_cover”
set_cover_position(hass, 50, entity_id)

Will get the following error in the logs:
Invalid service data for mqtt.publish: string value is None for dictionary value @ data[‘topic’]. Got None

It seems to be that when I’m calling set_cover_position or set_cover_tilt_position the mqtt cover is trying to publish the command to the device and isn’t pulling it’s own config.

Any ideas?