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

Add cookbook for dual relay cover #10

Merged
merged 1 commit into from
Jun 13, 2018

Conversation

aequitas
Copy link
Contributor

@aequitas aequitas commented Jun 9, 2018

With some more testing I might optimise this by moving the relay logic (interlocking/delayed off) into the switches instead of in the cover component.

Copy link
Member

@OttoWinter OttoWinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thank you!

Just a few minor comments.

then:
# logic for cycling through movements: open->stop->close->stop->...
- lambda: |
if (id(serre).state == cover::COVER_OPEN) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean cover? serre doesn't seem to exist.

Also I only made the .state member of the Cover class public in the latest dev build. Maybe add a link to https://esphomelib.com/esphomeyaml/guides/faq.html#how-do-i-use-the-latest-bleeding-edge-version until I release 1.6.3 or 1.7.0 (I'll see when I can release that).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I missed that one in converting this to a generic cookbook. I'll test the cookbook before the next update as well.

We can wait with merging this until the next release :)

} else {
id(serre).open();
}
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment here that this branch is triggered when we don't know the state yet - otherwise might be a bit confusing.

name: close
id: close
# 'hide' this from homeassistant as we don't want it to be controller directly
discovery: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I probably should also add an option to make esphomelib not send anything. Currently this will cause esphomelib to not send discovery messages, but still send state messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, was going to raise a feature request for it. But as temporary workaround this was working enough for now :)

Dual relay cover motor control
==============================

The following is a possible configuration file for common covers that use a motor with 2 inputs. Only one should be powered at a time (interlocking) to either move the cover up or down. For this the [Sonoff Dual R2](https://www.itead.cc/sonoff-dual.html) can be used which has two independent relays. Additionally this configuration allows the single button on the Sonoff to control the motion by cycling between: open->stop->down->stop->...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markdown links do not work in RST ([Sonoff Dual R2](https://www.itead.cc/sonoff-dual.html)), write

`Sonoff Dual R2 <https://www.itead.cc/sonoff-dual.html>`__ 

instead. See https://esphomelib.com/esphomeyaml/guides/contributing.html#contributing-to-esphomedocs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry my bad, force of habit. I'm mostly write md :)

@aequitas aequitas force-pushed the dual_r2_cover branch 2 times, most recently from f7d7087 to 48d0f22 Compare June 9, 2018 11:58
@aequitas
Copy link
Contributor Author

aequitas commented Jun 9, 2018

Thanks for the quick feedback. I pushed a (tested) update.

Btw, thanks for the great effort put into esphomelib and esphomeyaml. I was really looking for this kind of high level configuration for my devices. Probably gonna replace a lot of Tasmota flashed devices with this.

@OttoWinter OttoWinter merged commit cdfa017 into esphome:current Jun 13, 2018
@esphome esphome locked and limited conversation to collaborators Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants