Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normal shutter switch. How to connect and properly configure? #130

Closed
titomontes opened this issue Feb 25, 2019 · 7 comments
Closed

Normal shutter switch. How to connect and properly configure? #130

titomontes opened this issue Feb 25, 2019 · 7 comments

Comments

@titomontes
Copy link

titomontes commented Feb 25, 2019

Hello again:

I want to use a normal shutter switch, which has three positions: Up, Down and a central Stop (or off).

I´m not sure on how the connections should be made (already pasted on another thread, with no responses). Any help will be much appreciated.

@calcipher49
Copy link

calcipher49 commented Feb 25, 2019

Hi,
This shutter switch is indeed 2 bistable switchs, central position set both off.
Use as follows:

  • Common entry (in red on switch) to GND
  • Up entry (upper left) to GPIO A, configured as Switch1 in Tasmota
  • Down entry (upper right) to GPIO B configured as Switch2 in Tasmota
    Use any available GPIO (except GPIO0) on your device for A and B
    You should use Switches, not Buttons, in Tasmota configuration

@titomontes
Copy link
Author

Thanks a lot.

I understand that GPIO0 can be used as long as I disable serial logging, right?

@stefanbode
Copy link
Owner

You connect L with the 5v of your esp and up and down with two GPIO. Do not connect the switch to 220v. This will create a hell fire.

@titomontes
Copy link
Author

titomontes commented Feb 26, 2019

You connect L with the 5v of your esp and up and down with two GPIO. Do not connect the switch to 220v. This will create a hell fire.

LOL. Off course, I did know that @stefanbode . I´ve already implemented several sonoff basic around the house using GPIO14 as a normal switch, and already have this switch properly working... and I have to admit that connecting the switch was very easy and intuitive.

BUT

For the life of me, I haven't been able to properly configure MQTT in HA.

This is my current config:

  - platform: mqtt
    name: "Persiana Salon"
    availability_topic: "salon/persiana1/tele/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    position_topic: stat/salon/persiana1/SHUTTER1
    position_open: 100
    position_closed: 0
    set_position_topic: "salon/persiana1/cmnd/shutterposition"
    command_topic: "salon/persiana1/cmnd/backlog"
    payload_open: "SHUTTEROPEN"
    payload_close: "SHUTTERCLOSE"
    payload_stop: "SHUTTERSTOP"
    retain: false
    optimistic: false
    qos: 1

And tried publishing through another client on my broker with salon/persiana1/cmnd/backlog and it accepts SHUTTEROPEN and SHUTTERCLOSE and works properly, but I don´t know how to make the shutter available on HA (shows it as unavailable, but the topic salon/persiana1/LWT shows it as Online in the external client)

Could it be that there is another retained flag that is causing it to not show on HA? (unlikely, just changed the topic and full topic to salon/persianaa and it doesn't work either)

I´m at a complete loss here...

Also, in case it helps, this is from the console:

00:20:31 MQT: salon/persiana1/SHUTTER1 = 100 (retained)
00:20:31 MQT: salon/persiana1/RESULT = {"POWER1":"OFF"}
00:20:31 MQT: salon/persiana1/POWER1 = OFF (retained)
00:20:31 MQT: salon/persiana1/RESULT = {"SHUTTER-1":{"position":100, "direction":0}}
00:21:21 MQT: salon/persiana1/STATE = {"Time":"2019-02-27T00:21:21","Uptime":"0T08:30:39","Vcc":3.444,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"Montes01","BSSId":"34:97:F6:61:67:C0","Channel":8,"RSSI":52},"DeepSleep":0,"Heap":22768}
00:21:21 MQT: salon/persiana1/SENSOR = {"Time":"2019-02-27T00:21:21","Switch1":"ON","Switch2":"ON","SHUTTER-1":{"position":100, "direction":0}}

Cheers

@titomontes
Copy link
Author

FINALLY!

I can confirm the shutters working fully wit this config:

  - platform: mqtt
    name: "Persiana Salon"
    availability_topic: "salon/persianaA/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    position_topic: salon/persianaA/SHUTTER1
    position_open: 100
    position_closed: 0
    set_position_topic: "salon/persianaA/cmnd/shutterposition"
    command_topic: "salon/persianaA/cmnd/backlog"
    payload_open: "SHUTTEROPEN"
    payload_close: "SHUTTERCLOSE"
    payload_stop: "SHUTTERSTOP"
    retain: false
    optimistic: false
    qos: 1

where salon/persianaA is the full topic (in reality, if you go to the information page in Tasmota, the full topic will be salon/persianaA/cmnd).

I´m gonna modify the Wiki so this sticks.

Cheers

@stefanbode
Copy link
Owner

Thanks for updating the wiki!

@titomontes
Copy link
Author

Oh crap. Turns out your initial config was completely right. I didn´t realize that I had changed my default MQTT Full topic, so all the MQTT spelling changed. I´ve returned to standard and initial config works perfectly. I´m fixing you wiki (back)

SOO sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants