Using Input 1 & 2 as Outputs to Operate Garage Door Bolt

Hello,

I am looking to use “Input 1” and “Input 2” on the Konnected Blaq as outputs to provide 3.3v signals to an H-Bridge motor controller to lock and unlock an electric garage door bolt.

In theory, I would like to use status of the garage door (closed, opening, etc.) to set “Input 1” and “Input 2” (GPIO5 and GPIO9) high (3.3v logic voltage) to actuate other devices. In my case that would be a garage door electric bolt, operated by setting “Input 1” and “Input 2” high/low to control an H-Bridge motor controller.

The bolt I am using is a GENIE 41149R Garage Door Power Lock. It has two terminals, which open and close the bolt when 12v is applied. Positive voltage to one terminal (negative to the other) opens the bolt. Reversing the polarity closes the bolt. The bolt doesn’t require power to stay open or closed. Specs indicate 0.7A draw to open or close, but it draws slightly less than that when tested.

The motor controller I will be using is a TB6612. It will perform the function of reversing the polarity. It handles motor voltages from 2.5V to 13.5V and logic voltages from 2.7V to 5.5V and can deliver up to 1.2A continuous and 3A peak current per channel. It’s a dual channel H-Bridge, but I’ll only be using one channel. It will be powered by a buck converter (12v to 5v), which will piggyback off the 12v from the Blaq using the two screw terminals on the Blaq. The 12v from the Blaq will also provide the motor voltage to actuate the electric bolt. I plan on using a 2A 12v AC adapter rather than the 1A provided with the Blaq to ensure the amperage drawn by the bolt does not cause deleterious fluctuations in the power supplied to the Blaq.

When status of the garage door changes to “Opening”, I would like to set “Input 1” high (3.3v) and “Input 2” low for 1s to open the bolt. After 1s both pins would be set low.

When the garage door is “Closed” (not “Closing”) I would like to set “Input 2” high (3.3v) and “Input 1” low for 1s to close the bolt. Again, after 1s both pins would be set low.

I am using Home Assistant, with ESPHome and ESPHome Builder and have moderate knowledge/experience using ESPHome builder to control ESP32 devices through Home Assistant.

What I’m looking for is where (what module(s)/sections of YAML) the status conditions are set by the Blaq and sent to Home Assistant for reporting (as sensor output). This is where I’m thinking of adding the code to set the “Input” pins high/low. Also if there is anything I’m missing that must also be included in the code (bolt status, maybe?).

Any help would be greatly appreciated!

Carl

Hey @Carl_Slemer this is a really cool and useful use case for the extra IO on the GDO blaQ. Great idea. It sounds like we can get this to work. It’s great that the controller accepts a 3.3V signal because that’s what the IO will output.

Assuming you’ve already adopted the GDO blaQ config into ESPHome builder, it sounds like we should be able to add this functionality by adding some YAML to the device’s config that’s automatically imported.

Since we basically have two outputs that need to work in tandem, I would start by defining those outputs and then defining a lock component to represent the lock and unlock actions as you’ve specified:

output:
  - platform: gpio
    pin: $input1
    id: io_1
  - platform: gpio
    pin: $input2
    id: io_2

lock:
  - platform: template
    name: Electronic Bolt
    id: electronic_bolt
    assumed_state: true
    lock_action:
      - output.turn_off: io_1
      - output.turn_on: io_2
      - delay: 1s
      - output.turn_off: io_2
    unlock_action:
      - output.turn_on: io_1
      - output.turn_off: io_2
      - delay: 1s
      - output.turn_off: io_1

Add the above config to your GDO blaQ’s YAML should create the lock entity that will appear in Home Assistant as “Electronic Bolt” which should let you lock and unlock it. Now, this won’t tell us the actual state of the lock, so that’s why I added assumed_state: true.

Once that’s working, we can now automate locking the bolt after the garage is closed by augmenting the GDO blaQ’s cover entity, like this using the on_closed lambda:

cover:
  - id: !extend gdo_door
    on_closed:
      - lock.lock: electronic_bolt

Now I’m just realizing that there’s no equivalent before_open lambda to hook into to unlock the bolt before opening! So the above only really solves half of the equation. It seems like it shouldn’t be too hard to add a before_open lambda to the cover config, but that feels like something that belongs in the generic ESPHome component rather than in the GDO blaQ code.

Why don’t you experiment with the above first and see how that’s working, and then maybe you can work around the lack of a before_open lambda with an automation in HA.

If this works ok, I would consider adding the before_ lambdas to ESPHome and proposing it as an enhancement.

Note: I haven’t tried this code myself, so there may be mistakes. Let us know how this works so far!

3 posts were split to a new topic: Using a relay to control an external garage light with the GDO blaQ

Hi Nate,

