-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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->... |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :)
f7d7087
to
48d0f22
Compare
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. |
5042620
to
64cb808
Compare
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.