Problem with node-red not getting the input value of "stop" in the template cover set in HA

Hi all, I have set a template cover in HA, but I can’t get the input value of “stop” in node-red, I can only get the input value of “open” and “closed”, how can I get this input value of “stop”? I would be grateful for any help.

What do you mean with stop?
You get the states of the entity, if the entity does not have “stop” as the state then you won’t get that in Node Red either.

Can you show the developer tools where we can see that state “stop”?

Thank you very much for your reply, I am also setting up the template cover for the first time, the screenshot below shows my settings and I don’t know where I made the mistake.


If I want to set the three states of the template cover, “open”, “closed” and “stop” in the node-red output . Does anyone know how to do this? Please give me some ideas, thanks!

It’s seems to me somehow inconsistent.
Are we talking about commands or states?
In my understanding, the template above defines commands.
But the payload expected in your NR example represents states, and in this context Stop doesn’t belong here. It would be in conflict with each other state: stopped when opening is open. stopped when reaching open or closed is still open or closed (if you know what I mean).

Do you want to indicate a situation when curtain is partially closed/open by using Stop command? If so (and your device doesn’t report such state nor percentage of opening) you probably have to create template sensor which will be updated with state as well as stop command. But it might need some trickery since a command is not persistent in its nature. So there will be situations when final result will be overridden by state of the main sensor (open or close).

If you only need to somehow transfer STOP information to NodeRed, maybe it’s enough to listen to events. If you are lucky, HA maybe sends some events when calling services. Intercept them and react as you wish. Other method is to use svc2evnt to send NR a message instead of calling scripts. Then you can do whatever you want in NR (I mean control curtain, create own sensor etc)

maxym, thank you very much for your reply. First of all, we should be talking about status, not commands. Perhaps I misled you with my template command, which was an attempt on my part, but in the end I didn’t need it. First of all, the curtain motors are controlled by sending commands through the tcp port. I could also use shell_command in HA to send “open/close/stop” commands, but this would conflict with node-red’s tcp port and the commands would not be sent, only when node-red deactivates the tcp port would they be sent properly. The idea is simple, just send three “open/close/stop” commands to the curtain motor, regardless of whether the curtain is currently open or closed, and regardless of the percentage of curtains that are open or closed. These three commands are easy to implement in node-red, but if node-red does not receive the “stop” feedback from HA, the “stop” command will not be passed to my curtain motor in node-red. motor. I don’t know if the above is accurate, but your reply has given me new ideas and I will try again, thank you!

How do you send the stop command now? In an automation, a script, service? From home assistant or node red?

I’m currently trying to use the shell_command service in HA to control the “stop” of the curtain, but I can’t do it in HA because the shell_command command is sent on the tcp port, which conflicts with the tcp port in node-red. This conflicts with the tcp port in node-red and the command cannot be transmitted. I don’t just need to control the curtains in HA, I also need to trigger the feedback from the switch panel, which is easy to do in node-red. This is not easy to do in HA because the switch panel uses a non-standard Modbus control protocol and I can’t program in python. So there’s the problem above, but I can’t solve it yet.

I never had the need to but there is an option to change the tcp port on the nodered config page. Is there a reason you cant change the port?

Mikefila, thanks for the reply. I’m a newbie and had no idea that node-red had the option to change the tcp port, I think I’m going to look to find out where that option is. Or, can you give me some hints?

Go to the supervisor → select node red → at the top choose configuration page

Got it, thanks a lot!