The Electronic Bolt shows up in the web interface and on the ESPHome device page. So apparently, working as planned. But, where is the cover component supposed to be inserted? It was easy enough to edit the YAML file and insert the first chunk of code, but the cover component is called remotely during the build process. So, I’m lost as to where/how would I insert that code, since I can’t edit the file on Github.

Thanks, Carl

You just put it in the bottom of your adopted ESPHome config for your device. The !extend keyword is the magic that merges the custom YAML with the packaged YAML.

The additional YAML doesn’t have to go anywhere specific. When ESPHome compiles it merges everything together automatically for you.

I didn’t properly convey in my last post, but the first section of code provided buttons to lock and unlock the bolt, which work correctly on the web interface, but the web interface also has an additional button (up arrow) to open the door(?), and when pressed the log indicates “Electronic Bolt’ Does not support Open.” Based on the code, I don’t understand where that button came from.

I updated the YAML with the additional Cover code, and the bolt does lock when the door is closed, but the bolt also locks when the door starts to open, which, of course, stops the door. If I manually open the bolt immediately after it locks, the the door opens fully and I can then close the door and the bolt will lock when the door closes. I’m wondering if the device somehow energizes the the input/output terminal(s)?

FYI, I did see, in gdo.h, a typedef enum GDO_DOOR_STATE_OPENING, but can’t see where in the code the state is set. This might be where to initiate the unlocking of the bolt.

The ESPHome lock component also supports an open action which isn’t applicable to this device. Just ignore. I don’t think this should show up in HA if it’s not supported.

Hmm, this is unexpected. Can you post some logs of that sequence?

Unfortunately that’s not how it works. The best/cleanest way to implement this would be to add a before_opening lambda trigger to the cover component. Seems feasible, just nobody has done it yet.

As far as the logs go, I must be doing something wrong. I have subscribe to logs checked, but Log Viewer is not working. I also don’t see anything related to the bolt opening and closing in the activity window on the right side of the Blaq web page at all. Not just when the bolt locks when it shouldn’t, but also when it locks correctly, after closing, and when I manually lock and unlock it from the Blaq web page.

After further investigation… apparently something has changed in Home Assistant 2025.11 eliminating log files. “…home-assistant.log is no longer created in HA 2025.11.”. This was apparently done to handle issues associated with low powered devices like Raspberry Pis. The community has stepped up and developed integrations that will provide logging. I will investigate, install one of them, and try to obtain logs of what’s going on when opening the garage door. I’m going out of town this weekend, so I’ll try to get to it before I leave, if not, it will be early next week.

Hmm. The device (ESPHome) logging should be independent of Home Assistant logging. Try adding this to the bottom of your GDO blaQ config to increase the logging verbosity:

logger:
  level: VERBOSE

Sorry, I was looking at Home Assistant logs. Attached are the logs. I don’t see anything in them on the bolt locking or unlocking. I did add a section to the YAML under the logging section “lock: VERBOSE”, and still don’t see anything. Apparently I can’t upload the logs as a new user.

Here are excerpts:

[12:33:54.816][D][cover:081]: ‘Garage Door’ - Setting
[12:33:54.821][D][cover:089]: Position: 100%
[12:33:54.822][D][gdo_cover:212]: Open command received
[12:33:54.825][D][gdo_cover:112]: Sending OPEN action
[12:33:55.031][D][secplus_gdo:084][gdo_main_task]: Button: Pressed
[12:33:55.034][D][binary_sensor:049][gdo_main_task]: ‘Wall Button’: ON
[12:33:55.503][D][gdo_cover:030][gdo_main_task]: Door state: Opening, position: 0%
[12:33:55.503][D][cover:157][gdo_main_task]: ‘Garage Door’ - Publishing:
[12:33:55.503][D][cover:160][gdo_main_task]: Position: 0%
[12:33:55.503][D][cover:173][gdo_main_task]: Current Operation: OPENING
[12:33:55.706][D][GDOLight:050][gdo_main_task]: Light state: On
[12:33:55.947][D][gdo_cover:030][gdo_main_task]: Door state: Opening, position: 12%
[12:33:55.949][D][cover:157][gdo_main_task]: ‘Garage Door’ - Publishing:
[12:33:55.952][D][cover:160][gdo_main_task]: Position: 12%

…….

