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).
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).
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.
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!!!
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…
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…
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.
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???
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!!!
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:
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…