Home Assistant Master YMAL HELP V7 blind Control


#1

I am re coding blindcontrol v7 firmware to include Home Assistant Auto Discovery with all the bells etc as per example in covers.
I have coded a basic Auto Discovery but am running in to some problems implementing all the functions as I do not use Home Assistant in my home, only as a test setup.
I would like some Home assistant Users to help me setup the ymal for auto generation.
I am having problems getting Payload ‘’ is not numeric. And Payload is not supported (e.g. open, closed, opening, closing, stopped):.

This is the code for Auto Discovery to inject into home assistant.
Based on the full example in covers
_identifier; ////auto set Friendly name converted removing spaces and converting to lower case
e.g .Friendly Name = Kitchen Blind
_identifier = kitchen_blind

platform = “mqtt”;
~ = _identifier;
name = Friendly Name;
unique_id = _identifier;
json_attr_t = “~/attr”;
command_topic = “cmnd/”+_identifier+"/POWER";
state_topic = “stat/”+_identifier+"/STATE";
position_topic = “stat/”+_identifier+"/position";
availability_topic = “tele/”+_identifier+"/LWT";
retain = false;
payload_open = “open”;
payload_close = “close”;
payload_stop = “STOP”;
state_open = “0”;
state_opening = “opening”;
state_closed = “180”;
state_closing = “closing”;
payload_available = “Online”;
payload_not_available = “Offline”;
position_open = 0;
position_closed = 180;
optimistic = false;
value_template = “{{ value.x }}”;
position_template = “{{ value.y }}”;
tilt_command_topic = “cmnd/”+_identifier+"/POWER";
tilt_status_topic = “stat/”+_identifier+"/tilt-state";
tilt_status_template = “{{ value_json[‘PWM’][‘PWM1’] }}”;
tilt_min = 0;
tilt_max = 100;
tilt_closed_value = 0;
tilt_opened_value = 100;
device_class = “blind”;

I am not sure on the value templates and position template or tilt_status_template.

What I am looking for is a up down stop , or open close option also with a slider option or tilt option to open between open and closed limits.

May be I have too many options listed in ymal and are not needed ???

Also in this new version I have coded you can set your open and closed limit

Your help will be great as I am stuck on this Home assistant intergration


#2

Hey

This is what my current config is for my blinds

cover:
  - platform: mqtt
    name: "Lounge Blinds1"
    command_topic: "cmnd/blind1/POWER"
    state_topic: "stat/blind1/STATE"
    retain: true
    payload_open: "50"
    payload_close: "0"
    payload_stop: "75"
    state_open: "50"
    state_closed: "0"

  - platform: mqtt
    name: "Lounge Blinds2"
    command_topic: "cmnd/blind2/POWER"
    state_topic: "stat/blind2/STATE"
    retain: true
    payload_open: "50"
    payload_close: "0"
    payload_stop: "75"
    state_open: "50"
    state_closed: "0"

#3

Here’s what I have.

  • platform: mqtt
    name: “Right Window Blinds”
    command_topic: “cmnd/blinds1/POWER”
    state_topic: “stat/blinds1/STATE”
    device_class: ‘shutter’
    retain: false
    payload_open: 60
    payload_close: 0
    payload_stop: 60
    state_open: 60
    state_closed: 0
    tilt_command_topic: “cmnd/blinds1/tilt”
    tilt_status_topic: “stat/blinds1/STATE”
    tilt_min: 0
    tilt_max: 100
    tilt_closed_value: 0
    tilt_opened_value: 100


#4

Are you guys have problems with your blinds twitching after restarting your home assistant server?

And here’s my YMAL folder

Cover Livingroom-blinds1:

  • platform: mqtt
    name: “Livingroom-Blinds1”
    command_topic: “cmnd/Livingroom-Blinds1/POWER”
    state_topic: “stat/Livingroom-Blinds1/STATE”
    retain: false
    payload_open: “70”
    payload_close: “0”
    payload_stop: “30”
    state_open: “70”
    state_closed: “0”

cover LivingRoom-Blinds2:

  • platform: mqtt
    name: “LivingRoom-Blinds2”
    command_topic: “cmnd/Livingroom-Blinds2/POWER”
    state_topic: “stat/Livingroom-Blinds2/STATE”
    retain: false
    payload_open: “50”
    payload_close: “100”
    payload_stop: “80”
    state_open: “50”
    state_closed: “100”

cover kitchen-Blinds:

  • platform: mqtt
    name: “kitchen-Blinds”
    command_topic: “cmnd/Kitchen-Blinds/POWER”
    state_topic: “stat/Kitchen-Blinds/STATE”
    retain: false
    payload_open: “71”
    payload_close: “4”
    payload_stop: “30”
    state_open: “71”
    state_closed: “4”

cover Masterbedroom-blinds:

  • platform: mqtt
    name: “Masterbedroom-Blinds”
    command_topic: “cmnd/Masterbedroom-Blinds/POWER”
    state_topic: “stat/Masterbedroom-Blinds/STATE”
    retain: false
    payload_open: “10”
    payload_close: “75”
    payload_stop: “30”
    state_open: “10”
    state_closed: “75”

cover Diningroom-Blinds:

  • platform: mqtt
    name: “Diningroom-Blinds”
    command_topic: “cmnd/Diningroom-Blinds/POWER”
    state_topic: “stat/Diningroom-Blinds/STATE”
    retain: false
    payload_open: “55”
    payload_close: “0”
    payload_stop: “99”
    state_open: “55”
    state_closed: “0”

#5

look at the “Blind Control V6.5 upgrade” topic…check MQTT database for Retained messages. I cleared anything I saw and never had it happen again.


#6

