piscinas
(Nuno Martins)
July 15, 2021, 8:14pm
1
It is possible to attach “dead” and “deadReason” from properties of devices to devices attributes on HA?
I found a motion sensor dead on Fibaro gateway and on HA side nothing tells me that status, only nothing changes.
@frenck is this possible to integrate?
I have some urgent need to get status of devices.
openPhiL
(PhiL)
April 15, 2023, 8:44pm
2
Hi. You did not get any feedback, so I push this topic a bit, instead of creating a new, identical one.
I see that the API that is used by homeAssistant does provide the dead property itself in my little test here
where 219 is a device that has lost connection (e.g. battery died):
It would be possible to create a small script to check regularily for that property, but maybe we can add this to the home assistant integration. I’ll keep updating this thread as I progress, but I would be happy to get Interrupted by somebody with helpful comments in mind
best regards
PhiL
openPhiL
(PhiL)
April 15, 2023, 9:02pm
3
@rappenze : Hi. I just readlized that you are both, the owner of the wrapper api repository as well as the last contributer. Can you comment on this please? would it be a big deal to add the “dead” attribute ? (and “dead reason”)
Hi,
that should not be a big thing to add.
I think for such attributes which do not change often HA suggest to add them as extra state attributes.
What do you think is the better approach, add them as extra state attributes or add it as separate sensor’s?
Also is it required to add both or shoul we just add a deadReason which is empty when the device is not dead?
Looking a bit deeper there is an available attribute which should be set based on dead attribute…
@openPhiL Home Assistant freezes attributes when a device is unavailable and even drops the attributes on HA restart. But I think having the entity unavailable state is much more important then having the dead reason. So I created a pull request which just set’s the available state of the entity and does not provide the dead reason, I hope that is matching most of your expectations.
home-assistant:dev
← rappenze:fibaro_available_state_feature
opened 09:28AM - 23 Apr 23 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
Set the available state in the fibaro integration for entities based on the dead attribute provided in the fibaro API.
The dead attribute is set by fibaro for example when a device is not reachable in the z-wave network or when a z-wave plug is unplugged.
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [X] 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
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [X] The code change is tested and works locally.
- [X] Local tests pass. **Your PR cannot be merged unless tests pass**
- [X] There is no commented out code in this PR.
- [X] I have followed the [development checklist][dev-checklist]
- [X] I have followed the [perfect PR recommendations][perfect-pr]
- [X] The code has been formatted using Black (`black --fast homeassistant tests`)
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [ ] The [manifest file][manifest-docs] 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.
- [ ] Untested files have been added to `.coveragerc`.
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/en/development_checklist.html
[manifest-docs]: https://developers.home-assistant.io/docs/en/creating_integration_manifest.html
[quality-scale]: https://developers.home-assistant.io/docs/en/next/integration_quality_scale_index.html
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
1 Like
Hi @rappenze , thank you!
sorry for the late response, haven’t checked back here, guess I should enable some kind of email notification
I agree with your thoughts! The reason is not really important, but knowing that the device is unresponsive is. So making a sensor “unavailable” if the batterie died is a perfect solution to my problem. I then go, replace the battery and this is (so far) always the solution
Have a nice day!
Thanks again!
PhiL