[12:34:33.197][D][gdo_cover:030][gdo_main_task]: Door state: Closing, position: 2%
[12:34:33.200][D][cover:157][gdo_main_task]: ‘Garage Door’ - Publishing:
[12:34:33.213][D][cover:160][gdo_main_task]: Position: 2%
[12:34:33.213][D][cover:173][gdo_main_task]: Current Operation: CLOSING
[12:34:33.700][D][gdo_cover:030][gdo_main_task]: Door state: Closing, position: 0%
[12:34:33.710][D][cover:157][gdo_main_task]: ‘Garage Door’ - Publishing:
[12:34:33.710][D][cover:160][gdo_main_task]: Position: 0%
[12:34:33.710][D][cover:173][gdo_main_task]: Current Operation: CLOSING
[12:34:34.515][D][gdo_cover:030][gdo_main_task]: Door state: Closed, position: 0%
[12:34:34.515][D][cover:157][gdo_main_task]: ‘Garage Door’ - Publishing:
[12:34:34.515][D][cover:160][gdo_main_task]: Position: 0%
[12:34:34.515][D][cover:173][gdo_main_task]: Current Operation: IDLE
[12:34:41.909][D][cover:081]: ‘Garage Door’ - Setting
[12:34:41.914][D][cover:089]: Position: 100%
[12:34:41.917][D][gdo_cover:212]: Open command received
[12:34:41.919][D][gdo_cover:112]: Sending OPEN action
[12:34:42.709][D][gdo_cover:030][gdo_main_task]: Door state: Opening, position: 0%
[12:34:42.709][D][cover:157][gdo_main_task]: ‘Garage Door’ - Publishing:
[12:34:42.709][D][cover:160][gdo_main_task]: Position: 0%
[12:34:42.709][D][cover:173][gdo_main_task]: Current Operation: OPENING
[12:34:43.246][D][gdo_cover:030][gdo_main_task]: Door state: Opening, position: 12%
[12:34:43.246][D][cover:157][gdo_main_task]: ‘Garage Door’ - Publishing:
[12:34:43.246][D][cover:160][gdo_main_task]: Position: 12%

Bolt closes after door fully closes, correctly. I manually open the bolt before I issue the open command, and bolt locks immediately after issuing the open command. If I leave the bolt locked, I can hear it attempt to lock the bolt (I can hear the solenoid actuate) when the the open command is issued. I can’t see anything in the logs, at all, that indicates the bolt is being locked or unlocked.

Separate issue(?), warning tone is not playing. When viewing the logs, I do see the following:

[13:45:04.701][D][button:023]: ‘Pre-close Warning’ Pressed.
[13:45:04.701][D][light:091]: ‘warning_led’ Setting:
[13:45:04.704][D][light:104]: State: ON
[13:45:04.709][D][light:165]: Effect: ‘Strobe’
[13:45:04.713][D][button:023]: ‘Play sound’ Pressed.
[13:45:04.718][D][rtttl:062]: Playing song ominous
[13:45:04.777][V][rtttl:398]: State changed from STATE_STOPPED to STATE_RUNNING
[13:45:04.777][W][light:023]: ‘warning_led’: brightness not supported
[13:45:04.777][V][ledc.output:045]: Calculating resolution bit-depth for frequency 1319.000000
[13:45:04.777][V][ledc.output:050]: Resolution calculated as 14
[13:45:04.777][V][ledc.output:045]: Calculating resolution bit-depth for frequency 1319.000000
[13:45:04.777][V][ledc.output:050]: Resolution calculated as 14
[13:45:04.777][V][ledc.output:104]: Setting duty: 0 on channel 0
[13:45:04.777][V][ledc.output:104]: Setting duty: 9830 on channel 0
[13:45:04.879][V][ledc.output:045]: Calculating resolution bit-depth for frequency 1397.000000
[13:45:04.879][V][ledc.output:050]: Resolution calculated as 14
[13:45:04.879][V][ledc.output:045]: Calculating resolution bit-depth for frequency 1397.000000
[13:45:04.879][V][ledc.output:050]: Resolution calculated as 14
[13:45:04.879][V][ledc.output:104]: Setting duty: 9830 on channel 0
[13:45:04.879][V][ledc.output:104]: Setting duty: 9830 on channel 0
[13:45:04.981][V][ledc.output:045]: Calculating resolution bit-depth for frequency 1568.000000
[13:45:04.982][V][ledc.output:050]: Resolution calculated as 14

and so on …………….

But there is no sound from the Blaq.

That’s really odd, you should see at least some logs from the lock component.

I’ve upgraded your user trust level on this community. Please upload the entirety of your YAML config file as an attachment.

Still can’t upload:

Sorry about that. Try it now.

Works now!

garage-door-opener-rev-01.yaml (7.6 KB)

I am back in town. Tested the bolt again, and same issue… it locks when the door is opened. Also, checked the warning tone and it still plays, when looking at the logs, but makes no sound.

Should I post the issue with the warning tone not making any sound in a new thread?

@Carl_Slemer did it originally make a sound before you started modifying the firmware?

I noticed that you copied and modified the entire GDO blaQ firmware config. This works, but it introduces some risk of unintentional changes. Normally I would recommend adopting the config in ESPHome builder, which creates a reference to our original config on GitHub, and then just put your additions/modifications in the bottom of that file.

I haven’t had a chance to try to reproduce your configuration on my end yet.

I would like to revert or redo the configuration to do as you have suggested, but I have never adopted a device in ESPHome Builder. Can you direct me to something that indicates how that is done? Also, do I just reset the device and start over?

Sorry for not understanding what you meant about adopting the device!