Updated MQTT code for Home Assistant - Examples?

Home Assistant has changed the way MQTT Cover works… I had my garadgets working through MQTT, and I updated my configuration.yaml code to the new format… I seem to have lost how to create the cover for my garage doors, and now I can’t access them through my UI.

Does anyone have updated configuration.yaml example code that they are using with garadget and Home Assistant that they could share?

Thanks.

Update: I was able to sort my issue… I was confusing the Home Assistant YAML parser… I use the code below in my configuration.yaml file, and it is working great. I have my garadgets set up for MQTT communication. I have the cover, “door since” and “door brightness” entities on my lovelace dashboard/UI for each of the garage doors.

mqtt:
cover:
- name: “Large Garage Door”
device_class: ‘garage’
command_topic: “garadget/lgarage/command”
state_topic: “garadget/lgarage/status”
value_template: >-
{% if value_json.status == ‘closed’ %}
closed
{% else %}
open
{% endif %}
payload_open: “open”
payload_close: “close”
payload_stop: “stop”

- name: "Small Garage Door"
  device_class: 'garage'
  command_topic: "garadget/sgarage/command"
  state_topic: "garadget/sgarage/status"
  value_template: >-
    {% if value_json.status == 'closed' %}
      closed
    {% else %}
      open
    {% endif %}
  payload_open: "open"
  payload_close: "close"
  payload_stop: "stop"   

sensor:
- name: “Large Garage Door Since”
state_topic: “garadget/lgarage/status”
value_template: ‘{{ value_json.time }}’

- name: "Large Garage Door Brightness"
  state_topic: "garadget/lgarage/status"
  unit_of_measurement: '%'
  value_template: '{{ value_json.bright }}'      

- name: "Small Garage Door Since"
  state_topic: "garadget/sgarage/status"
  value_template: '{{ value_json.time }}'

- name: "Small Garage Door Brightness"
  state_topic: "garadget/sgarage/status"
  unit_of_measurement: '%'
  value_template: '{{ value_json.bright }}'
2 Likes