Motor on a roller blind - ESPHome version?

I bought the jysk blinds and just waiting for them to arrive. I used 3d prints from thingiverse

https://www.thingiverse.com/thing:3904722

I have some spare d1 minis around the place so will use those for control.

Cool! Where did you get the bairing?

Got them off Amazon. The outer diameter is slightly too big so i had to file down the gear. I tried to edit the stl but I just couldn’t work it out

I’m afraid not. I was hoping to use your code above. Can the switch not work with an automation?

I’m not bad with esphome. But to come up with code I need to make it next to the stepper etc. Also… combining an ikea switch with esphome are not really the same sort of thing… if you have entities of the ikea and entities of the esphome in homeassistant you can combine them with “logic” (which can be a blueprint).
Atm I have little time. Will measure my rollers next week to see if the 3d models fit my pipe. Then if yes I will order stuff. When I will be successful I will add the code here for sure.

Start with a simple automation via homeassistant

I have the up down switch from ikea from my fyrtur blind. I will see if i can get that working when I’m setting up

just tested this blueprint: https://gist.github.com/boelle/c4f2145262591d51e65db4f1bd482c13

works with this esphome code: https://gist.github.com/boelle/b08c2c78948f243f9a44a551cb0f4775

I have completed my blind and it seems to be working well. I’m running cable to each each of the windows at the minute and will mount once I’m finished. So far so good

I have been testing my setup for a while and works ok’ish

the only thing i would have liked to change is the esphome code so that when i do the setup i can do so when half way up and it figures the total height of the window. I rarely open them more than half anyway

@RoadkillUK how can that be done? ie it goes all the way down and i press the switch and it goes up, now i would press again at the top but i would like to do it at the halfway mark

If you don’t want it to go all the way to the top then press the button the second time where you want it to stop, that’s all really. However, the blind won’t fully open as it thinks it’s open 1/2 way :slight_smile:

that is what i want… i want to have the option to go all the way up should i need it

but for the setup/calibration i want to use the halfway mark, the window have a cross on it and the horizontal beam is a nice halfway mark

tried to eyeball the code and figure where to make changes

script:
  - id: setupbutton
    then:
      - if:
          condition:
            - lambda: 'return (id(settingmode) == 3);'
          then:
            - logger.log: "Pressed Setup Button: Mode 3"
            - stepper.set_target: # Set Stepper position
                id: my_stepper
                target: !lambda return id(my_stepper).current_position;
            - globals.set: # Set Endstop Variable
                id: endstop
                value: !lambda return id(my_stepper).current_position;
            - globals.set: # Set Global stepper position
                id: my_stepper_global
                value: !lambda return id(my_stepper).current_position;
            - globals.set: # Reset Setting Mode
                id: settingmode
                value:  '0'
            - globals.set: # Set toggle to Open
                id: openclosed
                value: '1'
            - cover.template.publish:
                id: blinded
                state: OPEN 
                current_operation: IDLE
            - logger.log: "Exiting Setting Mode"
      - if:
          condition:
            - lambda: 'return (id(settingmode) == 2);'
          then:
            - logger.log: "Pressed Setup Button: Mode 2"
            - stepper.report_position: # Reset Stepper position to 0
                id: my_stepper
                position: '0'
            - stepper.set_target: # Reset Stepper position to 0
                id: my_stepper
                target: '0'
            - globals.set: # Move stepper to 0 (doesn't move it's already there!)
                id: my_stepper_global
                value: '0'
            - stepper.set_target: # Reset Stepper position to 72000
                id: my_stepper
                target: '72000'
            - globals.set: # Advance setup to next mode
                id: settingmode
                value:  '3'
      - if:
          condition:
            - lambda: 'return (id(settingmode) == 1);'
          then:
            - logger.log: "Pressed Setup Button: Mode 1"
            - stepper.report_position: # Set Stepper position to 72000, makes it move to 0 (Closed)
                id: my_stepper
                position: '72000'
            - globals.set: # Advance setup to next mode
                id: settingmode
                value:  '2'
  • globals.set: # Set Endstop Variable
    id: endstop
    value: !lambda return id(my_stepper).current_position;

could it double the my_stepper ?

my thought is that it has counted steps for half the way, but when i press the switch to finish the calibration it would think its at the top hence it needs to store another value for endstop

@boelle

I’ve made fork of my github repo and changed the files to allow the following:

  • Single click of the button will open 50%/close
  • Double click of the button will open fully

I think you have changed the original code, so compare the changes.

Edit: I don’t have a button on my blinds so I can’t test it myself :frowning:

you misunderstood me…

its only during calibration i wanted to do it half way

ie i press the button for more than a sec, then i press again to make it go down
when its down i press again to make it go up

so far everything is normal

the change i was after is to press the final time when its half way up, normaly you will press when its fully up

pressing the final time when its halfway up means that it must double the number of steps counted

and after the calibration it would also have to report 50% pos

Awesome fork! And the original code was a perfect replacement for the old sketch, so much easier to manage these from ESPhome!

Hello,

I have used that with 3 tupplur IKEA rollers and I suppose that engines are too weak.

In my opinion - there is a problem to scroll up roller. window is abt 1,5m high.

I have used that code: https://github.com/RoadkillUK/Motor-on-a-Roller-Blind-for-ESPHOME
May I can tweak something in the code? Unfortunately I do not understand how that is programmed. I am non-tech guy…
I have used that printed parts: https://www.thingiverse.com/thing:2392856

After some googling I saw that there is many threads how to make 28byj 5v engines more powerfull cutting the redwire and using L293D board instead of the original one ULN2003.

I would be very happy for any information from you, did you have had similar problems.
How to manage it?

regards

For me a single motor worked just barely, what I did was to use two motors. Mainly cause I wanted the blind to operate faster so I changed the gears from 1:0,5 to 1:0.75.

Wow, that’s great idea.
I just ordered next frames for engines, but… could you share your code ?

I am not sure how to control both engines from one esp, and how to control that another one, in different direction (I suppose?)
regards