Blinds control V 2 Invert blind state


#1

Version 2 blind control configuration option to invert blind state
I have installed blind system but needed to have blinds close in the opposite way, ie. curved part of blind facing out and not in, to achieve this I changed the commands open=0 and closed=100 to *****

open=100 and closed=0 (Non Standard)

and half remains the same, all works great but now the roller shutter icon state is reversed, shutter shows open when blind is closed etc, I have seen in other sites an option that reverse state in the configuration file of the device.

Default is blinds swing down to close in this setup.

Blinds have two possible states to close from open position.

Swing down to close (Default) 0=open, 100=closed, this is the standard command set.
SWING DOWN to Close

or

SWING UP to close, (reverse command) , 0=closed, 100=open.
SWING UP to close

this is non standard command and causes inverted feedback states. And is opposite to how Alexa, Google and any other Home Assistant System operates.

I Am using the reverse command method to achieve the swing up to close. This method does work but is messy and can cause some problems and can be confusing to operate. Solution needs to be transparent and easy to use. Less programing modifications in sitemap files etc…

I have downloaded Matt’s V2 Arduino file
Process I am working on.

Program each blind individually through the new WiFiManager front end as in V2.

Ability to change swing direction to close from open state. ie swing down or up to close

Allow for left or right side install of servo modification. Default is left.

Allow for Open State Trim adjustment. eg re-adjust 5 degrees on 0 plane) re align via software not mechanical if slightly out

Ability to reset the device via web to force WiFiManager to run setup again.

Over the last few weeks I have learnt a lot about coding but still a beginner but have achieved the following :-

WiFiManager Setup new options

Invert Blinds State (Yes/No) this inverts state sent back to MQTT Server
Invert Blinds command (Yes/No) This inverts command received 0 becomes 100 and 100 becomes 0. use to change swing direction.

Open Trim adjustment (+/- degrees) default is 0, between 0 and 25 degrees

Reset Code (Reset Code Stored In Flash)
Remote reset device settings via web . htpp://DEVICE_IP_ADDRESS/reset/RESET_CODE
htpp user name and password must be entered aswell
e.g. htpp;//192.168.0.10/reset/123456

Using Invert Blinds State and Invert Blinds Commands can achieve changing swing directions and install options either left or right with correct results.

The open Trim Adjustment adjust the blind after reporting its state to MQTT server so not to affect the visual state condition in Openhab.

I am still testing changes for correct operation etc
So far all OK

Once all tested from My side I will forward the code to the Owner Matt, for his testing, approval and then release. Matt will be able to tidy up code etc


#2

I was wondering when someone would ask this. With mine, I set closed to 100 and open to 45 and removed the “open” completely. The only time that the blind is actually “open” is when it is set to half (I think 52 is where matt had it programmed?) But now I just have 2 OpenHab buttons, “Open” and “closed” and used the closed and half icons. I know that may not help your specific application but it may influence you to to make the same changes:love_you_gesture:


#3

Why not just change the angle multiplier from 1.8 to -1.8 and add 180 to that value for writing and the opposite for reading?

moveServo(msgString.toInt() * -1.8 + 180);

and

client.publish(String(mqtt_topic) + “/state”, String((int)(((myservo.read() - 180) / -1.8) + 0.5)));

So them 100 becomes 0 and 0 becomes 180. Seems that this would be the simplest was to accomplish the inverting.


#4

I have completed update to Matt’s V2 Arduino file.
The following have been added to the WiFi Manager front end as in V2

The changes allow for ease of use with no need to reprogram or change coding in Openhab etc or re coding of Blind Control software
Keep It Simple. Easy install and configure

WiFiManager new options also creates AP SIDD based on Software version
I
Provide universal transparent control and states to OpenHab, Alexa, Google etc.
0=OPEN and 100=CLOSED (Standard Defaults)
e.g. “Alexa, Set Lounge Blind to 100%” would close the blind
“Alexa, Set Lounge Blind to 0%” would open the blind
“Alexa, Set Lounge Blind to 50%” would set the blind to 50%
or
“Alexa, Turn On Lounge Blind” would close the blind
“Alexa, Turn Off Lounge Blind” would open the blind

Program each blind individually through the new WiFiManager front end as in V2.

Ability to change swing direction to close from open state. ie swing down or up to close

Allow for left or right side install of servo modification. Default is left.

Allow for Open State Trim adjustment. eg. re-adjust 5 degrees on 0 plane) re align via software not mechanical if slightly out

Ability to reset the device via web to force WiFiManager to run setup again.

Ability to position servo motor to OPEN position via web before connecting to blinds shaft.

Provide more information in the config status web page and help information

WiFiManager Setup new options V3 and Code changes

  • What Side Is The Servo Motor Installed? LEFT/RIGHT, (Default is LEFT)

  • Swing direction of blind from Open to Close?, DOWN/UP (Default is DOWN)

  • Enter a pin code to authorize a system reset via web access.
    Reset Code (Reset Code Stored In Flash)
    Remote reset device settings via web . htpp://DEVICE_IP_ADDRESS/reset/RESET_CODE
    htpp user name and password must be entered as well
    e.g. htpp://192.168.0.10/reset/123456
    Use This to reset device or to re configure. e.g. you want to change SPEED of blind remotely

  • To adjust the trim angle of the blinds physical open position against software open position. Between 0-40 Percent Default=0

  • Ability to position servo motor to OPEN position via web before connecting to blinds shaft.
    htpp://DEVICE_IP_ADDRESS/set-servo

    This will set the servo motor to desired OPEN position based on what side motor installed on and also the swing direction to close as configured in WiFiManager. You will be prompted to disconnect the power to controller before system reboots to prevent slip.

New WiFiManager setup new options also creates AP based on Software version info

New Status web info
Hostname: BlindControl2
Software: MK-BlindsControl V3.06
MQTT Server: 192.168.0.100
MQTT Port: 1883
MQTT Authentication: TRUE
MQTT Command Topic: BlindControl2
MQTT Status Topic: BlindControl2/state
Blind Speed: SLOW
Servo Motor Installed Side: LEFT
Blinds Swing Direction To Close From Open: UP
Blinds Trim Adjustment Open State Percent: 0
Invert Blind State Software Auto Config Set To: YES
Invert Blind Command Software Auto Config Set To: YES
***To Set the Servo Motor To OPEN Position Via Web Browser By Going To http://BlindControl2/set-servo
***To Update Firmware Via Web Browser By Going To http://BlindControl2/firmware
***To Software Reset Via Web Browser By Going To http://BlindControl2/reset/RESET_CODE
***Alternatively use DEVICE IP ADDRESS of Device e.g. 192.168.0.100/firmware or /reset/RESET_CODE or /set-servo
***Substitute RESET_CODE with reset PIN that was entered In Setup
**To Physically reset device settings restart the device and quickly move the jumper from RUN to PGM, wait 10 seconds and put the jumper back to RUN.

New Feature TRIM Adjustment.
Use this to adjust OPEN State if the angle out slightly due to mechanical install errors,
i.e. things moved slightly while connecting servo motor to blind shaft
See below Pictures

Blind Off Zero Plane

10 Percent TRIM Adjustment Applied In Setup bringing blind to a Zero Plane


Reset ip blind control
#5

Wow Mountain,

I think you really nailed all the concerns that I had with Matts original firmware so I wouldn’t mind giving yours a shot when I get some free time. Just to be clear, does your “open” setting set the blinds to the horizontal plane pictured above or does it still work like Matts where both “open” and “close” are actually, in fact, closed since you can’t see through them and somewhere around 30-60% is an actual “open” setting (which would be your horizontal plane picture above) In my case, I think I could get away with a 90 degree servo instead of the full 180 since I only rotate the blinds from closed (100%) to open (52%) each morning and evening and will never use anything in between. I’m sure this can be done in the code somewhere rather than purchasing a specific physical servo but I just haven’t got around to really digging any deeper than what Matt has provided.


#6

Open is zero plane open by default, the actual servo motor is at maxium setting for that position.
With the servo motor it is critical you set this to the full open position via software before you connect it to the blind shaft and the blind is in the zero open plan as well, i.e. can see straight through, you don’t know what position servo motor is in from manufacture.
The 180 degree servo motor is fine and no need to re code software.
If you want your blinds to show fully open at 50% i.e. 45 degrees then I would set TRIM adjustment
to a level 0-50 , You will still get the correct states reported back to MQTT and OpenHab.
****I will adjust the V3 code as I have coded limit rang for TRIM Adjustment, internally set max at 40
With V3 And TRIM Adjustment should function for you I will Try myself.
The Blinds will still go to Fully Open Zero plane first the re adjust to your 30% or so. This allows for correction of mechanical slip.
I currently have my blinds running in slow mode with trim adjustment and they look impressive going from closed to Zero plane then adjust back to TRIM setting
Will test your setup and get back to you
Hope this helps


#7

I’m fairly knowledgeable with how the servo actually works, and as far as initially attaching it properly but I don’t think I’m following you 100% yet. I don’t think I need the blinds to go to any position after hitting zero plane (you mentioned 30%) I think I would actually prefer that this zero plane position is the final open position (I thought that is what you were initially explaining, otherwise, what is zero plane position for?).

I have also found that when setting my “open” position to anything less of 60% and when going from closed (100%) then the blinds will first go all the way to 0% and then back to position (<60%) if I set it to 61%+ then they just go directly to position which I like better but 61% isn’t quite zero plane and doesn’t let in maximum amount of light. This movement to 0% first is obviously to avoid the mechanical slip that you mentioned (and your V3 does this at zero plane instead of 0%, correct?) but I can’t say that it’s not annoying and I may find it a little more tolerable once I try running them in slow mode which I haven’t yet tested.

Thanks

Cody


#8

The Blinds will go to 0 open state fully then back to the percentage you set if your setting is between 40 and 60 this is in Matts coding and for the slip. this must be were the hump is…
The Zero plane is the open state 0 % were the blinds are level and maxium light is allowed to pass,
I have set the servo motor to open state and blinds to open full state before connection. As the servo motor operates from 0 degrees to 180 degrees, hence 0 degrees is converted to 0 OPEN, and 180 degrees is converted to 100 CLOSED.
From testing I had hum in motor as I did not set them to correct position, and when motor receives its position command and can not get there because of mechanical miss alignment will stop after software time out…
To me its important to have motor at correct open position and blinds themselves at open full level i.e. zero plane before connection. which allows full motion of motor from 0 to 180 degrees.

If you need to have your open level set to something else say 60% you want to have the angel at 45% as your desired open position permantley then I would use the TRIM adjustment.


#9

Nice! How much time did that take to make?


#10

Where can I get this V3 firmware :open_mouth: It looks awesome.

Remote reset is great idea (slow is not so quiet and I really don’t want to move the couch and get out a ladder to reset it)

Does the trim actually adjust 0 and 100 point? or does it just say go to 0 then change that to 30 and call it zero? (software based trim effectively vs allowing the servo to go past 0/100 etc)


#11

The Trim setting is used to adjust the open position so you send command 0 or open the servo motor will be in maxium opened position. but the physical visual state is not quite correct due to error in installing or you want your blind to be opened at 30 percent as fully opened. Yes the 30 percent is actually zero.


#12

V3 Firmware has been forward to Matt for distribution


#13

Any update? I really want to play with v3 :slight_smile:


#14

I have Version 3 ,now version 4 added the ability to turn off going to fully open state before moving blind to mid range position, between 40 and 60 percent open. Doesn’t give correct positioning if turned off as weight shift of blind mechnisim is no longer compensated. Just allows a bit more configuration options to customer.

I can email them to you


#15

I have Created a DropBox Link to version 4 bin file you can down load from there and test it out. Any feed back will be great

Thanks


#16

This is awesome :smiley:

Cheers mate


#17

@Mountain Thanks so much for your work creating this inversion update, just what I wanted plus extras!

Thanks!


#18

Please let us know how the install went and configuation process was…and any problems as I have tried to cover all possibilities


#19

I installed your V4 in two of my controllers that needed to be reversed without issue. They work just fine, no issues. Configuration went smooth. Thanks again!


#20

Thanks for feed back