Hi all!
I am new to the community and I’m very amazed so far by the possibilities of HA.
I have installed some Sonoff Dual switches with Tasmota firmware in my house to drive the blinds. I chose the Dual version so I can use them to roll the blinds up and down. I have this setup integrated and working perfectly with HA.
The problem is that my blinds do not have limit switches to indicate when the blind has been fully rolled up/down. I know that a full roll down from top to bottom takes exactly 26 seconds, so I guess could use that to my advantage.
I was taking a look at the counter component (https://home-assistant.io/components/counter/) and what I’d like to do is and automation that starts when the blinds down switch has been turned on, and start adding 1 to the counter every second.
That way, not only I’ll be able to turn the switch off when the counter reaches 26, but also I’ll be able to know the current position of each blind at all times and to create an automation that opens my blinds at 50% by stopping them when the counter reaches 13.
The only thing I’m missing for this recipe is a way to increment the counter by 1 every second WHILE the blinds switch is ON, and to stop counting when the switch status changes to OFF. Here’s where I need your help.
Is there a simple way to do that? I’ve searched the forums but I could not find something similar.
Thanks!
For something relatively complex like that and because you seem to understand programming concepts, it might be worth your while to take a look at AppDaemon
Off the top of my head you could do this using two automations 1 that is initially off and that is turned on by the down switch, the automation triggers every second using the time /1 format, the action would be a service call to increase the counter, the 2nd automation would trigger on an input number/slider value being equal to the counter value and the action would turn off the 1st automation and the blinds and reset the counter. You may be able to combine them, but it’s late and I’m off to bed soon. Or @aimc’s idea might be a better solution
Hey! I found the Cover component while looking around, which has the COVER.SET_COVER_POSITION service available. Do you think it’s a good idea to use that instead?
cover.set_position is for Cover component (https://home-assistant.io/components/cover/), but you have switches, that control a cover. So cover.set_position will probably not work.
You could use a delay in the action part of your automation, something like
That’s exactly how I have it right now The problem is that I can only fully open or close the blinds.
I will see if I can implement the MQTT Cover component with the Sonoff Dual switches.
Thanks for the tip!