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

Idea like Monitor, MQTT maybe #31

Open
SaturnusDJ opened this issue May 10, 2019 · 4 comments
Open

Idea like Monitor, MQTT maybe #31

SaturnusDJ opened this issue May 10, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@SaturnusDJ
Copy link

https://github.com/andrewjfreyer/monitor

It uses MQTT to send updated to HA about BT devices.
The interesting thing is that HA can ask Monitor to scan for updates. Similarly, if applied to openwrt_hass_devicetracker, we might define triggers in HA that will ask openwrt_hass_devicetracker to send out an update. For example on HA startup (Which is quite a pain point, because all WiFi devices will be marked as away because HA is stupid.) or 20 seconds after the front door was opened.

I guess currently the only way to do this is with https://www.home-assistant.io/components/shell_command/ right?

@mueslo
Copy link
Owner

mueslo commented Oct 17, 2019

How would HomeAssistant then trigger the scan automatically?

@SaturnusDJ
Copy link
Author

After event x/y/z send a MQTT message from HA to the router requesting an update of connected WiFi devices.

@mueslo
Copy link
Owner

mueslo commented Oct 17, 2019

And what event would that be for startup? I guess we could build a device_tracker platform though which periodically queries hass-tracker for updates. Not sure if that can be used to trigger it only at startup.

@SaturnusDJ
Copy link
Author

In my case I restart the monitor program/script 18 seconds after startup of HA:

- alias: System - Restart BT Monitor on startup
  trigger:
  - platform: homeassistant
    event: start
  action:
  - delay:
      seconds: 18
  - service: mqtt.publish
    data:
      topic: 'monitor/scan/restart'

In case of hass_tracker, another event could be after the OpenWRT device was away in HA ping/NMAP device tracker and 'came home again.' (Implicating a router restart.)

@mueslo mueslo added the enhancement New feature or request label Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants