Yes i belive so to, that is why my RF blinds are controlled from HDL via a somfy RS-232 gateway.
I only have 2x normal roller curtains connected to 12i1 sensors instead of the curtain module saw a need for the curtain controller as the 12i1 in the same rooms had 2 relays awailable.
Never saw the need for setting it to other than 100% or 0% as it is only in bedrooms and only open or closed was needed, but when i found the shutter card i desided to implement % for my wired blinds to
My logic is a bit different than your codes for the curtain module so did some copy paste and not 100% it will work for you.
To test you will have to do the following:
- Add a file to HA config folder named “cover.yaml” with following inside:
#### Test % blinds ####
#
# Test Blind 1
- platform: mqtt
name: "Test Blind 1"
device_class: shade
# Description for command_topic and set_position_topic: hdl/cp/"subnet"."deviceid"/"curtain ch"."milliseconds to open"."milliseconds to close."steps"/"topic"
command_topic: "hdl/cp/1.5/1.10000.10000.10/set"
set_position_topic: "hdl/cp/1.5/1.10000.10000.10/set"
state_topic: "hdl/cp/1.5/1/state"
position_closed: 0
position_open: 100
position_topic: "hdl/cp/1.5/1/position"
#
# Test Blind 2
- platform: mqtt
name: "Test Blind 2"
device_class: shade
# Description for command_topic and set_position_topic: hdl/cp/"subnet"."deviceid"/"curtain ch"."milliseconds to open"."milliseconds to close."steps"/"topic"
command_topic: "hdl/cp/1.5/2.10000.10000.10/set"
set_position_topic: "hdl/cp/1.5/2.20000.20000.10/set"
state_topic: "hdl/cp/1.5/2/state"
position_closed: 0
position_open: 100
position_topic: "hdl/cp/1.5/2/position"
- Add the following to the configuration.yaml file:
cover: !include cover.yaml
-
You might have to disable your current blinds if you have them in the configuration.yaml file, or reformat the above code to work in the config file.
-
I used custom cards as i dont like the default setup for the original one and did not bother with trying to figure out the automatins etc for getting a slider to work for something other than lights. So you will have to install: Shutter Card and slider-entity-row and, easyest way is via HACS.
-
Refresh browser and add a “grid card” to a dashboard. Click “Show code editor” and replace text with:
square: false
columns: 1
type: grid
cards:
- type: entities
title: Test Original Card
entities:
- entity: cover.test_blind_1
show_header_toggle: true
- type: custom:shutter-card
title: Shutter Card
entities:
- entity: cover.test_blind_1
name: Test Blinds 1
buttons_position: left
title_position: top
invert_percentage: false
- type: entities
title: Slider Entity Row
entities:
- type: custom:slider-entity-row
action: position
entity: cover.test_blind_1
tap_action:
action: toggle
hold_action:
action: more-info
step: 1
This should get you to a setup like this:
*Disable your current curtains flow in nodered and import this test flow:
[{"id":"82db28d3b515ed99","type":"tab","label":"Curtain % test HDL","disabled":false,"info":"","env":[]},{"id":"7fc939ac40505a15","type":"delay","z":"82db28d3b515ed99","name":"Timer","pauseType":"delayv","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":990,"y":200,"wires":[["f8e11707c0d06f97"]]},{"id":"3599854728e07619","type":"switch","z":"82db28d3b515ed99","name":"Done?","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"done","vt":"str"},{"t":"nnull"}],"checkall":"false","repair":false,"outputs":2,"x":870,"y":200,"wires":[[],["7fc939ac40505a15","4b845feef20b42df"]]},{"id":"349a563976f14f1c","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"25","payloadType":"num","x":330,"y":540,"wires":[["dae29e6fb35d8854"]]},{"id":"59d0cb87d2480f08","type":"inject","z":"82db28d3b515ed99","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":330,"y":460,"wires":[["dae29e6fb35d8854"]]},{"id":"6e31adcc2e24f461","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"50","payloadType":"num","x":330,"y":580,"wires":[["dae29e6fb35d8854"]]},{"id":"dae29e6fb35d8854","type":"function","z":"82db28d3b515ed99","name":"Save Target","func":"//Save target to context data\nflow.set(msg.contextaddress + \".target\", msg.payload);\n\n//return\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":280,"wires":[["f8e11707c0d06f97","64b7480343fc651e"]]},{"id":"f8e11707c0d06f97","type":"function","z":"82db28d3b515ed99","name":"Set direction","func":"//Load current position from context data\nvar current = flow.get(msg.contextaddress + \".current\")||0;\n\n//Load target position from context data\nvar target = flow.get(msg.contextaddress + \".target\")||0;\n\n//Calculate difference\nvar dif = target - current\n\n//Save diference to context data\nflow.set(msg.contextaddress + \".dif\",dif);\n\n// Check if target is Up\nif (dif > 0){msg.topic=\"increment\";}\n\n//Check if target is Down\nelse if (dif < 0){msg.topic=\"decrement\";}\n\n//Check if target is current possition and stop loop\nelse if (dif === 0){msg.topic=\"done\";}\n\n//Check if Loop Stopped\n\n\n//Return message\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":280,"wires":[["16899ed749c6eb89","4a652905eb4e03c3"]]},{"id":"1015f12f6c351678","type":"function","z":"82db28d3b515ed99","name":"Reset","func":"//Set current to payload\nvar current = msg.payload\n\n//Save current\nflow.set(\"hdl/cp/1.5/1.current\",current);\n\n//Save target to context data\nflow.set(\"hdl/cp/1.5/1.target\", current);\n\n//Save difference\nflow.set (\"hdl/cp/1.5/1.dif\",0)\n\n//address\nmsg.contextaddress = \"hdl/cp/1.5/1\"\n\n//Return msg\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":760,"wires":[["72c4e2cd54603d8f","f8e11707c0d06f97"]]},{"id":"16899ed749c6eb89","type":"function","z":"82db28d3b515ed99","name":"counter","func":"//Load current position from context data\nvar current = flow.get(msg.contextaddress + \".current\")||0;\n\n//Load target position from context data\nvar abstarget = flow.get(msg.contextaddress + \".target\")||0;\n\n//Load diference from context data\nvar dif = flow.get(msg.contextaddress + \".dif\")||0;\n\n// add 1 to count\nif (dif > 0){current++} \n\n// Retract 1 from count\nelse if (dif < 0){current--}\n\n// Save current count to context data\nflow.set(msg.contextaddress + \".current\", current);\n\n// Update current count to payload\nmsg.payload = current\n\n//Return msg\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1000,"y":280,"wires":[["fda5e6017b7c63c1","942346186622525e","3599854728e07619","ca77ce671bc2cc38"]]},{"id":"ea0a79b4ef3acbc5","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"75","payloadType":"num","x":330,"y":620,"wires":[["dae29e6fb35d8854"]]},{"id":"b9fc6bf74c200209","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":330,"y":660,"wires":[["dae29e6fb35d8854"]]},{"id":"5b625ac097747ae1","type":"mqtt in","z":"82db28d3b515ed99","name":"","topic":"hdl/cp/+/+/set","qos":"2","datatype":"auto","broker":"","nl":false,"rap":true,"rh":0,"inputs":0,"x":110,"y":300,"wires":[["ab38dab9a71fa36c"]]},{"id":"63ac6586a9963c9c","type":"comment","z":"82db28d3b515ed99","name":"Test %","info":"","x":290,"y":420,"wires":[]},{"id":"3551dbe141235cd4","type":"comment","z":"82db28d3b515ed99","name":"From MQTT","info":"","x":90,"y":260,"wires":[]},{"id":"f0776094225c6b84","type":"function","z":"82db28d3b515ed99","name":"Split","func":"//Define Payload as number\nmsg.payload = Number(msg.payload)\n\n\n//Split from main topic\nchtimesandsplit = msg.topic.split(\"/\")[3]\n\n\n//Split CH, Open Time, Close Time and Steps\nmsg.channel = Number(chtimesandsplit.split(\".\")[0])\nopentime = Number(chtimesandsplit.split(\".\")[1])\n//msg.closetime = Number(chtimesandsplit.split(\".\")[2])\n//msg.steps = Number(chtimesandsplit.split(\".\")[3])\n\n\n//Calculate and enter time to message for delay node\nmsg.delay = opentime / 100\n\n//Build Context Data address\nmsg.contextaddress = \"hdl/cp/\" + msg.topic.split(\"/\")[2] + \"/\" + msg.channel;\n\n\n//Return\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":280,"wires":[["dae29e6fb35d8854"]]},{"id":"ef028066edde1eb7","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":330,"y":800,"wires":[["1015f12f6c351678"]]},{"id":"216d5ae88e8d1aba","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":330,"y":760,"wires":[["1015f12f6c351678"]]},{"id":"45687093f3ecb89c","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"50","payloadType":"num","x":330,"y":880,"wires":[["1015f12f6c351678"]]},{"id":"5a98cf9db1ce6104","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"75","payloadType":"num","x":330,"y":920,"wires":[["1015f12f6c351678"]]},{"id":"262aea74cde73dad","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":330,"y":960,"wires":[["1015f12f6c351678"]]},{"id":"1ec8a2d96703e81a","type":"comment","z":"82db28d3b515ed99","name":"Calibrate % and stop loop","info":"","x":350,"y":720,"wires":[]},{"id":"fda5e6017b7c63c1","type":"debug","z":"82db28d3b515ed99","name":"Update Current Position ","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1210,"y":420,"wires":[]},{"id":"72c4e2cd54603d8f","type":"debug","z":"82db28d3b515ed99","name":"Reset","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":760,"wires":[]},{"id":"3eb68746ac2e435a","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"25","payloadType":"num","x":330,"y":840,"wires":[["1015f12f6c351678"]]},{"id":"9f0ec1a267c23e3a","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":330,"y":500,"wires":[["dae29e6fb35d8854"]]},{"id":"a153e4ccc14a521b","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":330,"y":1100,"wires":[["3eab082f88a132a1"]]},{"id":"9dbf71f20f2f79c1","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":330,"y":1060,"wires":[["3eab082f88a132a1"]]},{"id":"ca03ea107cc1869f","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"50","payloadType":"num","x":330,"y":1180,"wires":[["3eab082f88a132a1"]]},{"id":"a32340308243d8fe","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"75","payloadType":"num","x":330,"y":1220,"wires":[["3eab082f88a132a1"]]},{"id":"90c85758d0fa83cc","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":330,"y":1260,"wires":[["3eab082f88a132a1"]]},{"id":"f1787e464728407d","type":"comment","z":"82db28d3b515ed99","name":"Manually Change MQTT feedback value","info":"","x":390,"y":1020,"wires":[]},{"id":"4ce3b8ea0bcb4b1d","type":"inject","z":"82db28d3b515ed99","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"25","payloadType":"num","x":330,"y":1140,"wires":[["3eab082f88a132a1"]]},{"id":"3eab082f88a132a1","type":"function","z":"82db28d3b515ed99","name":"Insert topic","func":"msg.topic = \"hdl/cp/1.5/1/position\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":530,"y":1160,"wires":[["5aaa0e452489ef82"]]},{"id":"5aaa0e452489ef82","type":"mqtt out","z":"82db28d3b515ed99","name":"Status updates to MQTT","topic":"","qos":"0","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"","x":1590,"y":1500,"wires":[]},{"id":"942346186622525e","type":"function","z":"82db28d3b515ed99","name":"Send Updated % Position to MQTT","func":"msg.topic = msg.contextaddress + \"/position\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1280,"y":360,"wires":[["503d8a0c109fd582","5aaa0e452489ef82"]]},{"id":"503d8a0c109fd582","type":"debug","z":"82db28d3b515ed99","name":"To MQTT","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1660,"y":400,"wires":[]},{"id":"ab38dab9a71fa36c","type":"switch","z":"82db28d3b515ed99","name":"Type","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"STOP","vt":"str"},{"t":"btwn","v":"0","vt":"num","v2":"100","v2t":"num"},{"t":"eq","v":"OPEN","vt":"str"},{"t":"eq","v":"CLOSE","vt":"str"}],"checkall":"false","repair":false,"outputs":4,"x":250,"y":300,"wires":[["1a1b769f0fe8298e"],["f0776094225c6b84"],["103cc782e9ec590f"],["103cc782e9ec590f"]]},{"id":"103cc782e9ec590f","type":"change","z":"82db28d3b515ed99","name":"% set","rules":[{"t":"change","p":"payload","pt":"msg","from":"OPEN","fromt":"str","to":"100","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"CLOSE","fromt":"str","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":320,"wires":[["f0776094225c6b84"]]},{"id":"1a1b769f0fe8298e","type":"function","z":"82db28d3b515ed99","name":"Manual Stop of the Blinds / Loop","func":"//Split from main topic\nchtimesandsplit = msg.topic.split(\"/\")[3]\n\n//Split CH\nmsg.channel = Number(chtimesandsplit.split(\".\")[0])\n\n\n//Build Context Data address\nmsg.contextaddress = \"hdl/cp/\" + msg.topic.split(\"/\")[2] + \"/\" + msg.channel;\n\n\n//Load current position from context data\nvar current = flow.get(msg.contextaddress + \".current\");\n\n//Save target to context data\nflow.set(msg.contextaddress + \".target\", current);\n\n//Change Payload to current \nmsg.payload = current\n\n//return\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":240,"wires":[["f8e11707c0d06f97","44f76b6ea9e26658"]]},{"id":"44f76b6ea9e26658","type":"debug","z":"82db28d3b515ed99","name":"Stop inject","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":690,"y":140,"wires":[]},{"id":"4a652905eb4e03c3","type":"debug","z":"82db28d3b515ed99","name":"Set dir","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":340,"wires":[]},{"id":"64b7480343fc651e","type":"debug","z":"82db28d3b515ed99","name":"Save tar","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":840,"y":340,"wires":[]},{"id":"4b845feef20b42df","type":"debug","z":"82db28d3b515ed99","name":"delay","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":160,"wires":[]},{"id":"f5a817c3812feedd","type":"switch","z":"82db28d3b515ed99","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"done","vt":"str"},{"t":"eq","v":"increment","vt":"str"},{"t":"eq","v":"decrement","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":1310,"y":220,"wires":[["f808e16c36f4734a","cc6779fb5888f1e0"],["82e983fa2e017282","f808e16c36f4734a"],["4c33d7ddc2a03df1","f808e16c36f4734a"]]},{"id":"82e983fa2e017282","type":"function","z":"82db28d3b515ed99","name":"Open","func":"//Build new open message\nmsg.code = 58336;\nmsg.target = msg.contextaddress.split(\"/\")[2];\nmsg.payload = {\n curtain: Number(msg.contextaddress.split(\"/\")[3]),\n status: 1,\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1450,"y":220,"wires":[["ca09e63223db2cb8","1df5758fb4fa0a46"]],"info":"msg.topic = \"hdl/us/\" + msg.sender + \"/\" + msg.payload.switch;\nvar status = msg.payload.status\nif (status === true) \n {\n msg.payload = \"ON\";\n } \n else \n {\n msg.payload = \"OFF\";\n }\nreturn msg;"},{"id":"cc6779fb5888f1e0","type":"function","z":"82db28d3b515ed99","name":"Done?","func":"//Build new stop message if target is not 0% or 100%\nif (msg.payload >= 1 && msg.payload <= 99) {\nmsg.code = 58336;\nmsg.target = msg.contextaddress.split(\"/\")[2];\nmsg.payload = {\n curtain: Number(msg.contextaddress.split(\"/\")[3]),\n status: 0,\n};\nreturn msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1450,"y":180,"wires":[["ca09e63223db2cb8","1df5758fb4fa0a46"]],"info":"msg.topic = \"hdl/us/\" + msg.sender + \"/\" + msg.payload.switch;\nvar status = msg.payload.status\nif (status === true) \n {\n msg.payload = \"ON\";\n } \n else \n {\n msg.payload = \"OFF\";\n }\nreturn msg;"},{"id":"4c33d7ddc2a03df1","type":"function","z":"82db28d3b515ed99","name":"Close","func":"//Build new close message\nmsg.code = 58336;\nmsg.target = msg.contextaddress.split(\"/\")[2];\nmsg.payload = {\n curtain: Number(msg.contextaddress.split(\"/\")[3]),\n status: 2,\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1450,"y":260,"wires":[["ca09e63223db2cb8","1df5758fb4fa0a46"]],"info":"msg.topic = \"hdl/us/\" + msg.sender + \"/\" + msg.payload.switch;\nvar status = msg.payload.status\nif (status === true) \n {\n msg.payload = \"ON\";\n } \n else \n {\n msg.payload = \"OFF\";\n }\nreturn msg;"},{"id":"1df5758fb4fa0a46","type":"debug","z":"82db28d3b515ed99","name":"To HDL","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1660,"y":300,"wires":[]},{"id":"f808e16c36f4734a","type":"debug","z":"82db28d3b515ed99","name":"Pre HDL","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1400,"y":300,"wires":[]},{"id":"ca77ce671bc2cc38","type":"rbe","z":"82db28d3b515ed99","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"topic","topi":"topic","x":1190,"y":220,"wires":[["f5a817c3812feedd"]]},{"id":"4dddb4cca5626055","type":"hdl-raw-in","z":"82db28d3b515ed99","controller":"","name":"From HDL","x":120,"y":1520,"wires":[["6bd1d8770e547348"]]},{"id":"4caf94421826f615","type":"comment","z":"82db28d3b515ed99","name":"Feedback from HDL to MQTT","info":"","x":140,"y":1360,"wires":[]},{"id":"6bd1d8770e547348","type":"switch","z":"82db28d3b515ed99","name":"","property":"code","propertyType":"msg","rules":[{"t":"eq","v":"50","vt":"str"},{"t":"eq","v":"52","vt":"str"},{"t":"eq","v":"57373","vt":"str"},{"t":"eq","v":"57369","vt":"str"},{"t":"eq","v":"5703","vt":"str"},{"t":"eq","v":"5637","vt":"str"},{"t":"eq","v":"58341","vt":"str"},{"t":"eq","v":"6471","vt":"str"},{"t":"eq","v":"6469","vt":"str"},{"t":"eq","v":"7263","vt":"str"},{"t":"eq","v":"7261","vt":"str"},{"t":"eq","v":"6457","vt":"str"},{"t":"eq","v":"6459","vt":"str"},{"t":"eq","v":"58337","vt":"str"},{"t":"eq","v":"58340","vt":"str"}],"checkall":"false","repair":false,"outputs":15,"x":250,"y":1520,"wires":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],["e4f4cb87d2b737f2","8edfb163d135a32b","435fd4cd25251e42"]]},{"id":"2c9d83557a597e80","type":"comment","z":"82db28d3b515ed99","name":"Motorized Curtain Control Module","info":"","x":570,"y":1500,"wires":[]},{"id":"54bd9f96d12d1d74","type":"debug","z":"82db28d3b515ed99","name":"To MQTT","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1040,"y":1520,"wires":[]},{"id":"89bbf8cae1491e59","type":"inject","z":"82db28d3b515ed99","name":"Broadcast 1 close","props":[{"p":"sender","v":"1.5","vt":"str"},{"p":"target","v":"255.255","vt":"str"},{"p":"code","v":"58340","vt":"num"},{"p":"payload.curtains.0.number","v":"1","vt":"num"},{"p":"payload.curtains.0.level","v":"2","vt":"num"},{"p":"payload.curtains.0.status","v":"2","vt":"num"},{"p":"payload.curtains.1.number","v":"2","vt":"num"},{"p":"payload.curtains.1.level","v":"0","vt":"num"},{"p":"payload.curtains.1.status","v":"0","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":1720,"wires":[["435fd4cd25251e42","8edfb163d135a32b"]]},{"id":"a2d54fda76338620","type":"inject","z":"82db28d3b515ed99","name":"Broadcast 1 stop","props":[{"p":"sender","v":"1.5","vt":"str"},{"p":"target","v":"255.255","vt":"str"},{"p":"code","v":"58340","vt":"num"},{"p":"payload.curtains.0.number","v":"1","vt":"num"},{"p":"payload.curtains.0.level","v":"0","vt":"num"},{"p":"payload.curtains.0.status","v":"0","vt":"num"},{"p":"payload.curtains.1.number","v":"2","vt":"num"},{"p":"payload.curtains.1.level","v":"0","vt":"num"},{"p":"payload.curtains.1.status","v":"0","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":120,"y":1760,"wires":[["435fd4cd25251e42","8edfb163d135a32b"]]},{"id":"6011aae9e84a5f04","type":"inject","z":"82db28d3b515ed99","name":"Broadcast 1 open","props":[{"p":"sender","v":"1.5","vt":"str"},{"p":"target","v":"255.255","vt":"str"},{"p":"code","v":"58340","vt":"num"},{"p":"payload.curtains.0.number","v":"1","vt":"num"},{"p":"payload.curtains.0.level","v":"1","vt":"num"},{"p":"payload.curtains.0.status","v":"1","vt":"num"},{"p":"payload.curtains.1.number","v":"2","vt":"num"},{"p":"payload.curtains.1.level","v":"0","vt":"num"},{"p":"payload.curtains.1.status","v":"0","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":120,"y":1680,"wires":[["435fd4cd25251e42","8edfb163d135a32b"]]},{"id":"eefd437a5ada659e","type":"function","z":"82db28d3b515ed99","name":"Curtain Opening","func":"msg.topic = \"hdl/cp/\" + msg.sender + \"/\" + msg.payload.number + \"/state\";\nmsg.payload = \"opening\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":1580,"wires":[["54bd9f96d12d1d74","fbbba0f3ce4c2c8d"]]},{"id":"4d708a73ad7fe217","type":"switch","z":"82db28d3b515ed99","name":"status","property":"payload.status","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"false","repair":false,"outputs":3,"x":670,"y":1620,"wires":[["eefd437a5ada659e"],["ae5b0bba02fab653"],["d5ca2eb1f80aa017"]]},{"id":"ae5b0bba02fab653","type":"function","z":"82db28d3b515ed99","name":"Curtain Closing","func":"msg.topic = \"hdl/cp/\" + msg.sender + \"/\" + msg.payload.number + \"/state\";\nmsg.payload = \"closing\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":1620,"wires":[["54bd9f96d12d1d74","fbbba0f3ce4c2c8d"]]},{"id":"d5ca2eb1f80aa017","type":"function","z":"82db28d3b515ed99","name":"Curtain Stopped","func":"msg.topic = \"hdl/cp/\" + msg.sender + \"/\" + msg.payload.number + \"/state\";\nmsg.payload = \"stopped\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":1660,"wires":[["54bd9f96d12d1d74","fbbba0f3ce4c2c8d"]]},{"id":"1500e6abd0573001","type":"comment","z":"82db28d3b515ed99","name":"Broadcast msg","info":"","x":560,"y":1560,"wires":[]},{"id":"435fd4cd25251e42","type":"debug","z":"82db28d3b515ed99","name":"To MQTT","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":340,"y":1800,"wires":[]},{"id":"e4f4cb87d2b737f2","type":"change","z":"82db28d3b515ed99","name":"CH 2","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.curtains.1","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":1760,"wires":[["473009273b725054"]]},{"id":"8edfb163d135a32b","type":"change","z":"82db28d3b515ed99","name":"CH 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.curtains.0","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":1620,"wires":[["4d708a73ad7fe217"]]},{"id":"92c99617936cc788","type":"function","z":"82db28d3b515ed99","name":"Curtain Opening","func":"msg.topic = \"hdl/cp/\" + msg.sender + \"/\" + msg.payload.number + \"/state\";\nmsg.payload = \"opening\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":1720,"wires":[["a0b30cf2d8793001"]]},{"id":"3341897c03f479b6","type":"function","z":"82db28d3b515ed99","name":"Curtain Closing","func":"msg.topic = \"hdl/cp/\" + msg.sender + \"/\" + msg.payload.number + \"/state\";\nmsg.payload = \"closing\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":1760,"wires":[["a0b30cf2d8793001"]]},{"id":"656fc12b6e98a667","type":"function","z":"82db28d3b515ed99","name":"Curtain Stopped","func":"msg.topic = \"hdl/cp/\" + msg.sender + \"/\" + msg.payload.number + \"/state\";\nmsg.payload = \"stopped\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":1800,"wires":[["a0b30cf2d8793001"]]},{"id":"473009273b725054","type":"switch","z":"82db28d3b515ed99","name":"status","property":"payload.status","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"false","repair":false,"outputs":3,"x":670,"y":1760,"wires":[["92c99617936cc788"],["3341897c03f479b6"],["656fc12b6e98a667"]]},{"id":"a0b30cf2d8793001","type":"rbe","z":"82db28d3b515ed99","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":1030,"y":1760,"wires":[["5aaa0e452489ef82"]]},{"id":"fbbba0f3ce4c2c8d","type":"rbe","z":"82db28d3b515ed99","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":1030,"y":1620,"wires":[["5aaa0e452489ef82"]]},{"id":"ca09e63223db2cb8","type":"hdl-raw-out","z":"82db28d3b515ed99","controller":"","name":"","x":1680,"y":220,"wires":[]}]
- Change the 4x in and out nodes to match your setup.
For info it is important that you enter the opening time in milliseconds(in the cover.yaml file) if it is entered in secounds the loop might go crazy fast and it could overload the CPU depending on your hardware.
Also time to close and steps are not in use at the moment and is ignored in the flow (But dont remove the values as this might corrupt something).
Think the % calibration(to avoid drift after lots of on the sliders) should be done by it self now everytime the blind is in 100% or 0% but have not done any testing on this yet.
Let me know what does not work for your setup, have left all the debug nodes in there if some debuging is needed