-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement animals as switch instead of sensor #9
Comments
Workaround for this: With #12 you can do the tracking fully in HA. Use automations triggered by a change of the "Time" attribute. As an additional condition use the state (I'm using a template here to just get "Inside" and "Outside" out of "Inside/Lookedout" and "Outside/Lookedin", combining this into "sensor.catname.where"). In a multi-flap setup you can also use the MAC address of the device which gave the last status update to get finer granular positions. Every information (Inside / Outside) from every flap triggers an own automation which sets the option of an input_select helper, which in my case can be "Home", "Screened Area", "Outside" and "Unknown". My custom-button with the cat icon and name is green (Home), orange (Screened area), red (Outside) or gray (Unknown). Tapping the button switches through the statuses for manual correction. The "Unknown" status can be activated manually in case we don't know where the cat is (i.e. open terrace door in summer). The next contact with any flap (even a "Lookedin" or "Lookedout") updates the status as HA now knows exactly where she/he is. |
@jacotec could you be so kind to share the code of your implementation in HA? I would like to do it like you suggested but I'm lacking the experience in HA to write the code myself :( thanks in advance :) |
@cacula These are my templates in HA. I've included a sample for my "Testcat" (a chip I use for testing), you need to implement these templates for any of your "real" pets:
These templates are calculating the battery status of my two cat flaps and for each cat they calculate:
You need to track your cat's position via automations. This depends on your setup. For me I have a flap from the house (=Haus) into the screened outside area (=Gehege) and a second one from the screened area into the "big world" (Draußen).
The button in Lovelace is an Input.Select with the 4 possible states:
The states do have different colors. The automation "Position Testcat ändern" is an action triggered by a tap on these buttons, so you can manually switch the cat states in HA (i.e. if you let your cat in through the terrace door). Or set your cat to "unknown" if you currently do not know where she is, the next contact with a flap will then update the state again. You need to have these automations per cat! (Flap MAC addresses anonymized)
I hope this gives you an idea ;-) |
@jacotec thanks for your detailed answer - very helpful & appreciated 👍🏽 - i will try and let you know |
@jacotec the answer from @clyso - that's actually my work account ;-)
What I'm struggling with is the Implementation in Lovelace. I wasn't able to configure the Buttons for each cat so that when i press the button the Postion will change. Also I failed to use catflap_battery_status to change the color of battery symbol. And lastly I did not find out how to configure the cats states to have different colors. Home Assistant is really cool but very difficult to learn :-( |
Just to track this here in the ToDo list as you've already confirmed this in the HomeAssistant forums as a "next improvement" in PLH:
Animals should be changed to be a switch instead of a sensor, so you can manually correct the pet location (i.e. in case it was let in by a human via front door).
The text was updated successfully, but these errors were encountered: