Giter Club home page Giter Club logo

shutterfw's Introduction

Firmware for curtains, blinds, shutters, ...

This device is special because it has a microcontroler (Nuvoton, MCU from now) for leds and relays. The communication with the ESP8285 is via Serial port with AT commands.

I made this firmware for two main reason:

  • Tasmota doesn't manage right the MCU
  • Tasmota doesn't work fine with Alexa (in any curtain mode)

And here is the result of hours of frustration with Tasmota and reversing the behaviour of the device.

Supported devices

Also, I reuse the same code for differents HW devices that I have:

  • KingArt Q4 Curtain
  • BlitzWolf SS4 (2 ways)
  • Sonoff Dual R2 (2 ways)
  • MS-108

Calculate up/down times

KingArt Q4

The MCU manages all the things related with timming, pressing and relays, and inform to the ESP via AT commands. To configure the timming do the next:

  • Lower the blind totally.
  • Press the middle button (stop) during 4 seconds. The 3 buttons start to blink.
  • Press the up button. When the blind reach the top, press again the up button.

Now, the timming to up/down the blind are configured. Remind that this behaviour is managed by the MCU, not any code in this repository related with that.

Other boards

In the configuration webpage, there is an integer that must configured with the time the shutter take to down or up (the maximum of both). This time will be use to calculate the percentages of open with Alexa and HomeAssistant.

Compilation

Using platform.io, you can select between diferent environments: kingart or other boards.

First flash

KingArt Q4

This comment in Tasmota issues is very clear:

NOTE that the user was wrong, the GPIO0 for flash is SW, close to GND (both soldered). The pinout "RES1" is not required.

arendst/Tasmota#5059 (comment)

Other boards

After install the firmware for other boards, you need to configure the pinout for each one. As example, this is the pinout I am using in my devices, but you need to adapt to your soldered pins.

Sonoff Dual R2

  • Relay UP -> GPIO 5
  • Relay DOWN -> GPIO 12
  • Button UP -> GPIO 0
  • Button DOWN -> GPIO 9

BW SS4

  • Relay UP -> GPIO 12
  • Relay DOWN -> GPIO 5
  • Button UP -> GPIO 14
  • Button DOWN -> GPIO 2
  • LED -> GPIO 5

MS-108

  • Relay Up -> GPIO 12
  • Relay Down -> GPIO 14
  • Button Up -> GPIO 4
  • Button Down -> GPIO 5

Firmware configuration

When you flash the device the first time. It creates an Access Point with name SHUTTERFW_XXXXXX. You must connect to it with password "fibonacci" and navigate to http://192.168.4.1:8080

Configure the WiFi parameters and other also and restart the device to connect to your wifi.

After that, navigate to the IP that your router give to the device and configure it in: http://<IP>:8080

HomeAssistant Integration

To configure with HomeAssistant, you need to have configured:

  • MQTT Server
  • Hostname
  • Click on "Enable HomeAssistant Integration" checkbox

After that, click on "See HomeAssistant configuration" link and put those configuration in your configuration.yaml file and restart your HomeAssistant server.

TODO List

  • Integration of KingArt Q4 Curtain
  • Integration with BlitzWolf SS4
  • Integration of Sonoff Dual R2
  • Dynamic parameters instead hardcoded (time up/down, wifi, mqtt config, hostname, alexa name, ...)
  • Integration with HomeAssistant
  • Remove all the content and the file config.h. Make it dynamic and configurable in web interface.
  • Code clean (hehe)
  • Control the device from the management webpage
  • Set different levels of open (for instance: 30%, 50%, 70%, 90%)
  • Add mDNS (Not yet)

shutterfw's People

Contributors

plutec avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

shutterfw's Issues

HA maintain pressed the button

When use the virtual button of HA (via MQTT), after reach the end of the movement, the button keep pressed. After that, if you move manually or using Alexa the shutter, it takes the HA button and move again.

Set different opening levels

Define some intermediate levels, because during the first seconds of opening really does not open the curtain. The visual effect to 50% is not really 50%.

Does not reconnect to wifi

Steps to reproduce:

  • Turn off wifi and device
  • Turn on device, wait 1 minute
  • Turn on wifi

Behaviour:

  • The device does not reconnect to wifi until you press any button (to up or down the shutter).

Warning HA

Unable to parse JSON EF470B_RL_2: '{"name":"Relay2","stat_t":"tele/persiana_patio/STATE","avty_t":"tele/persiana_patio/LWT","pl_avail":"Online","pl_not_avail":"Offline","cmd_t":"cmnd/persiana_patio/POWER2","val_tpl":"{{value_json.POWER2}}","pl_off":"OFF","pl_on":"ON","uniq_id":"EF470B_RL_2","dev":{"ids":["EF470B"]}'

Flash MS-108wr

Hello,

I have a MS-108WR. Do you knwon how I can flash it?

I do not find a tutoriel with pinout.

Thank you

Hostname in network

Appears as ESPXXXX instead the device name. Solved with this: WiFi.hostname(wifi_hostname.c_str());

Delay open Access point

For instance, when there is electricity problems, wait a reasonable (configurable time) to give time to WiFi router to start. This will prevent to show your shutters to your neighborhood.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.