Help with Node-Red required for Covers position

Hi all,

I’m only just starting to get into Node-Red after a long spell of using Automation within HA.

I am attempting to set the position of a Cover (blind) to a specific open position and a specific time.

I have generated the code in Developer Tools > Services as follows:

entity_id: cover.staircase_blinds
position: 40

but when i try to put that into NodeRed Edit JSON section in a Call Service node, it converts it to:

entity_id: cover.staircase_blinds position: 40

then when i deploy and trigger using an Inject node, i am presented with the error:
“Call-Service attempted without connection to server.”

I should also say, when i configure the Call Service node to trigger either open_cover or close_cover (using the Inject node), it works, but then when i update the Call Service node to set_cover_position it produces the error above.

Any help would be greatly apprreciated.

Thanks

The JSON representation you have to enter in Data looks like this

{
    "entity_id": "cover.staircase_blinds",
    "position": 40
}

You can also leave the “Entity Id” input field empty when using entity_id in “Data”.

8 Likes

Thank you @Florian, that worked

1 Like

how I can cheack “current status” with position?

2 Likes

Here is how to get the current position:


Hi there,
do you know what is the problem with my setting?
If I toggle this setup, I got an “API error”

It looks like it may be the Service, mine is listed as set_cover_position


and the Data is:
image
If this doesn’t fix it, let me know the details below:
How many servers do you have listed in the Server dropdown?
Can you please paste your full Data:

Thanks

1 Like

thank you!
that worked!
I didn’t deleted the whole text in the service field, so I only see the proposal cover up or down.

Regards :slight_smile:

1 Like
Hi all, 

I'm trying it, but there is an error message:

- Call-service error. unsupported operand type(s) for -: 'str' and 'str'

My versions are:
- Home Assistant OS 6.6
- HA core-2021.11.2
- supervisor-2021.10.8

Works even with more than one entity. Just select the entities in the entity field and put the Json as in the picture below - with just the position:

1 Like

Hello,
I also have an issue with my blinds. Here is my flow:

[{"id":"788460c2373f4b8c","type":"api-call-service","z":"fd600482.988578","name":"Küche Jalousie Position","server":"a659f366.91b36","version":5,"debugenabled":true,"domain":"cover","service":"set_cover_position","areaId":[],"deviceId":[],"entityId":["cover.0013570996003b"],"data":"{    \"entity_id\": \"cover.0013570996003b\",    \"position\": {{payload}}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":380,"wires":[["0992006de9a851fe"]]},{"id":"4bc4868ba74a5e5d","type":"blind-control","z":"fd600482.988578","name":"Jalousie EG Ost Sommer","topic":"","addIdType":"none","addId":"","positionConfig":"d3edab40.cb7bc","autoTrigger":true,"autoTriggerTime":3600000,"startDelayTime":10000,"contextStore":"","results":[{"p":"","pt":"msgTopic","v":"","vt":"topic"},{"p":"","pt":"msgPayload","v":"","vt":"level"},{"p":"slat","pt":"msg","v":"","vt":"slat"},{"p":"blindCtrl","pt":"msg","v":"","vt":"ctrlObj"}],"blindIncrement":"1","blindOpenPos":"100","blindClosedPos":0,"blindPosReverse":false,"blindPosDefault":"open (max)","blindPosDefaultType":"levelFixed","slatPosDefault":"","slatPosDefaultType":"none","overwriteExpire":"","rules":[{"index":0,"name":"Morgens","version":3,"enabled":true,"isValid":true,"conditions":[],"level":{"type":"levelFixed","value":"closed (min)","operator":0,"operatorText":"↕  Absolut"},"slat":{"type":"none","value":""},"topic":"","resetOverwrite":false,"importance":0,"time":{"type":"pdsTime","value":"goldenHourDawnStart","operator":0,"operatorText":"↥ bis","offsetType":"none","offset":"1","multiplier":60000,"days":"*","months":"*"},"timeMin":{"type":"entered","value":"6:00","offsetType":"none","offset":"1","multiplier":60000},"description":"<div><i class=\"fa fa-clock-o\" aria-hidden=\"true\"></i> ↥ bis <var>Goldene Morgenstunde Beginn</var><div class=\"indent-time-text\"><i class=\"fa fa-step-backward\" aria-hidden=\"true\"></i> <span>frühestens (min)</span> <var>6:00</var></div></div><div><div class=\"indent-level-text\"> <i class=\"fa fa-angle-down\" aria-hidden=\"true\"></i><span>Rollladenposition: </span> ↕  Absolut <var>geschlossen (min)</var></div></div>"},{"index":1,"name":"Wochenende","version":3,"enabled":true,"isValid":true,"conditions":[{"valueType":"global","value":"day","operator":"true","operatorText":"ist true","thresholdType":"num","threshold":"0"}],"level":{"type":"levelFixed","value":"closed (min)","operator":0,"operatorText":"↕  Absolut"},"slat":{"type":"none","value":""},"topic":"","resetOverwrite":false,"importance":0,"time":{"type":"entered","value":"8:30","operator":0,"operatorText":"↥ bis","offsetType":"none","offset":"1","multiplier":60000,"days":"*","months":"*"},"description":"<div><i class=\"fa fa-code-fork\" aria-hidden=\"true\"></i> <var>global.day</var> ist true</div><div><i class=\"fa fa-clock-o\" aria-hidden=\"true\"></i> ↥ bis <var>8:30</var></div><div><div class=\"indent-level-text\"> <i class=\"fa fa-angle-down\" aria-hidden=\"true\"></i><span>Rollladenposition: </span> ↕  Absolut <var>geschlossen (min)</var></div></div>"},{"index":2,"name":"Abends","version":3,"enabled":true,"isValid":true,"conditions":[],"level":{"type":"levelFixed","value":"closed (min)","operator":0,"operatorText":"↕  Absolut"},"slat":{"type":"none","value":""},"topic":"","resetOverwrite":false,"importance":0,"time":{"type":"pdsTime","value":"blueHourDuskStart","operator":1,"operatorText":"↧ von","offsetType":"none","offset":"1","multiplier":60000,"days":"*","months":"*"},"timeMax":{"type":"entered","value":"22:00","offsetType":"none","offset":"1","multiplier":60000},"description":"<div><i class=\"fa fa-clock-o\" aria-hidden=\"true\"></i> ↧ von <var>Blaue Abendstunde Beginn</var><div class=\"indent-time-text\"><i class=\"fa fa-step-forward\" aria-hidden=\"true\"></i> <span>spätestens (max)</span> <var>22:00</var></div></div><div><div class=\"indent-level-text\"> <i class=\"fa fa-angle-down\" aria-hidden=\"true\"></i><span>Rollladenposition: </span> ↕  Absolut <var>geschlossen (min)</var></div></div>"}],"sunControlMode":"16","sunFloorLengthType":"num","sunFloorLength":"0.6","sunMinDelta":"2","blindPosMin":"closed (min)","blindPosMinType":"levelFixed","blindPosMax":"open (max)","blindPosMaxType":"levelFixed","blindOpenPosOffset":0,"blindClosedPosOffset":0,"sunSlat":"","sunSlatType":"none","smoothTime":"","sunTopic":"","windowTopType":"num","windowTop":"2.3","windowBottomType":"num","windowBottom":"1.2","windowAzimuthStartType":"numAzimuth","windowAzimuthStart":"66","windowAzimuthEndType":"numAzimuth","windowAzimuthEnd":"191","oversteers":[{"mode":0,"valueType":"global","value":"wolken","operator":"gte","operatorText":">=","thresholdType":"num","threshold":"90","onlySunInWindow":true,"blindPos":{"type":"levelFixed","value":"open (max)"},"slatPos":{"type":"none","value":""}}],"oversteerTopic":"","x":1130,"y":320,"wires":[["5f29f842f337d301","788460c2373f4b8c","9070f195b8479931","bb93e79f6f7b2635"],[]]},{"id":"c408268b892f1d12","type":"debug","z":"fd600482.988578","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1720,"y":260,"wires":[]},{"id":"603b375d280838b7","type":"debug","z":"fd600482.988578","name":"debug 6","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1740,"y":320,"wires":[]},{"id":"0992006de9a851fe","type":"debug","z":"fd600482.988578","name":"debug 7","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1740,"y":380,"wires":[]},{"id":"9070f195b8479931","type":"api-call-service","z":"fd600482.988578","name":"Essen Jalousie Position","server":"a659f366.91b36","version":5,"debugenabled":true,"domain":"cover","service":"set_cover_position","areaId":[],"deviceId":[],"entityId":["cover.00135709960198"],"data":"{    \"entity_id\": \"cover.00135709960198\",    \"position\": {{payload}}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":260,"wires":[["c408268b892f1d12"]]},{"id":"bb93e79f6f7b2635","type":"api-call-service","z":"fd600482.988578","name":"Wohnzimmer Ost Jalousie Position","server":"a659f366.91b36","version":5,"debugenabled":true,"domain":"cover","service":"set_cover_position","areaId":[],"deviceId":[],"entityId":["cover.00135709960078"],"data":"{    \"entity_id\": \"cover.00135709960078\",    \"position\": {{payload}}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1480,"y":320,"wires":[["603b375d280838b7"]]},{"id":"c55b93f6a1322228","type":"inject","z":"fd600482.988578","name":"0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":1210,"y":180,"wires":[["9070f195b8479931"]]},{"id":"dfafe0d3616cc384","type":"inject","z":"fd600482.988578","name":"100","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":1210,"y":240,"wires":[["9070f195b8479931"]]},{"id":"a659f366.91b36","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"},{"id":"d3edab40.cb7bc","type":"position-config","name":"","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":"99","timeZoneDST":"0","stateTimeFormat":"3","stateDateFormat":"12","contextStore":""}]

All blinds are triggerd by one node. But only one is doing, what they should do. They should close, when the sun is shining into the window. One is closing, the other two stay open.
When I trigger the call-service-node with an inject-node manualy, it is doing exact what it should do…
Does anybody have an idea?
Thanks
Jürgen

It’s hard to say without the debug output from blind node. When the flow is triggered under the call service what does the debug say?

image