I deleted all the Retained Messages in the cmnd section but should I delete them from the LWT section


#7

LWT messages can stay.
Its the cmnd messages that causes problems


#8

Thanks for the input on ymal’s
I have noticed that there are different payload_open settings .
I assume these are you desired open limit positions, and are not necessarily the full open position.??
(the new version will have set open and closed limits via GUI which will also set payload_open etc in the auto discovery generation)
The above ymal’s are simple, which I like. will cut down the one I am working on. Keep it simple


#9

Hi Mountain, correct…the 60 value in my config is the halfway point for my brand of horizontal blinds. When we tell google to open the blinds, it stops at the 60 mark.


#10

After recently moving to Home Assistant, I found that the entries require the unique_id set. Here is one of my entries in the yaml:

cover Blinds101:

  • platform: mqtt
    name: “Dining Blinds”
    unique_id: blinds101
    command_topic: “cmnd/Blinds101/POWER”
    state_topic: “cmnd/Blinds101/STATE”
    retain: false
    payload_open: “0”
    payload_close: “100”
    payload_stop: “50”
    state_open: “0”
    state_closed: “100”

specs: Mosquitto broker 5.1.1; HA core-2021.4.6


#11

Thanks ymal 's
the new version will auto generate unique_id.
example
Full Name: Dining Blinds
unique_id : dining_blinds


#12

A couple of months ago, there were updates to HA & MQTT that stated that I needed to change my YAML in order to stay compliant with the MQTT config. My automations continued to work, but not my dashboards.

I kept receiving the error “does not have a unique ID”. So, I updated to v8.00 firmware for the blinds & updated the cmnd & stat topics accordingly. I also turned on auto discovery. I now have an entity called living_room_blinds_2. I can get it to open & close with the dashboard now, BUT I’m unsure WHERE to edit the open, stop, & close parameters.

Below is my YAML. I’ve changed the unique_id to living_room_blinds & living_room_blinds_2 (the new auto-discovered entity). Makes no difference. Any thoughts as how to change my open, stop, & close parameters?

    mqtt:
      cover:
        - name: "Livingroom Blinds"
          unique_id: "living_room_blinds_2"
          command_topic: "cmnd/living_room_blinds/POWER"
          state_topic: "stat/living_room_blinds/STATE"
          position_topic: "stat/living_room_blinds/tilt-state"
          set_position_topic: "cmnd/living_room_blinds/POWER"
          qos: 0
          retain: false
          payload_open: "OPEN"
          payload_close: "CLOSE"
          payload_stop: "70"
          state_open: "40"
          state_opening: "opening"
          state_closed: "100"
          state_closing: "closing"
          payload_available: "online"
          payload_not_available: "offline"
          optimistic: false
          value_template: '{{ value.x }}'
          position_template: '{{ value.y }}'
          tilt_command_topic: "cmnd/living_room_blinds/tilt"
          tilt_status_topic: "stat/living_room_blinds/tilt-state"
          tilt_status_template: '{{ value_json[“PWM”][“PWM1”] }}'
          tilt_min: 0
          tilt_max: 100
          tilt_closed_value: 100
          tilt_opened_value: 40
          device_class: blind

#13

I have had a look at your YMAL…

I did use this sample format to try and encode the firmware to suit, but hit a lot of problems.
So I adopted a simple approach to achieve the same result.
The firmware does some fuzzy logic to achieve the same results.

The open and closed limits are now set via the GUI of the firmware… eg set open to 40.

Or via setup and enter the value directly


You also need to set HA Auto Discovery enable-tilt in GUI setup

The YMAL generated is as below. Regardless of the set open or closed position.
Home assistant will send open or close command full control value…the up arrow or down arrow , the firmware will adjust according to set limits…and will report back to Home Assistant the full stat value…ie open or closed. The icon of the blind will be fully closed or fully open.
However in the tilt section you will see the slider at 40 persent. in home assistant. (Its true position)
The tilt arrows and slider can over ride your limits if you want by just moving these .
I found with my set up I always have them open at 45 degress for privacey, if I need to fully open then I overide with slider or tilt arrorws.

“platform”: “mqtt”,
“~”: “mk_blindcontrol_test”,
“name”: “Mk Blindcontrol Test”,
“unique_id”: “mk_blindcontrol_test”,
“command_topic”: “cmnd/mk_blindcontrol_test/POWER”,
“state_topic”: “stat/mk_blindcontrol_test/STATE”,
“availability_topic”: “tele/mk_blindcontrol_test/LWT”,
“retain”: false,
“payload_open”: “0”,
“payload_close”: “100”,
“state_open”: “0”,
“state_closed”: “100”,
“payload_available”: “Online”,
“payload_not_available”: “Offline”,
“position_open”: 0,
“position_closed”: 100,
“tilt_command_topic”: “cmnd/mk_blindcontrol_test/tilt”,
“tilt_status_topic”: “stat/mk_blindcontrol_test/tilt-state”,
“tilt_min”: 0,
“tilt_max”: 100,
“tilt_closed_value”: 0,
“tilt_opened_value”: 100,
“device_class”: “blind”

I use openhab at home but do have a test site with home assistant running in parallel, they both work together.

Try the new method hope it is what you are looking for, if not might look at recoding firmware.
I did spend a lot of time trying to get your ymal to function as per examples on the home assistant site, i did like the full potential of it but could not get it to work, so I adopted the KISS approach.

If you need something to be generated in the auto YMAL then I can quickly encode it…

Cheers

Mountain


#14

I totally missed that in the firmware. I’m all set now. So basically, I have 2 sets of controls in my dashboard. The tilt controls gets me the option I was looking for. All good here. Thank you for your detailed response!

Cheers! Ty