I’m looking for a way to set more than one (in my case 4) binary GPIO pins at the same time.
I’m using Superrollo GW60 with the remote control currently connected to a RPi and via MQTT to Home Assistant, but the RPi is bored and it’s an overkill for less than 10 signals a day. Max Winterstein solved the issue already with Tasmota (as described here: Control Superrollo GW60 (and more!) by enhancing remote with ESP8266), but I want to do it with ESPHome.
I could use an RGBW light with e. g. Slow PWM output (more or less as Max did it), but I don’t trust, that this would be really simultaneous, and it definitely is not the way to do it.
There must be a possibility, to set more than one binary GPIO pin simultaneously in ESPHome since it can do everything, I just don’t find it. Please point me into the right direction.
There’s no way Esp can set 4 pins at the same time. I’t not a question of Esphome.
There is a certain time Esp needs to execute all instructions to set pin state, in normal use it’s in the range of 100-200 nanoseconds for Esp32 afaik. It can be done quicker with direct port manipulation, but never simultaneously.
@tom_l, thanks for sharing your idea, unfortunately I’m more the software-guy, trying to avoid additional hardware whenever possible
@Karosm, I’m not completely convinced by your statement. GPIOs seem to be memory mapped at address 0x3FF4_4000, and if each digital GPIO is assigned one bit, it should be possible to set at least 8 of them simultaneously, if they are assigned to one byte. Write operations on memory are usually done at once for all bits of a byte (depending on the architecture it could be even two or four byte). But I trust Tom, that this is not implemented in ESPHome.
The article of Max as linked in my original post describes quite extensively, what I want to do, but I want to do it with ESPHome instead of Tasmota. Here the short version:
I have two Superrollos GW60 (window covers). There the communication between remote control and the covers is encrypted to avoid replay attacks. So the way to implement them to Home Assistant is to manipulate the remote control by soldering 4 wires to 4 pins of the chip, which encrypts the signal.
Depending on the state of these 4 pins the chip sends a different signal whenever it sees something else but 4 low. So e. g. by providing I00I on the 4 pins it sends the signal for opening cover number 2. So more or less it’s a parallel transmission of 4 bit without clock.
I’m still hoping to find a trick how to do that in ESPHome (without additional HW).
@Mahko_Mahko: actually this was my very first approach, but I discarded it. Probably I was thinking to complicated. I will give it a try and report back (please don’t expect an answer too soon, vacation is over
@Karosm , I have no idea, where I would put that statement.
Thanks to all of you for your support, as described in Superrollo GW60 with ESPHome I managed to solve the issue. With the additional encouragement from @Mahko_Mahko I tried the simplest way and it works.