Skip to content
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

Add device availability functionality for HASS based on router devices ping and attribute reporting also available on battery-powered devices #761

Merged
merged 24 commits into from
Dec 29, 2018

Conversation

ugrug
Copy link
Contributor

@ugrug ugrug commented Dec 26, 2018

  • Router devices ping available by set in configuration.yaml: advanced/availability_interval
  • Additionally availablitiy of battery-powered devices with attribute reporting possible by listening for incoming messages. For these devices report interval can be set in configuration.yaml: devices/device_ID/attribute_report_interval
  • For working ping functionality fixing the callback of the zigbee-stephard/Controller.prototype.checkOnline function needed. Related to this, created a pull request for it. For testing, available at: Fix checkOnline callback zigbee-shepherd#8

@ugrug ugrug changed the title Add functionality to handle availability of router devices also shown in HASS Add device availability functionality for HASS based on router devices ping and attribute reporting also available on battery-powered devices Dec 27, 2018
@Koenkk Koenkk changed the base branch from master to dev December 28, 2018 08:42
@Koenkk
Copy link
Owner

Koenkk commented Dec 28, 2018

Great, could you open the zigbee-shepherd PR here? https://github.com/koenkk/zigbee-shepherd

@ugrug
Copy link
Contributor Author

ugrug commented Dec 28, 2018

PR moved to Koenkk/zigbee-shepherd#8

@Koenkk Koenkk merged commit afeed4f into Koenkk:dev Dec 29, 2018
@Koenkk
Copy link
Owner

Koenkk commented Dec 29, 2018

Thanks 🐝!

@ugrug
Copy link
Contributor Author

ugrug commented Jan 1, 2019

@Koenkk It is great you merged this feature! 👍
One question related this: As I see you dropped the availability for battery-powered non-pingable devices based on attribute reporting and required to monitor last_seen attribute to detect availability, possibly configurable per each device with the interval of attribute reporting (configuration.yaml: devices/device_ID/attribute_report_interval). Are you open for this feature?

@Koenkk
Copy link
Owner

Koenkk commented Jan 2, 2019

@ugrug we dont need the last seen attribute, I prefer to just keep track of this by handling zigbee messages in the handleZigbeeMessage function. Lets keep extensions as standalone as possible.

I`m still struggeling with the availabillity of battery based devices as we dont really know how often a sensor could report. A good guess would be 1 day, however this is probably not alwys right, perhaps there should be some devive specific option to disable it for that device.

@waiweng83
Copy link

Hi, I'm new to zigbee2mqtt and i find that the availabillity of battery based devices is pretty important especially for some sensors like smoke alarm, water leakage sensor, etc.

I know that different devices will have different report/heartbeat interval. Like @Koenkk just commented, perhaps just make it configurable for each device? Any plan to include this feature? If not, what is the best way to monitor this in home assistant?

Sorry for commenting on the Closed thread. I'm not sure whether this is the correct way to do it.

@Koenkk
Copy link
Owner

Koenkk commented May 27, 2019

@waiweng83 the correct place is #775

@waiweng83
Copy link

Thanks

@waiweng83 waiweng83 mentioned this pull request May 28, 2019
7 tasks
wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this pull request Sep 26, 2019
…s ping and attribute reporting also available on battery-powered devices (Koenkk#761)

* Discovery on HASS restart and last_message attribute added

- On restarting Home Assistant, resending device discovery information
- Add timestamp on receiving message from Zigbee

* Add option: add_timestamp in settings

* typo

* Update homeassistant.js

* Update homeassistant.js

* Update homeassistant.js

* Update controller.js

* Update zigbee.js

* Add files via upload

* Update zigbee.js

* Update deviceAvailabilityHandler.js

* Update deviceAvailabilityHandler.js

* Update deviceAvailabilityHandler.js

* Update deviceAvailabilityHandler.js

* Update deviceAvailabilityHandler.js

* Update deviceAvailabilityHandler.js

* Update deviceAvailabilityHandler.js

* Update homeassistant.js

* Update deviceAvailabilityHandler.js

* Update deviceAvailabilityHandler.js

* Update homeassistant.js

* Fix checkonline callback.

* Refactor.

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

Successfully merging this pull request may close these issues.

3 participants