New integration for Power Pet Door

So after browsing WiFi PowerPet Door - I decided to take the work they had done (for MQTT) and make my own version as a native integration (no MQTT required).

Functionally, this will enable Home Assistant to integrate with the High Tech Pet’s Power Pet Door. This is at https://github.com/corporategoth/ha-powerpetdoor

This is my first integration I’ve created for Home Assistant.

What can it do:

  • It will create a ‘switch’ as the entity for the door
  • You can monitor the door’s open/closed state (both in general and in detail).
  • You can monitor the state of the inside and outside sensors, and power state.
  • You can open and close the door - both with ‘hold’ (ie. keep the door open when you open it) and not (ie. it will auto-close).
  • You can enable and disable the inside and outside sensors (if you are not in ‘AUTO’ mode).
  • You can power on and off the door completely (well, “completely”, even when off it stays connected to wifi).
  • It will auto change the icon for the door depending whether the door is opened or closed (though maybe this should be based on power mode, or a sensor, not sure).
  • See the status of the ‘auto’ mode (it’s called “timersEnabled” - their term not mine)
  • Toggle on and off Auto mode.

What you can’t do:

  • Adjust the inside or outside range for collar detection (these are actual rheostat dials, not digitally controlled buttons - so this will likely never be possible).
  • Adjust other settings (eg. timezone).
  • Configure automatically with integrations (yup, this first version is still a configuration.yaml job).
2 Likes

Thank you!!! Thank you!!! Thank you!!!

I will try to install it tomorrow evening, and see how it works here…

Small update - I found out how to toggle Auto mode. So I now think everything that is controllable with the power pet door is now controlled.

It’s possible there are APIs to adjust things like time zone, length of time the door stays open, enable/disable the safety sensor, etc. ie. all the stuff you can control from the app. But I don’t need to touch those and I would probably just configure them with the app and leave them.

1 Like

I just did my install a bit earlier than planned, because Sir Barxalot isn’t feeling so well and went to take a nap instead of going bonkers whenever I open the door for testing. I grabbed the updated 0.1.5 version, which was just pushed a few minutes earlier.

It only took a few seconds to update all of my automations to use the new driver. Quite painless, mostly because I also used the same status strings that were being emitted by the door in my ugly shell script.

One item that can use some clarification in the docs is entity_id. I discovered on the Developer Tools screen that it was looking for switch.power_pet_door as the entity_id parameter, which made sense once I saw it.

So far, my open/close automations seem to be firing instantaneously when the door opens and closes. (It announces “Dog Door Open” and turns on the outside lights for 5 minutes on open, and announces “Door Door Closed” when it closes.) My own shell script setup seemed to have a 1-2 second delay, because it was polling the door for status updates.

Anyway, I’ll let you know if I spot any problems, but for now it seems like it’s 100% perfect!!!

They look cool, our dogs would love one.

Sir Barxalot has had his for his entire 11 year life, and is lost when he can’t let himself outside into our fenced-in back yard to play or take care of business.

The only gripe that we (and most people) have with the setup is the transmitter box on the collar. It doesn’t have a method to attach it to a “real” dog collar, so people use cable ties. The transmitter’s replacement coin cell batteries are also priced high, because they use a sticker thingy on a normal coin cell to make them proprietary. There’s videos on YouTube that show how to remove the sticker from a dead battery and transplant it onto a generic coin cell.

One thing that we do with our dog and the automatic door is monthly fire drills. When the house’s fire alarm sounds, he is trained to go out into the yard and get a treat at the far end of the fence. Now that I have the ability to control the door through automation, I am going to create one that turns off the outside door sensor when the fire alarm is active so that the knucklehead can’t let himself back into the burning house when he finds out that there’s no treat waiting for him in the yard…

1 Like

Then again dogs sometimes rescue babies…

No kids or babies in our house. The only thing he’d be looking to rescue is his treat jar… :wink:

