10000 Add door tag to Netatmo by farkasdi · Pull Request #135772 · home-assistant/core · GitHub
[go: up one dir, main page]

Skip to content

Add door tag to Netatmo #135772

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

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft

Add door tag to Netatmo #135772

wants to merge 2 commits into from

Conversation

farkasdi
Copy link
Contributor

This change enable initial definition to add door tag of Netatmo. Let's kick of discussion adding door tag handling beyond webhooks.

Breaking change

Proposed change

This addition would enable this type of device handling as other Netatmo devices beyond webhook. Plus enable other HACS like Battery Notes to follow battery drainage/replacement.
More precisely this change targeting to add opening_type device of Netatmo. In vendor terminology called door/window tag. By configuration in vendow app it can be: door, windows, garage, gate, cupboard, other
In HA this should be a device where binary entity of similar type. DOOR, WINDOW, GARAGE_DOOR (not all vendor defined type exists, to be decided how to handle delta).
The device type is connected to camera via RF and operated by battery (those entities like other Netatmo devices) are present in homesdate and homestate (intergtation) need to be processed.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

This change enable initial definition to add door tag of Netatmo. Let's kick of discussion adding door tag handling beyond webhooks.
@home-assistant
Copy link

Hey there @cgtobi, mind taking a look at this pull request as it has been labeled with an integration (netatmo) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of netatmo can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign netatmo Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

Copy link
Member
@joostlek joostlek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I told you via email to open a PR, but I thought you already had something working rather than just kicking off a discussion. I think Discord is better for that then :)

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft January 16, 2025 13:30
@farkasdi
Copy link
Contributor Author
farkasdi commented Jan 16, 2025

I made a good progress but it is still not ready. While I ellaborating a new door_tag.py (more complex than binary sensor) I discovered that something here and there to be added. I'm gona add that file next some time. Sorry but I've just try to reverse engineer HA definitions and this intengration in the last month (as many time I have). A discussion could boost this. I on discord (farkasdi.) for your invite.

@joostlek
Copy link
Member

Please join the HA discord and send me a message, I can't seem to find you :)

Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes.
Thank you for your contribution!

@github-actions github-actions bot added the stale label Mar 17, 2025
@farkasdi
Copy link
Contributor Author

Thanks for the reminder! :)
Rebase done. Adding comment.
Status: Still my intention to complete the PR. The main part has been added and under testing. It is not breaking the functionality however not working. Under investigation.

@github-actions github-actions bot removed the stale label Mar 21, 2025
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
If yo 8000 u are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes.
Thank you for your contribution!

@github-actions github-actions bot added the stale label May 20, 2025
@farkasdi
Copy link
Contributor Author
farkasdi commented May 23, 2025

Hi. I've stuck some times ago, while I troubleshoot the new code. I think most of the stuff there but was not working. My original thought was to invoke device addition for door tags but it was not happened. Then I tried to change to root of the tags to camera (idea behind that tags are the child objects of camera) but this modification in editor not propagated to my core code fork. Seems it was a missing update here. I retry.

@github-actions github-actions bot removed the stale label May 23, 2025
@adriencog
Copy link
Contributor

did you have a look at this PR ? #121401
I've been using it in a custom component for a while now, and I would love to see it integrated in HA.
does your implementation differ a lot ?
If you need help in anyway let me know.

@farkasdi
Copy link
Contributor Author

Thanks Ardien! Appreciated to have more professional to look it! I just get some idea to tune the code but maybe tomorrow I can do that. May I add you to see where I'm now? I'm a bit new and I don't get to share anything yet. This is the repo if you try to navigate: https://github.com/farkasdi/core

@farkasdi
Copy link
Contributor Author

Hi @adriencog ! I've checked the PR you linked that adds doortag to binary_sensor.py . My approach to have it as binary_sensor (@joostlek advice as well) but in separate file (door_tag.py) and to be added alike indoor modules (with battery) in data_handler.py. No calibration functionality. Keep plain as much as possible and without processing webhooks (have the status from homestatus in 60 secs).

I've made the tuning I planned yesterday as I crosschecked the code with Gemini (Copilot can be next step). Today when I tested the result in container still not added the tags. I'm a bit disappointed. If you have some idea please let me know.

@adriencog
Copy link
Contributor

@farkasdi I think I get why, your code is never run. Indeed, door_tag is not an existing platform such as binary_sensor, so adding just new file isn't enough.
I don't think it's possible to create new platform in HA (I tried and couldn't make it work).

Solution could be to call door tag setup in binary_sensor.py

from . import door_tag
...
async def async_setup_entry( ...
     ...
     await door_tag.async_setup_entry(hass, entry, async_add_entities)
     ...

Not sure that's the cleanest way to do, but at least with this, you can test your new entities

@farkasdi
Copy link
Contributor Author

Yes, you are right pointing it out. I should have tune it yesterday, I got to that. However I would put plain binary_sensor and that may not proper still. Ok, I think about. Thanks!

8000

@joostlek
Copy link
Member

In order for this to be mergable, we should integrate it in binary sensor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0