Have to be honest. Im not a programmer but enjoying hassio and Node-Red anyway.
But my knowledge is limited and deeply depending on the help from forums and more skilled members.
Im trying to get Node-Red working with my Ikea Blinds. The Ikea app is not very usefull when automation other than timing the blinds is needed.
My end goal is to get the blinds to function when certain circumstances occur. If the sun is shining, the time is past 2 pm and the tv is turned on the blinds should roll down. But im a long way from that.
I wish to use Node-Red to do the automation and its working when using the âCoverâ domain and the service âclose_coverâ or âopen_coverâ. That way they can go up and down. But I really like to use a specific position depending with the service âset_cover_positionâ and cant get that to work at all. Probably because I dont know to command it the right way.
Anyone who can help me with the âalmostâ first step? Hope so and thanks in advance!
Do you have an idea on how this is possible to test. Have tried with data when injecting the command but without luck but really donât know what Iâm doing.
i donât have covers so not sure the exact setup but are you able to make it work in home assistant? what does it look like when you do a service call in developer tools.
I am, they work like a charm in home assistent. And your really helping me here, because they actually do what they are told when trying in developer tools.
When calling the service âcover.set_cover_positionâ with the parameters
entity_id: cover.blind_north
position: 30
the specified blinds move to position 30. Nows the question how to do the same in Node Red
As you can see yaml and json are very similar.
Json just have more characters.
They open and close with {} and each key and value pair is enclosed in ââ unless itâs a number.
The rules and syntaxes make it so difficult for me who does not have much programming experience. Makes me think about how to get it without going on a course for a few years
It works in Node Red so Im very happy. And I really appreciate the help from both of you, because you have pushed me forward in a positive direction.
One thing which is maybe obvious. Is it possible to âinjectâ the input from a node like âinjectâ or âbigtimerâ? Otherwise I will use multiple âcall serviceâ which is no problem, but I guess there is a smarter way of doing it
There is no better way that I can think of.
You could possibly use a function node and use JavaScript to iterate an array of blinds, but since you are not a programmer then that is probably out of question.
And even though I do program I would not use that method anyways.
There is a benefit of seeing it all at once. Every time you hide stuff in function nodes it get slightly harder to read the flow.
You are right. keep it as simple as possible makes it easier to understand when looking into it again after a year or so. And yes, I wouldnât dare to do any javascripting
Edit: I see your edit now.
That isnât so bad. Since itâs different blinds it would probably be hard to get any more compact anyways
OkâŚ
In that case either you put a get state node and get the current position of the sun in your flow.
Then add a switch node to switch in between it all.
The fancy solution is to use the get state then a function node, but I guess you will need help with that.
If you just tell us a few positions say some morning setting, some mid-day and something later at night then either me or someone else can give you the base and you can probably see whst you need to do to file out the rest.