I have a self-made cover device that has only two MQTT topics, position and command. The command topic takes in a single byte from 0-255, and moves the motor to that postion. The position topic sends out a single byte from 0-255 after each move indicating its current position. Currently I have the following YAML:
mqtt:
- cover:
device:
identifiers:
crabroll
manufacturer: Gabe
model: v1
name: crabroll
device_class: blind
position_closed: 255
position_open: 0
position_template: '{{ unpack(value, "<B") }}'
position_topic: crabroll/test/pos
qos: 0
set_position_template: '{{ pack(value, "<B") }}'
set_position_topic: crabroll/test/command
unique_id: 01KEHE0KF2K00XCSSD2NK8PAS7_c3bfba9a3af04e1a9bbbece23a366ee8
Sending the position works great, device recives it in the correct format and moves. However, Im having trouble figuring out the template to extract the position, it always shows as 'unkown'.