Node-red MQTT automation?

Hi there,

I have installed a zemismart blind cover, from home assistant it is all working… Open and close etc.

Now I would like to automate some stuff with this blind based on time, and there is the problem… I’m New to node red and have never used MQTT nodes, that’s what I need to control the blind right? I added the blind true zigbee2mqtt. See link:

But now the question, I do I make a time based trigger to set the"position" of the blind?

I understand that I need to publish true a topic etc, but I have no clue how.

Thx for the feedback in advanced

If you have the cover already in HA you can use the call-service node to set the cover position

image

[{"id":"9ca7a55d.fa3028","type":"inject","z":"f656078a.752de8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"25","payloadType":"num","x":176,"y":576,"wires":[["e92e9162.67713"]]},{"id":"2b1c73cb.cd5dac","type":"inject","z":"f656078a.752de8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"75","payloadType":"num","x":178,"y":608,"wires":[["e92e9162.67713"]]},{"id":"e92e9162.67713","type":"api-call-service","z":"f656078a.752de8","name":"","server":"","version":1,"debugenabled":false,"service_domain":"cover","service":"set_cover_position","entityId":"cover. zemismart_blinds","data":"{ \"position\": payload }","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":402,"y":576,"wires":[[]]}]

if you just want to use mqtt something like this (untested)

image

[{"id":"e1dc4cc1.67b51","type":"inject","z":"f656078a.752de8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"25","payloadType":"num","x":178,"y":688,"wires":[["dc399b2d.5b2368"]]},{"id":"ab7e5c14.8b0dd","type":"inject","z":"f656078a.752de8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"75","payloadType":"num","x":180,"y":720,"wires":[["dc399b2d.5b2368"]]},{"id":"dc399b2d.5b2368","type":"change","z":"f656078a.752de8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"position\": payload}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":352,"y":688,"wires":[["afb0f3.df5adf1"]]},{"id":"afb0f3.df5adf1","type":"mqtt out","z":"f656078a.752de8","name":"","topic":"zigbee2mqtt/FRIENDLY_NAME/set","qos":"","retain":"","broker":"","x":604,"y":688,"wires":[]}]

@Kermit

Thx for the reply, when I’m home I will dive in to it.

From what I see you use a inject node to set the value for the position right? For the call service node, I only have a entity for the blind, not for “position” as far as I know.

“Edit: I see you select domain-cover, is that the way to talk for the position?”

Can I import you code, and start from there?

When I use mqtt I have to set the payload before the mqtt node? I was looking into the mqtt node but only find a topic setting.

Edit: I tried both of you’re flows… both are working proper! thank you!