I wouldn’t even trust ours alone with a baby. Lol

I’m not going to file a bug report yet because I didn’t upgrade from version 0.1.5 to 0.1.7 yet, but my HA lost communication with the dog door last night. Sir Barxalot let himself out in the pouring rain just before midnight, and the door open automations triggered and announced “Dog Door Open” as usual. My DW noticed that there was no subsequent “Dog Door Closed” announcement, and got out of bed to confirm that the door was closed and the dog outside.

When I checked the status this morning, the driver was reporting “DOOR_RISING” and had not updated since last night. Restarting HA dropped the connection to the door and woke things up again.

Hoping that the optimizations in 0.1.6 and 0.1.7 fixed this problem…

0.1.7 is not released yet. I’m working on it - it will include a proper integration (ie. not using configuration.yaml)

1 Like

FYI, GitHub sent me this email before sunrise today for 0.1.7:

I retracted 0.1.7 quickly as it was broken. I am working on it.

2 Likes

The status updates from our door stopped again last night. HA had this entry in the logs:

Logger: homeassistant
Source: custom_components/powerpetdoor/switch.py:228
Integration: powerpetdoor ([documentation](https://github.com/corporategoth/ha-powerpetdoor))
First occurred: March 3, 2022, 22:15:37 (1 occurrences)
Last logged: March 3, 2022, 22:15:37

Error doing job: Task exception was never retrieved

Traceback (most recent call last): File "/config/custom_components/powerpetdoor/switch.py", line 228, in keepalive if not self._keepalive.cancelled(): AttributeError: 'NoneType' object has no attribute 'cancelled'

Since I’m still on version 0.1.6 and I see a whole slew of recent commits that appear to have altered this line, I’m holding off on opening a GitHub issue until the new version is posted to HACS…

Just finished a significant re-write - it’s much nicer now. Including having multiple sensors, support for configuration via. integration, monitoring battery power and firmware versions. Also added better reconnection logic.

2 Likes

Upgrade question - Do we need to remove the configuration.yaml stuff before going from version 0.1.6 to 0.2.0, or will the upgrade via HACS move those settings into the integration settings and clean the .yaml stuff out for us???

It should set it up for you - but it won’t remove it from the yaml but after the upgrade you should be able to remove it from the yaml yourself.

1 Like

TL;DR - It took two HA restarts for the update from version 0.1.6 to version 0.2.0 to work.

I did the update via HACS, followed by the first HA restart. When HA finished restarting, there was a notification of a new device (Power Pet Door) being discovered. When I tried to configure the new device, it prompted for a name and a host, with “Power Pet Door” pre-filled in for the name. I tried entering the IP address and the DNS hostname for the door, but both threw errors for not being able to communicate to the device and it would not save the settings to continue.

After the second HA restart, the device showed up and was already configured. I then deleted the stuff from configuration.yaml and restarted HA a third time. Everything is still working, and the new settings switches even showed up in HomeKit!

Needless to say, I am really, really, really impressed with the improvements to version 0.2.0! Great work!!!

My door is at the fringes of wifi coverage, and my old ugly script had connections drop every few hours.

With that said, I’ve had to reboot HA twice now because 0.2.0 couldn’t reconnect after a drop. Here’s a screen grab of the HA logs:

HI, first off thanks for this! I’m having a bit of an issue and want to see if my config is correct. Everything works and reports the status, however the door will not auto-close by itself. This is my entry in configuration.yaml:

  - platform: powerpetdoor
    name: "Dog Door"
    host: 10.10.0.69
    port: 3000
    hold: false
    keep_alive: 30
    refresh: 300

I’m sure I"m doing something wrong, but not sure where. I’ve tried the .open service call, and just flipping the “switch” but with hold the door open until I issue a .close, .toggle, or flip the switch again. Ultimately I’ll want this to be a button instead of a switch for my wife but need to get the behavior correct first…

Thanks in advance,
Terry