GithubHelp home page GithubHelp logo

monitor-app's People

Contributors

akarnani avatar odianosen25 avatar skynet01 avatar thestigh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

monitor-app's Issues

home assistant device tracker

the documentation references being about to use device trackers instead of binary sensors. How is that done please?

Error 405 with remove_known_device

Hi there, I'd appreciate some guidance on troubleshooting the following:
I'm calling the service self.call_service("monitor/remove_known_device", device="xx:xx:xx:xx:xx:xx", namespace=mqtt) and see in logs:
DEBUG home_presence_app: call_service: mqtt/publish, {'topic': 'monitor/setup/DELETE STATIC DEVICE', 'payload': 'my mac address'}
DEBUG home_presence_app: monitor/setup/DELETE STATIC DEVICE payload: my mac address

But the entities are not deleted in Hass and in the Appdaemon log I see:
WARNING HASS: Error Removing Home Assistant entity sensor.monitor_xyz_conf
WARNING HASS: Code: 405, error: 405: Method Not Allowed

Appreciate any tips for how to solve this.

Thanks!

Idea: Interval scan on open "gateways".

This app is really awesome. Finally i can start using Monitor again.

I have an idea that maybe should be a good thing.

During summer, at least i and probably many with me, is keeping doors open during the day. And if i have this door set as a gateway, the scan will not execute in a very long time. So if we could have "smarter" gateways would be lovely in this kind of scenario. Im thinking like:

home_gateway_sensors:
  frontdoor: (Full example setup)
    entity_id: binary_sensor.frontdoor    (ID of the sensor. Required)
    state_open: 'on'    (What state of this specific sensor is equal to open. Optional)
    state_closed: 'off'    (What state of this specific sensor is equal to closed. Optional)
    scan_if_kept_open: true    (Start interval-scan if open more than some time, 5mins? Optional)
    scan_time: 2    (Time between scans in minutes. Optional)
  backdoor: (Minimum setup, functionality as of today)
    entity_id: binary_sensor.backdoor

Of course this could be made with automation in HomeAssistant, but would preferable live inside this app.
See this only as a suggestion, i love the app anyway ;)

AttributeError: 'ADAPI' object has no attribute 'timer_running'

self.handle_echo(location=location, payload=payload)

File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 548, in handle_echo
if location in self.location_timers and self.adbase.timer_running(
AttributeError: 'ADAPI' object has no attribute 'timer_running'
2021-04-01 22:55:42.265367 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:55:45.921859 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:55:45.923442 WARNING home_presence_app: Unexpected error in worker for App home_presence_app:
2021-04-01 22:55:45.924456 WARNING home_presence_app: Worker Ags: {'id': 'bf9e29b03e3e45f297a056d2a14614d5', 'name': 'home_presence_app', 'objectid': 'b086503a69c945359ae0877a0a3ceeb0', 'type': 'event', 'event': 'MQTT_MESSAGE', 'function': <bound method HomePresenceApp.presence_message of <home_presence_app.HomePresenceApp object at 0x7f9e895a30>>, 'data': {'topic': 'monitor/living_room_monitor/status', 'payload': 'online', 'wildcard': 'monitor/#'}, 'pin_app': True, 'pin_thread': 5, 'kwargs': {'wildcard': 'monitor/#', '__thread_id': 'thread-5'}}
2021-04-01 22:55:45.927698 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:55:45.931239 WARNING home_presence_app: Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 933, in worker
funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 280, in presence_message
self.handle_status(location=location, payload=payload.lower())
File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 472, in handle_status
and self.adbase.timer_running(self.location_timers[location])
AttributeError: 'ADAPI' object has no attribute 'timer_running'
2021-04-01 22:55:45.932663 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:07.664033 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:07.665423 WARNING home_presence_app: Unexpected error in worker for App home_presence_app:
2021-04-01 22:56:07.666625 WARNING home_presence_app: Worker Ags: {'id': 'bf9e29b03e3e45f297a056d2a14614d5', 'name': 'home_presence_app', 'objectid': 'b086503a69c945359ae0877a0a3ceeb0', 'type': 'event', 'event': 'MQTT_MESSAGE', 'function': <bound method HomePresenceApp.presence_message of <home_presence_app.HomePresenceApp object at 0x7f9e895a30>>, 'data': {'topic': 'monitor/living_room_monitor/echo', 'payload': 'ok', 'wildcard': 'monitor/#'}, 'pin_app': True, 'pin_thread': 5, 'kwargs': {'wildcard': 'monitor/#', '__thread_id': 'thread-5'}}
2021-04-01 22:56:07.668326 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:07.669895 WARNING home_presence_app: Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 933, in worker
funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 293, in presence_message
self.handle_echo(location=location, payload=payload)
File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 548, in handle_echo
if location in self.location_timers and self.adbase.timer_running(
AttributeError: 'ADAPI' object has no attribute 'timer_running'
2021-04-01 22:56:07.671133 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:22.025568 INFO home_presence_app: Processing System Unavailable for Living Room Monitor
2021-04-01 22:56:22.514685 WARNING home_presence_app: Node at Living Room Monitor is Offline, will need to be checked
2021-04-01 22:56:37.253921 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:37.261544 WARNING home_presence_app: Unexpected error in worker for App home_presence_app:
2021-04-01 22:56:37.263291 WARNING home_presence_app: Worker Ags: {'id': '5c967c6d38d44d068b682ce108b47e5f', 'name': 'home_presence_app', 'objectid': 'b086503a69c945359ae0877a0a3ceeb0', 'type': 'scheduler', 'function': <bound method HomePresenceApp.not_home_func of <home_presence_app.HomePresenceApp object at 0x7f9e895a30>>, 'pin_app': True, 'pin_thread': 5, 'kwargs': {'device_entity_id': 'monitor_stephen_phone', '__thread_id': 'thread-5'}}
2021-04-01 22:56:37.264376 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:37.270412 WARNING home_presence_app: Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 887, in worker
funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"]))
File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 777, in not_home_func
if self.check_home_timer is not None and self.adbase.timer_running(
AttributeError: 'ADAPI' object has no attribute 'timer_running'
2021-04-01 22:56:37.271390 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:37.341508 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:37.347841 WARNING home_presence_app: Unexpected error in worker for App home_presence_app:
2021-04-01 22:56:37.349629 WARNING home_presence_app: Worker Ags: {'id': '215ba7050d8948e08b851bdc6fb28a6d', 'name': 'home_presence_app', 'objectid': 'b086503a69c945359ae0877a0a3ceeb0', 'type': 'scheduler', 'function': <bound method HomePresenceApp.not_home_func of <home_presence_app.HomePresenceApp object at 0x7f9e895a30>>, 'pin_app': True, 'pin_thread': 5, 'kwargs': {'device_entity_id': 'monitor_april_phone', '__thread_id': 'thread-5'}}
2021-04-01 22:56:37.353619 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:37.355424 WARNING home_presence_app: Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 887, in worker
funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"]))
File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 777, in not_home_func
if self.check_home_timer is not None and self.adbase.timer_running(
AttributeError: 'ADAPI' object has no attribute 'timer_running'
2021-04-01 22:56:37.356522 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:39.024138 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:39.025058 WARNING home_presence_app: Unexpected error in worker for App home_presence_app:
2021-04-01 22:56:39.025971 WARNING home_presence_app: Worker Ags: {'id': 'bf9e29b03e3e45f297a056d2a14614d5', 'name': 'home_presence_app', 'objectid': 'b086503a69c945359ae0877a0a3ceeb0', 'type': 'event', 'event': 'MQTT_MESSAGE', 'function': <bound method HomePresenceApp.presence_message of <home_presence_app.HomePresenceApp object at 0x7f9e895a30>>, 'data': {'topic': 'monitor/living_room_monitor/status', 'payload': 'online', 'wildcard': 'monitor/#'}, 'pin_app': True, 'pin_thread': 5, 'kwargs': {'wildcard': 'monitor/#', '__thread_id': 'thread-5'}}
2021-04-01 22:56:39.026744 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:39.030293 WARNING home_presence_app: Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 933, in worker
funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 280, in presence_message
self.handle_status(location=location, payload=payload.lower())
File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 472, in handle_status
and self.adbase.timer_running(self.location_timers[location])
AttributeError: 'ADAPI' object has no attribute 'timer_running'
2021-04-01 22:56:39.031121 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:41.026379 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:41.028377 WARNING home_presence_app: Unexpected error in worker for App home_presence_app:
2021-04-01 22:56:41.030157 WARNING home_presence_app: Worker Ags: {'id': 'bf9e29b03e3e45f297a056d2a14614d5', 'name': 'home_presence_app', 'objectid': 'b086503a69c945359ae0877a0a3ceeb0', 'type': 'event', 'event': 'MQTT_MESSAGE', 'function': <bound method HomePresenceApp.presence_message of <home_presence_app.HomePresenceApp object at 0x7f9e895a30>>, 'data': {'topic': 'monitor/living_room_monitor/status', 'payload': 'online', 'wildcard': 'monitor/#'}, 'pin_app': True, 'pin_thread': 5, 'kwargs': {'wildcard': 'monitor/#', '__thread_id': 'thread-5'}}
2021-04-01 22:56:41.031404 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:41.033235 WARNING home_presence_app: Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 933, in worker
funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 280, in presence_message
self.handle_status(location=location, payload=payload.lower())
File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 472, in handle_status
and self.adbase.timer_running(self.location_timers[location])
AttributeError: 'ADAPI' object has no attribute 'timer_running'
2021-04-01 22:56:41.035628 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:42.782597 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:42.783717 WARNING home_presence_app: Unexpected error in worker for App home_presence_app:
2021-04-01 22:56:42.784642 WARNING home_presence_app: Worker Ags: {'id': '3028589bc57a484590a6fc6859c9c507', 'name': 'home_presence_app', 'objectid': 'b086503a69c945359ae0877a0a3ceeb0', 'type': 'state', 'function': <bound method HomePresenceApp.confidence_updated of <home_presence_app.HomePresenceApp object at 0x7f9e895a30>>, 'attribute': 'state', 'entity': 'sensor.monitor_april_phone_living_room_monitor_conf', 'new_state': '100', 'old_state': '0', 'pin_app': True, 'pin_thread': 5, 'kwargs': {'device_entity_id': 'monitor_april_phone', 'immediate': True, '__duration': '41602fbf55ac4637bfb42ff54938ce44', '__thread_id': 'thread-5'}}
2021-04-01 22:56:42.785629 WARNING home_presence_app: ------------------------------------------------------------
2021-04-01 22:56:42.787055 WARNING home_presence_app: Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 900, in worker
funcref(
File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 701, in confidence_updated
if self.check_home_timer is not None and self.adbase.timer_running(
AttributeError: 'ADAPI' object has no attribute 'timer_running'
2021-04-01 22:56:42.788028 WARNING home_presence_app: ------------------------------------------------------------

Not removing known mac-address

Hi!

Really great work on this App, thanks.

I found out that adding new mac's from the App is working properly distributing it out to the nodes, but not removing them from nodes when removing from within the app. Is that by design?

Help - How is it supposed to fit together?

Hi,

After reading your long and well-explained introduction to what Monitor-App can do, I really wanted to try it out. It seems like a very good approach to do pressence detection. But it seems like I am missing something obvious. If you could take a few minutes to explain it to me; it would be greatly appreciated.

I am running HASS.IO or what it is called these days. There is a container for AppDaemon that I have installed. I have used HACS to get your Monitor-App installed as well. I have configured this and it seems to be running just fine.

I don't think HASS.IO have access to bluetooth hardware but that doesn't matter in my case since I would like to setup a few nodes around the house (Raspberry PI Zero). What am I supposed to install on those? The original monitor from Andrew or Monitor-App or AppDaemon and Monitor-App?

Because the script from @TheStigh doesn't work (not even after fixing the line endings), I installed the monitor from Andrew following the instructions on his git repo. That worked out fine and after configuring all the settings manually, it pushes messages to Home Assistants MQTT and they get proccesed by your Monitor-App and they show up as entities in Home Assistant ๐Ÿ‘

But as far as I can understand from your enthusiastic write-up I should be able to get the configuration from Monitor-App to propogate to all the nodes so I don't need to setup Andrews monitor manually. Is this correct?

If so; how am I supposed to do that (leading back to the question of what I should install on my nodes)? And last; what username/password am I supposed to use in the config in Monitor-App?

TypeError: 'NoneType' object is not iterable

Hi, thanks for your project :)

i'v an issue, logs are :

2020-03-11 17:01:06.524916 WARNING home_presence_app: ------------------------------------------------------------
2020-03-11 17:01:06.525609 WARNING home_presence_app: Unexpected error in worker for App home_presence_app:
2020-03-11 17:01:06.526292 WARNING home_presence_app: Worker Ags: {}
2020-03-11 17:01:06.526865 WARNING home_presence_app: ------------------------------------------------------------
2020-03-11 17:01:06.531313 WARNING home_presence_app: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 145, in initialize_app
    await utils.run_in_executor(self, init)
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 276, in run_in_executor
    response = future.result()
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 125, in initialize
    for motion_sensor in self.args.get("home_motion_sensors", []):
TypeError: 'NoneType' object is not iterable

2020-03-11 17:01:06.531973 WARNING home_presence_app: ------------------------------------------------------------
2020-03-11 17:01:40.074975 WARNING home_presence_app: ------------------------------------------------------------
2020-03-11 17:01:40.075857 WARNING home_presence_app: Unexpected error in worker for App home_presence_app:
2020-03-11 17:01:40.076350 WARNING home_presence_app: Worker Ags: {}
2020-03-11 17:01:40.077039 WARNING home_presence_app: ------------------------------------------------------------
2020-03-11 17:01:40.078469 WARNING home_presence_app: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 145, in initialize_app
    await utils.run_in_executor(self, init)
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 276, in run_in_executor
    response = future.result()
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/appdaemon/apps/Monitor-App/home_presence_app.py", line 125, in initialize
    for motion_sensor in self.args.get("home_motion_sensors", []):
TypeError: 'NoneType' object is not iterable

2020-03-11 17:01:40.079044 WARNING home_presence_app: ------------------------------------------------------------

My app.yaml :

home_presence_app:
  module: home_presence_app
  class: HomePresenceApp
  home_gateway_sensors:
    - binary_sensor.door_entree
  home_motion_sensors:
    - binary_sensor.motion_sensor_hall_couloir
    - binary_sensor.motion_sensor_hall_entree
    
  known_devices:
    - F1:CF:22:A0:09:C5 Nut Monitor Manon
    - D9:B8:12:95:A0:A1 Nut Monitor Gautier

All sensors are Xiaomi Sensors

Do you know how can i solve it ?

An other question, it's mandatory to run script : bash -c "$(curl -sL https://raw.githubusercontent.com/Odianosen25/Monitor-App/master/installer/install.sh)" ?

i'm running with hassio on a docker container on Debian 10 (Intel NUC)

Reboot of nodes not working

Hello!

I cannot get the reboot of remote-monitors to work. I have installed paramiko on each device.
When i run the mqtt: "monitor/all/reboot" i get the following in the logs, but nodes are not restarted.

2020-08-21 09:21:51.007412 INFO home_presence_app: Restarting topfloor's Hardware                               
2020-08-21 09:21:51.016062 INFO home_presence_app: Restarting outhouse's Hardware                               
2020-08-21 09:21:51.017947 INFO home_presence_app: Restarting entrance's Hardware                               
2020-08-21 09:21:51.019894 INFO home_presence_app: Running sudo reboot now on outhouse's Hardware               
2020-08-21 09:21:51.020498 INFO home_presence_app: Running sudo reboot now on topfloor's Hardware               
2020-08-21 09:21:51.021256 INFO home_presence_app: Restarting disable's Hardware                                
2020-08-21 09:21:51.024883 INFO home_presence_app: Running sudo reboot now on entrance's Hardware 

[REQUEST] Device groups

Would love to be able to create "device groups", example: phone, watch, and have them combined (using something like a bayesian sensor) so that we can configure how and when a user is actually home/away. If a phone is home and watch is not, mark them away. This could be done now but the everybody/nobody/somebody sensors get out of whack if trying to do it this way. Curious if you have an idea or if this is something you see could be a good addition to the app.

AttributeError: 'str' object has no attribute 'tzinfo'

I'm receiving this error now on startup after updating to the last build. It could be a configuration issue because my config got clobbered (#25) and I only quickly tried to recreate it. However, I wanted to report it in case it wasn't a config issue. I'll take a closer look and report back.

2020-02-23 04:09:22.610990 WARNING home_presence_app: Unexpected error running initialize() for home_presence_app
2020-02-23 04:09:22.611712 WARNING home_presence_app: ------------------------------------------------------------
2020-02-23 04:09:22.617506 WARNING home_presence_app: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 145, in initialize_app
    await utils.run_in_executor(self, init)
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 276, in run_in_executor
    response = future.result()
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/appdaemon/apps/home_presence_app/home_presence_app.py", line 148, in initialize
    self.adbase.run_every(
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 191, in inner_sync_wrapper
    f = run_coroutine_threadsafe(self, coro(self, *args, **kwargs))
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 285, in run_coroutine_threadsafe
    result = future.result(self.AD.internal_function_timeout)
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 439, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
    raise self._exception
  File "/usr/lib/python3.8/site-packages/appdaemon/adapi.py", line 2474, in run_every
    aware_start = self.AD.sched.convert_naive(start)
  File "/usr/lib/python3.8/site-packages/appdaemon/scheduler.py", line 718, in convert_naive
    if dt.tzinfo is None or dt.tzinfo.utcoffset(dt) is None:
AttributeError: 'str' object has no attribute 'tzinfo'

Going back to 84d7491 avoids the error with the same config.

wrong nearest_monitor if rssi unknown

Hi,

I haven't paired my devices with monitor, so it can't detect a rssi, which is so far fine to me.
I now set up two monitor-nodes and the monitor-app.

If e.g. I am on 2nd floor and start monitor on the 1st and 2nd floor on the first floor rssi reported is -99 (as expected) but on the 2nd floor rssi isn't detected at all. Confidence for 1st floor is 0 and for 2nd floor is 100.
nearest_monitor reported is 1st floor.
If I disable BT on the device confidence drops to 0 and rssi reported is -99. Device switches to not_home. If I reenable BT confidence on 2nd floor is 100 again and nearest_monitor is 2nd floor.
As long as rssi is reported once the nearest_monitor is chosen off of the confidence.

So: is this expected behaviour, is this a bug or is there some configurationsetting I've overlooked?

Thanks in advance!

binary_sensor.everyone_home flags to on during HA restart even if not everyone is home.

Noticed this on the current none dev branch, when HA restarts binary_sensor.everyone_home is marked on even though some people are not home.

I have this in my automation (from before your plugin.. but this shouldn't affect it)

 - id: reboot_presence_monitoring  
  alias: Restart Presence Scan on boot
  initial_state: 'on'
  trigger:
    platform: homeassistant
    event: start
  mode: single
    - service: mqtt.publish
      data_template:
          topic: 'monitor/scan/restart'
          payload: >-
            {
              "message": ""
            }  

HACS upgrade clobbers home_presence_app.yaml

Update using HACS will destroy the existing home_presence_app.yaml. It probably makes sense to take it out of the repo and add in a home_presence_app.yaml.template. This is because HACs will just recreate the directory.

Rebooting of nodes doesn't seem to be working

I see in the MQTT log that it tries to reboot my nodes when they are unavailable howe they never reboot. Is there a way to debug this? I tried running "sudo /sbin/reboot now" on the node manually in the shell and it works perfectly. I don't use ssh keys and use password login for them.

Maybe the string in the config needs to have quotes around it?

Thanks for your help as always!

Entity does not exist

I've replaced my one of my nodes with other RPi that reports the same location etc, now confidence levels aren't updated. Also, I can see several Entity sensor.monitor_xxxxxx_conf does not exist in the logs

Add to HACS for easy installation

Could you possibly add this to HACS? It'd give the project a lot more visibility plus make it so much easier to install and keep updated.

Missing Confidence Sensors

I have a new installation of Monitor-App and Monitor. I started with the hallway node and then added the Kitchen yesterday. HA and AppDaemon run in Docker Containers, with the MQTT Broker in another container.

I have three users and two monitor nodes in my setup.

Users: me, wife, daughter
Nodes: hallway, kitchen

These are my sensors in HA. For some reason though, the two hallway_conf sensors (**) below aren't being created in HA. They were definitely there a couple of days ago, but I don't know what I did or when they disappeared. I've rebooted both HA and AD in different orders with no luck.

- binary_sensor.monitor_everyone_home
- binary_sensor.monitor_everyone_not_home
- binary_sensor.monitor_somebody_is_home

- device_tracker.monitor_me
- device_tracker.monitor_wife
- device_tracker.monitor_daughter

- sensor.monitor_me_kitchen_conf
- sensor.monitor_wife_kitchen_conf
- sensor.monitor_daughter_kitchen_conf

- sensor.monitor_me_hallway_conf **
- sensor.monitor_wife_hallway_conf **
- sensor.monitor_daughter_hallway_conf

In the logs below, I can see that it created mine and my wife's hallway_conf sensor at the start, but then hasn't done since. It does however continue to create daughter_hallway_conf as well as all three kitchen_conf sensors after each reboot.

$ docker-compose logs appdaemon | grep _conf created"
appdaemon        | 2020-09-08 19:25:41.787193 INFO AppDaemon: home_presence_app: Entity sensor.monitor_me_hallway_conf created in namespace: default
appdaemon        | 2020-09-08 19:25:41.858338 INFO AppDaemon: home_presence_app: Entity sensor.monitor_wife_hallway_conf created in namespace: default
appdaemon        | 2020-09-08 20:55:31.370415 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_hallway_conf created in namespace: default
appdaemon        | 2020-09-08 22:09:35.168948 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_hallway_conf created in namespace: default
appdaemon        | 2020-09-08 22:11:09.188104 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_hallway_conf created in namespace: default
appdaemon        | 2020-09-09 08:25:58.757793 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_hallway_conf created in namespace: default
appdaemon        | 2020-09-09 09:10:54.589689 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_hallway_conf created in namespace: default
appdaemon        | 2020-09-09 11:04:03.683985 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_hallway_conf created in namespace: default
appdaemon        | 2020-09-09 13:10:32.767909 INFO AppDaemon: home_presence_app: Entity sensor.monitor_me_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 13:10:52.432957 INFO AppDaemon: home_presence_app: Entity sensor.monitor_wife_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 13:11:03.042386 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 14:54:50.549549 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_hallway_conf created in namespace: default
appdaemon        | 2020-09-09 14:54:54.033308 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 15:22:54.643113 INFO AppDaemon: home_presence_app: Entity sensor.monitor_me_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 15:23:03.456446 INFO AppDaemon: home_presence_app: Entity sensor.monitor_wife_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 15:23:52.652588 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_hallway_conf created in namespace: default
appdaemon        | 2020-09-09 15:23:56.668961 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 15:51:21.629134 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_hallway_conf created in namespace: default
appdaemon        | 2020-09-09 15:51:28.175603 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 19:43:33.132545 INFO AppDaemon: home_presence_app: Entity sensor.monitor_me_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 19:43:52.296800 INFO AppDaemon: home_presence_app: Entity sensor.monitor_wife_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 19:46:44.619083 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 19:46:48.659706 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_hallway_conf created in namespace: default
appdaemon        | 2020-09-09 21:20:36.953149 INFO AppDaemon: home_presence_app: Entity sensor.monitor_me_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 21:20:39.155465 INFO AppDaemon: home_presence_app: Entity sensor.monitor_wife_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 21:23:50.238801 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_kitchen_conf created in namespace: default
appdaemon        | 2020-09-09 21:23:53.272108 INFO AppDaemon: home_presence_app: Entity sensor.monitor_daughter_hallway_conf created in namespace: default

Is there any troubleshooting steps I could try or logs to send you to help get to the bottom of this please?

My config files are:

appdaemon:
  latitude: xx.xxxx
  longitude: -x.xxxxx
  elevation: xx
  time_zone: Europe/London
  plugins:
    HASS:
      type: hass
      ha_url: "http://x.x.x.x:8123"
      token: "myToken"
    MQTT:
       type: mqtt
       namespace: mqtt
       client_host: x.x.x.x
       client_user: mqttuser
       client_password: password
http:
  url: http://x.x.x.x:5050
admin:
api:
hadashboard:
home_presence_app:
  module: home_presence_app
  class: HomePresenceApp
  plugin: 
    - HASS
    - MQTT
  monitor_topic: monitor
  user_device_domain: device_tracker
  everyone_not_home: monitor_everyone_not_home
  everyone_home: monitor_everyone_home
  somebody_is_home: monitor_somebody_is_home
  # log_level: DEBUG
  home_gateway_sensors:
    - binary_sensor.door_front_contact
    - binary_sensor.window_spare_sensor_s2_contact

  known_devices:
    - xx:xx:xx:xx:xx:9E me
    - xx:xx:xx:xx:xx:15 wife
    - xx:xx:xx:xx:xx:53 daughter

  scheduled_restart:
    time: 00:00:01
    days:
      - mon
      - thu
    location: all

Thanks.

AttributeError: 'NoneType' object has no attribute 'entity_exists'

I have Monitor setup on a Pi Zero W in the Garage and a Pi 4b as my main HA Server (in a venv) but with no Monitor setup.

I've got AppDaemon running on the Pi4b in its own venv, and am running into the following issue poping up in the AD logs:

Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.263388 INFO AppDaemon: Initializing app home_presence_app using class HomePresenceApp from module home_presence_app Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.270178 WARNING AppDaemon: Unknown Plugin Configuration in get_plugin_api() Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.271528 WARNING home_presence_app: ------------------------------------------------------------ Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.271999 WARNING home_presence_app: Unexpected error running initialize() for home_presence_app Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.272401 WARNING home_presence_app: ------------------------------------------------------------ Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.275186 WARNING home_presence_app: Traceback (most recent call last): Jan 09 22:13:54 HA-SERVER appdaemon[16601]: File "/srv/appdaemon/lib/python3.7/site-packages/appdaemon/app_management.py", line 145, in initialize_app Jan 09 22:13:54 HA-SERVER appdaemon[16601]: await utils.run_in_executor(self, init) Jan 09 22:13:54 HA-SERVER appdaemon[16601]: File "/srv/appdaemon/lib/python3.7/site-packages/appdaemon/utils.py", line 277, in run_in_executor Jan 09 22:13:54 HA-SERVER appdaemon[16601]: response = future.result() Jan 09 22:13:54 HA-SERVER appdaemon[16601]: File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run Jan 09 22:13:54 HA-SERVER appdaemon[16601]: result = self.fn(*self.args, **self.kwargs) Jan 09 22:13:54 HA-SERVER appdaemon[16601]: File "/home/appdaemon/.appdaemon/conf/apps/home_presence_app.py", line 25, in initialize Jan 09 22:13:54 HA-SERVER appdaemon[16601]: if not self.mqtt.entity_exists(self.monitor_entity): Jan 09 22:13:54 HA-SERVER appdaemon[16601]: AttributeError: 'NoneType' object has no attribute 'entity_exists' Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.275689 WARNING home_presence_app: ------------------------------------------------------------

Any ideas on what I'm doing wrong?

Thanks.

Double check away state for BEACON

This is a follow from my post on the home assistant forum
Iโ€™m having problems with the xiaomi mi band 3 beacons. Standing in the same place, suddenly the confidence drops to 0 and then jump to 100.
https://imgur.com/iwEPbA0

I arrived at 2:00pm to my home and I have been sited in the computer until now (like 2 meters away), and it keep changing from 0 to 100 on confidence
image

Is there a way to add like a recheck on the away status? Like:

  • Monitor check and now confidence goes to 0, can it wait 10 seconds and do a recheck to confirm that confidence is 0 and then change to the away status?

Thanks for the great app and the help

[REQUEST] Remote nodes configuration + misc

Hello, just found this great plugin on HACS and looks very interesting!

Would like to know if these extra feature could be present in future releases.
Managing remote HA installations could be further easier i think... ;-)

  1. ability to reconfigure a remote-node name.
    One could start with multiple remote nodes from a single (standard) rpi image, so all remote nodes with the same name (ie 'clean'). Collecting MACs from remote nodes and then mapping each MAC address to a unique node name:
    MAC xx:xx:xx:xx:xx:xx livingroom (remotenodename1)
    MAC yy:yy:yy:yy:yy:yy: kitchen (remotenodename2)
    Then send the new names to the nodes. Does this make sense? (this is related to point 2 below)

  2. ability to resolve remote-node by its hostname (see above) instead of IP.
    Home router's dhcp wont assings every time the same ip and configuring reservations its not always possible on all routers or could be time consuming and error prone...

  3. ability to re-configure the type of scan on remote-nodes.
    Instead to login to each remote-node and reconfigure its scan mode, having a central config to map and send the correct scan mode could be nice:
    node: livingroom > -tdr -a -b
    node: kitchen > -tad -a -b
    Or simply mark one node as primary (so with -tdr -a -b) and each further remote-node as secondary (so with -tad -a -b)

Sorry for asking some features eventually already present! I've just read the docs and can't wait to start experimenting with this plugin!

Keep on the good work!
Tks

Documentation typo: "someone_is_home" should be "somebody_is_home"

README lists incorrect someone_is_home option in 3 places:

  1. App Configuration Section, in the "key" column.
  2. App Configuration Section, in the "default" column.
  3. Features Section: The name of the sensors for everyone_home, everyone_not_home and someone_is_home can be modified to use other names as required. - contributed by shbatm

This can lead folks to look for a binary_sensor.someone_is_home sensor in HASS rather than the correct binary_sensor.somebody_is_home sensor.

Presence_event not firing due to wildcard

I'm not sure when it started, but after some recent updates of HA/AppDaemon, I noticed my monitor sensors weren't being created. Currently my HA/AppDaemon/Home_presence_app is at 2021.10.5/0.7.0/2.4.1. My configuration for home_presence_app is basically just defaults and didn't change from when it stopped working.

After debugging, I determined that the listen event was not processing anything from monitor/#. I ended up having to commenting out the wildcard arg in the listen_event registration and adding a manual filter in presence_message.

        # Setup primary MQTT Listener for all presence messages.
        self.mqtt.listen_event(
            self.presence_message,
            self.args.get("mqtt_event", "MQTT_MESSAGE"),
            #wildcard=f"{self.presence_topic}/#",
        )
    def presence_message(self, event_name, data, kwargs):
        """Process a message sent on the MQTT Topic."""
        topic = data.get("topic")
        payload = data.get("payload")
        self.adbase.log(f"{topic} payload: {payload}", level="DEBUG")

# addition here
        if not topic.startswith(self.presence_topic):
            return
        topic_path = topic.split("/")
        action = topic_path[-1].lower()

Reading through the AppDaemon MQTT API, I have no idea why the wildcard kwarg is having a problem. I'd normally submit a PR but it seems like a step backward to disable the wildcard and filter in the callback. I did check the AppDaemon Issues and didn't see any mention of this there. Once I got my workaround, I didn't bother to go down the stack to figure out anything further due to attention-span constraints but I thought I'd at least report the issue if someone else runs into this and wants a workaround.

Reading retained messages at Monitor-App start

My question is whether it is possible to get retained MQTT events when Appdaemon and Monitor-App start to properly initialize sensors that Monitor-App creates.

To give you some context: I have two Raspberry PIs at my place with monitor running on them. When I leave the house or get back to it, they react fairly quickly (messages reflecting new confidence are typically emitted within 2 minutes after I leave/return). However, if I stay home, there can be a significant gap between consequent monitor messages (Iโ€™ve seen at least 5 hours). If I donโ€™t use retained messages in the MQTT topic and start Monitor-App, that means that I might not have accurate state of Monitor-App sensors for the first few hours after the start. Receiving retained messages and using them at the app start to do proper setup of the initial state sounds like a reasonable idea to me, but I cannot figure out how it can be configured or whether it is supported at all.

Iโ€™ve tried running appdaemon in debug mode and here are some relevant logs Iโ€™ve seen:

2021-02-07 18:08:19.847376 DEBUG MQTT: Message Received: Topic = monitor/living_room/iphone, Payload = b'{"id":"##REDACTED##","confidence":"100","name":"iPhone","manufacturer":"Apple Inc","type":"KNOWN_MAC","retained":"true","timestamp":"Sun Feb 07 2021 17:41:48 GMT-0800 (PST)","version":"0.2.200"}'
2021-02-07 18:08:19.847526 DEBUG AppDaemon: {'namespace': 'mqtt', 'domain': 'mqtt', 'service': 'publish'}
2021-02-07 18:08:19.847675 DEBUG AppDaemon: process_event_callbacks() mqtt {'event_type': 'service_registered', 'data': {'namespace': 'mqtt', 'domain': 'mqtt', 'service': 'publish'}}
2021-02-07 18:08:19.847889 DEBUG AppDaemon: Event type:MQTT_MESSAGE:
2021-02-07 18:08:19.866731 INFO MQTT: MQTT Plugin initialization complete
2021-02-07 18:08:19.870588 DEBUG AppDaemon: Reading /conf/apps/Monitor-App/home_presence_app.yaml
2021-02-07 18:08:19.881759 INFO AppDaemon: App 'home_presence_app' added
2021-02-07 18:08:22.080343 DEBUG home_presence_app: Listening on MQTT Topic monitor
2021-02-07 18:08:22.080684 DEBUG home_presence_app: Calling listen_event for home_presence_app

If I get it right, appdaemon does get the retained messages at startup correctly, but that happens during MQTT plugin initialization that is before the Monitor-App is started and gets its chance to receive those messages.

Is there anything that can be done to actually route retained messages to Monitor-App?

device_tracker.monitor not showing "overview"

Hi.

I've been using monitor for a long time and have just recently started testing if I should move to HA. So far HA, HACS, AppDaemon and monitor-app is installed and everything works perfectly - except for one small detail it seems:

When restarting, monitor-app adds all the devices (as it should) but only "Everyone Not Home", "Everyone Home" and "Somebody Is Home" are showing in the overview. I have rebooted and restarted multiple times, but they do not show up.

I find the devices in the AppDaemon interface and under Developer Tools, but they are not showing in the "Overview" nor can I add them to "Home Panel".

Any advise?

//Thomas

Documentation and Application discrepancies

Hi!

I just installed AD4 on a pi3 that connects to another pi3 where it is installed Hass.io

I can connect and I see that motion is triggered.

so the 3 way communication is working as expected.

During the setup I set the two plugins for AD4 mqtt and hass and I set mqtt a namespace "mqtt"

during the startup of the app I see in the logs:

Entity monitor.monitor_state not found in namespace mqtt
Entity monitor.monitor_state created in namespace: mqtt

from the README file I was expecting to be able to find a monitor entity in home assistant but this entity is not present, or at least I cannot see it from the lovelace add entity menu, either in the entity registry.

  • Am I doing something wrong?
  • Am I missing something from the README file?

thank you in advance
Andrea

[Request] Parse MQTT payload msg from Monitor sensor state into state and attributes

Right now sensor entities created in HA for each Monitor uses the MQTT payload message verbatim as the state. For example, the state for my "living room" monitor is as follows:

{โ€œlast_rebootedโ€: โ€œโ€, โ€œlocationโ€: โ€œLiving Roomโ€, โ€œlast_changedโ€: โ€œ2020-10-10T11:38:44-04:00โ€, โ€œstateโ€: โ€œonlineโ€})

It would be great if the sensor would report the state only based on the โ€œstateโ€ topic and then maybe have the other topics as attributes.

Using the example above, the sensor.living_room_state would have an โ€œonlineโ€ state. With attributes:

  • Last rebooted
  • Location
  • Last changed

Also, the overall "Monitor" state can also be converted to a sensor with attributes rather than using the state to store the MQTT payload. This will also eliminate the "More than state max length of 255 characters" error I get with this sensor. This also has a bit more attributes than the individual monitor sensors. For example, this one would have "scan_type", "online_nodes", etc.

Thank you.

Entity presence.monitor_state not found in namespace mqtt

I'm seeing the following warning in my logs:

Jan 10 14:59:27 HA-SERVER appdaemon[6112]: 2020-01-10 14:59:27.925970 INFO AppDaemon: Loading App Module: /home/appdaemon/.appdaemon/conf/apps/home_presence_app.py Jan 10 14:59:27 HA-SERVER appdaemon[6112]: 2020-01-10 14:59:27.941633 INFO AppDaemon: Initializing app home_presence_app using class HomePresenceApp from module home_presence_app **Jan 10 14:59:27 HA-SERVER appdaemon[6112]: 2020-01-10 14:59:27.967513 WARNING home_presence_app: home_presence_app: Entity presence.monitor_state not found in namespace mqtt** Jan 10 14:59:27 HA-SERVER appdaemon[6112]: 2020-01-10 14:59:27.969570 INFO AppDaemon: home_presence_app: Entity presence.monitor_state created in namespace: mqtt Jan 10 14:59:28 HA-SERVER appdaemon[6112]: 2020-01-10 14:59:28.022786 INFO AppDaemon: App initialization complete

Is this something that I should be concerned about?

Sensors not showing in HomeKit after reboot HA/AppDaemon

Hi!
First, awesome setup with Monitor-app!

But I have an issue, when I reboot HA, it takes 2 min before Monitor-app has updated the node and made alle the sensors, so they are not showing up in my HomeKit unless I restart the HomeKit integration, and it makes totally sense because Monitor-app updates the node after each reboot.

Is there someway I can make the sensors stick in HA, so HomeKit loads them after reboot?

Ability to rename created binary entities

Would be nice to rename binary entities. Right now there is no way to do it, so if you made the mistake during initial set up you are out of luck.

Proposed solutions:

  • Maybe just updating the text next to Mac address can always be the appropriate name
  • If that's too hard maybe it can be specified as a separate line like:

known_devices:
- CC:D2:81:4B:71:F4 Vanessa
label: "Vanessa is home"
- CC:D2:81:4D:18:90 Alex
- 24:F0:94:7D:EE:83 Guest Tania
- 14:D0:0D:7D:F2:3E Guest Anna

Suggestion: combine some of the sensors to reduce clutter :)

I have 4 people and 3 sensors so my set up is not very crazy. I also want to add guests so I will probably have 10 total people.. which you guessed it, results in A LOT of sensors being created in HA. I suggest reducing the number of sensors to just binary sensors and a monitor state sensor. We can then move all the confidence information inside each person's sensor so it's still accessible if someone needs it.

Soo then we will only have the following:

sensor.monitor_state

  • primary display: show current monitor status
  • attribute: online nodes
  • attribute: offline nodes

binary_sensor.alias

  • primary display: show the current state
  • attribute: mac address
  • attribute: nearest node
  • attribute: list of nodes, their confidence, and timestamp of the update.

Again these are just minor suggestions, love this app!

How/Where ot install this.

Hi,

I successfully installed appdaemon and would love to get your app up and running. however, I don't seem to be able to find anywhere that shows where to place the files for an app. If you could let me know where I need to copy the files to for Monitor-App i'd really appreciate it.

Thanks.

[REQUEST] UI for easier management :)

LOVE your app! It really made the setup of the monitor simple! Improvement suggestion:

I know monitor script discoveres devices all the time. It would be awesome to have some GUI or alternatively using some predefined parameters to add new Bluetooth aliases automatically into the config?

Use case scenario: The user has a guest that comes to the house. When Arrival scan is triggered monitor script detects that along with the owner there is a new bluetooth address (it detects that it's an Apple or Android device) and adds those Bluetooth addresses to the config.

If there is a GUI then we can show a list of new users and an ability to rename them. If there is none they can just be added as guest1, guest2 and it's up to the owner to rename them later.

I know there are a few caveats here like detecting neighbor's Bluetooth devices etc. Which we can probably tweak later (like adding them to a blacklist). However, I do believe that this can really be useful for adding guests to the "allowed" list of the house quickly.

Bash script failing

Hi,

Thank you for your work on the app!

I'm trying to get it to install over my current monitor setup(on a raspberry pi 3 model b) but I'm getting an error when running the first command:

bash -c "$(curl -sL https://raw.githubusercontent.com/Odianosen25/Monitor-App/master/installer/install_ad.sh)"

It says "bash: line 2: cd: $'\r': No such file or directory", "bash: line 3: $'clear\r': command not found", "bash: line 14: cd: $'\r': No such file or directory", "bash: line 17: $'\r': command not found" and "bash: -c: line 166: syntax error: unexpected end of file"

Am I missing something?

Scheduled restart missing Python package

Hi again, when I use the scheduled restart Appdaemon log an error where there's a missing package called "paramiko". I tried to import that module in the addon configuration (I use Appdaemon on Hassio) but it doesn't work.
After some tests this is the error I got:

Using cached https://files.pythonhosted.org/packages/8c/23/848298cccf8e40f5bbb59009b32848a4c38f4e7f3364297ab3c3e2e2cd14/wheel-0.34.2-py2.py3-none-any.whl
  Collecting cffi>=1.4.1
    Downloading https://files.pythonhosted.org/packages/05/54/3324b0c46340c31b909fcec598696aaec7ddc8c18a63f2db352562d3354c/cffi-1.14.0.tar.gz (463kB)
  Collecting pycparser (from cffi>=1.4.1)
    Downloading https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl (112kB)
  Installing collected packages: setuptools, wheel, pycparser, cffi
    Running setup.py install for cffi: started
      Running setup.py install for cffi: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: /usr/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l5eyjout/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l5eyjout/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ubzogqh_/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-p390l_aa/overlay --compile
           cwd: /tmp/pip-install-l5eyjout/cffi/
      Complete output (64 lines):
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      Package 'libffi', required by 'virtual:world', not found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      Package 'libffi', required by 'virtual:world', not found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      Package 'libffi', required by 'virtual:world', not found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      Package 'libffi', required by 'virtual:world', not found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      Package 'libffi', required by 'virtual:world', not found
      /usr/lib/gcc/armv7-alpine-linux-musleabihf/9.2.0/../../../../armv7-alpine-linux-musleabihf/bin/ld: cannot find Scrt1.o: No such file or directory
      /usr/lib/gcc/armv7-alpine-linux-musleabihf/9.2.0/../../../../armv7-alpine-linux-musleabihf/bin/ld: cannot find crti.o: No such file or directory
      /usr/lib/gcc/armv7-alpine-linux-musleabihf/9.2.0/../../../../armv7-alpine-linux-musleabihf/bin/ld: cannot find -lssp_nonshared
      collect2: error: ld returned 1 exit status
      Note: will not use '__sync_synchronize()' in the C code
      ***** The above error message can be safely ignored.
  
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-3.8
      creating build/lib.linux-armv7l-3.8/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/verifier.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/recompiler.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/cparser.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/commontypes.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/api.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/lock.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/error.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/model.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/__init__.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/_embedding.h -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.8/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-armv7l-3.8
      creating build/temp.linux-armv7l-3.8/c
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.8/c/_cffi_backend.o
      In file included from c/_cffi_backend.c:2:
      /usr/include/python3.8/Python.h:11:10: fatal error: limits.h: No such file or directory
         11 | #include <limits.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command 'gcc' failed with exit status 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /usr/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l5eyjout/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l5eyjout/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ubzogqh_/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-p390l_aa/overlay --compile Check the logs for full command output.
  WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.8 /usr/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-p390l_aa/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --find-links https://wheels.hass.io/alpine-3.11/armv7/ -- setuptools wheel 'cffi>=1.4.1; python_implementation != '"'"'PyPy'"'"'' Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[18:09:59] FATAL: Failed installing package pynacl
[cont-init.d] appdaemon.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.

 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

What I did wrong??

Thanks in advice for any help.

Control triggered scans

Hi, and thank you for your efforts in creating this app. I really love it, and since I've already used the monitor app for quite some time, your app was a great addition.

I do have a question I hope you can help me with, but first my setup:

  • Primary PI zero running -x -tad -a to track who's home and not
  • Secondary PI B running -x -tad -a in the garage

I have set up two gateways to trigger scans: One is a camera at my front door, and the second is a motion detector at my garage.

This works most of the time: People coming and going triggering both arrival and departure scans. The one problem I'm having is that when leaving the house I some time end up in front of the garage in the middle of an ongoing scan and I have to manually open the garage door. (yeah, I know right - "manually"!)

My question is this: Is it possible to run scans selectively on any given node? I would prefer if the front door camera only triggered scans on the primary node, and the motion detector at my garage triggered scans only on the secondary node.

Do you think this is doable, or is there a simpler solution to what I'm trying to achieve?

//Thomas

[REQUEST] Scheduled restart monitor's IP dynamic

Hi, when i configured your monitor app I've noticed that in the section called "scheduled_restart" the IP of every RPIzero is static. My nodes use DHCP and every time I reboot them I must modify the config. There's a way to use a symbolic name instead of the IP?? Or read IP addresses after the reboot and write them in the config??

Thanks in advice for any answer.

Known static addresses disappear

This has happened to me at least twice now...

I currently have four PiZero devices running monitor on them. I had originally configured them with the known_static_addresses file listing each family member's iPhone BT MAC address. When I set up Monitor, I kept those files but also included that information in the home_presence_app.yaml file.

HassOS 4.13
Supervisor v 245
AppDaemon 4.05 v 0.3.0

What happens is that everything seems to run smoothly for a while. I get my binary presence sensor for each person and each monitor device (e.g. sensor.monitor_cindy_iphonebt_garage_conf) . Then, for no apparent reason, the known_static_addresses information disappears from each device, and the binary sensors go away as well. On 8/29, the home_presence_app.yaml file totally disappeared, and I had to recreate it.

home_presence_app.zip

image

image

CRITICAL MQTT: There was an error while processing an MQTT message: <class 'IndexError'> list index out of range

Hello

First time using appdaemon and monitor together, currently running the old monitor as a service on rpi's around the house, so getting myself up to speed

I've stopped all the current monitor services so that I can get this working on my RPI4 first before looking at using the other RPI's around the house

So this is my appdaemon.yaml

appdaemon:
  time_zone: Europe/London
  latitude: ##
  longitude: ##
  elevation: ##
  plugins:
    HASS:
      type: hass
      namespace: HomeAssistant
      ha_url: ##
      token: ##
    MQTT:
       type: mqtt
       namespace: mqtt
       client_host: ##
       verbose: True
http:
  url: http://raspberrypi:5050
admin:
api:
hadashboard:

And my apps.yaml
home_presence_app:

  module: home_presence_app
  class: HomePresenceApp
  plugin:
    - HASS
    - MQTT
  known_devices:
    - ## Pixel3
    - ## HuaweiP
  depart_check_time: 30
  depart_scans: 3
  minimum_confidence: 60
  not_home_timeout: 15
  system_check: 30
  system_timeout: 60
  log_level: DEBUG

However, when running I'm constantly getting this errror

2020-10-07 11:57:18.172918 INFO MQTT: Unable to decode MQTT message
2020-10-07 11:57:18.252249 INFO AppDaemon: Scheduler running in realtime
2020-10-07 11:57:18.300100 INFO AppDaemon: Adding /conf/apps to module import path
2020-10-07 11:57:18.301460 INFO AppDaemon: Adding /conf/apps/home_presence_app to module import path
2020-10-07 11:57:18.306070 INFO AppDaemon: Loading App Module: /conf/apps/home_presence_app/home_presence_app.py
2020-10-07 11:57:18.316435 INFO AppDaemon: Initializing app home_presence_app using class HomePresenceApp from module home_presence_app
2020-10-07 11:57:18.330237 DEBUG home_presence_app: set state: monitor.monitor_state, {'state': 'idle', 'attributes': {'locations': [], 'version': '2.3.4', 'nodes': 0, 'online_nodes': [], 'offline_nodes': [], 'friendly_name': 'Monitor System State'}, 'replace': True}
2020-10-07 11:57:18.331515 WARNING home_presence_app: home_presence_app: Entity monitor.monitor_state not found in namespace mqtt
2020-10-07 11:57:18.333222 INFO AppDaemon: home_presence_app: Entity monitor.monitor_state created in namespace: mqtt
2020-10-07 11:57:18.337363 DEBUG home_presence_app: Calling listen_state for home_presence_app
2020-10-07 11:57:18.351326 INFO home_presence_app: Previous message repeated 1 times
2020-10-07 11:57:18.352020 DEBUG home_presence_app: call_service: mqtt/publish, {'topic': 'monitor/state', 'payload': '{"locations": [], "version": "2.3.4", "nodes": 0, "online_nodes": [], "offline_nodes": [], "last_changed": "2020-10-07T11:57:18+01:00", "state": "idle"}'}
2020-10-07 11:57:18.519552 WARNING home_presence_app: No Gateway Sensors specified, Monitor-APP will run Arrive and Depart Scan every 2 minutes. Please specify Gateway Sensors for a better experience
2020-10-07 11:57:18.522568 DEBUG home_presence_app: Registering run_every starting 2020-10-07 11:57:19.521041+01:00 in 60s intervals for home_presence_app
2020-10-07 11:57:18.526036 DEBUG home_presence_app: Registering run_every starting 2020-10-07 11:57:20.524758+01:00 in 60s intervals for home_presence_app
2020-10-07 11:57:18.529554 DEBUG home_presence_app: Registering run_every starting 2020-10-07 11:57:19.528183+01:00 in 30s intervals for home_presence_app
2020-10-07 11:57:18.532206 DEBUG home_presence_app: Calling listen_event for home_presence_app
2020-10-07 11:57:18.535054 DEBUG home_presence_app: Listening on MQTT Topic monitor
2020-10-07 11:57:18.536294 DEBUG home_presence_app: Calling listen_event for home_presence_app
2020-10-07 11:57:18.538286 DEBUG home_presence_app: Registering run_in in 0 seconds for home_presence_app
2020-10-07 11:57:18.540171 DEBUG home_presence_app: register_service: monitor/remove_known_device, {}
2020-10-07 11:57:18.541716 DEBUG home_presence_app: register_service: monitor/run_arrive_scan, {}
2020-10-07 11:57:18.542401 DEBUG home_presence_app: register_service: monitor/run_depart_scan, {}
2020-10-07 11:57:18.543175 DEBUG home_presence_app: register_service: monitor/run_rssi_scan, {}
2020-10-07 11:57:18.543900 DEBUG home_presence_app: register_service: monitor/run_node_command, {}
2020-10-07 11:57:18.544653 DEBUG home_presence_app: register_service: monitor/restart_device, {}
2020-10-07 11:57:18.545372 DEBUG home_presence_app: register_service: monitor/reload_device_state, {}
2020-10-07 11:57:18.546085 DEBUG home_presence_app: register_service: monitor/load_known_devices, {}
2020-10-07 11:57:18.546820 DEBUG home_presence_app: register_service: monitor/clear_location_entities, {}
2020-10-07 11:57:18.547599 DEBUG home_presence_app: register_service: monitor/clean_devices, {}
2020-10-07 11:57:18.551522 INFO AppDaemon: App initialization complete
2020-10-07 11:57:19.011956 DEBUG home_presence_app: Registering run_in in 45 seconds for home_presence_app
2020-10-07 11:57:19.018543 DEBUG home_presence_app: Registering run_in in 105 seconds for home_presence_app
2020-10-07 11:57:19.966267 CRITICAL MQTT: There was an error while processing an MQTT message: <class 'IndexError'> list index out of range
2020-10-07 11:57:20.017156 DEBUG home_presence_app: call_service: mqtt/publish, {'topic': 'monitor/scan/arrive', 'payload': ''}
2020-10-07 11:57:20.040131 DEBUG home_presence_app: call_service: mqtt/publish, {'topic': 'monitor/echo', 'payload': ''}
2020-10-07 11:57:20.070976 DEBUG home_presence_app: monitor/scan/arrive payload:
2020-10-07 11:57:20.090764 DEBUG home_presence_app: monitor/echo payload:
2020-10-07 11:57:20.094462 DEBUG home_presence_app: Echo received from unknown:
2020-10-07 11:57:21.023401 DEBUG home_presence_app: Registering run_in in 30 seconds for home_presence_app
2020-10-07 11:57:27.915413 INFO MQTT: Previous message repeated 7 times
2020-10-07 11:57:27.916192 CRITICAL MQTT: There was an error while processing an MQTT message: <class 'IndexError'> list index out of range
2020-10-07 11:57:38.055923 INFO MQTT: Previous message repeated 11 times
2020-10-07 11:57:38.056810 CRITICAL MQTT: There was an error while processing an MQTT message: <class 'IndexError'> list index out of range
2020-10-07 11:57:48.224286 INFO MQTT: Previous message repeated 13 times
2020-10-07 11:57:48.224993 CRITICAL MQTT: There was an error while processing an MQTT message: <class 'IndexError'> list index out of range

I cannot find any reason why the critical error is showing, but nothing seems to be working so guessing this is the first issue to tackle

Everyone_home/not_home wrong state

Hello!

I have started to looking to use the binary sensors created from the app. But my sensors are reporting wrong state.
In the app i have 4 macs. And by the time writing, 2 is home and 2 is away.
And the status of the sensors is:

binary_sensor.everyone_home = on
binary_sensor.everyone_not_home = off

Feels to me that they are switched?

Warning HASS code 500 creating sensor

Hi, I change mi rasp zero W for a rasp 3 with external dongle, to compare the bluetooth range.
I set everything and in the debug log I can see that the appdaemon create the sensor in the web but it show an error when registering on HA. Error code 500, any idea?
Nothing of the info of the table is registered on HA
image

2020-03-17 11:25:46.448187 INFO home_presence_app: Creating sensor 'sensor.monitor_t_band_rasp-monitor_conf' for Confidence 2020-03-17 11:25:46.451220 DEBUG home_presence_app: set state: sensor.monitor_t_band_rasp-monitor_conf, {'state': 62, 'attributes': {'friendly_name': 'T Band Rasp-Monitor Confidence', 'unit_of_measurement': '%'}} 2020-03-17 11:25:46.453539 WARNING home_presence_app: home_presence_app: Entity sensor.monitor_t_band_rasp-monitor_conf not found in namespace default 2020-03-17 11:25:46.457314 INFO AppDaemon: home_presence_app: Entity sensor.monitor_t_band_rasp-monitor_conf created in namespace: default 2020-03-17 11:25:46.588716 WARNING HASS: Error setting Home Assistant state default.sensor.monitor_t_band_rasp-monitor_conf, {'state': 62, 'attributes': {'friendly_name': 'T Band Rasp-Monitor Confidence', 'unit_of_measurement': '%'}} 2020-03-17 11:25:46.590961 WARNING HASS: Code: 500, error: 500 Internal Server Error Server got itself in trouble

Also another question to avoid making more mistakes.

In the app daemon I have already set;
user_device_domain: device_tracker
known_beacons:

I want to use 2 nodes, one rasp W and one rasp 3 with dongle. Here I need to set up inside each one the following options or because they are already defined on the appdaemon there is no need?
KNOWN BEACON DEVICES
PREF_DEVICE_TRACKER_REPORT=TRUE

Thanks for the great app

Add support for "cover" gateway sensor

If the garage is hooked up to home assistant usually it shows as cover The states are open, opening, closing, closed. Yes I know I can set up another template sensor that converts that to a binary sensor but would be nice if it was supported out of the box :)

Thank you!

No sensors are created and status always away

I currently have a RP ZeroW with monitor script. In monitor everything is displayed correctly, the devices are also recognized.
In Monitor app nothing happens. I have the following configuration in Monitor:


MQTT:
# MQTT PUBLISH TOPIC ROOT
mqtt_topicpath='monitor'

# PUBLISHER IDENTITY
mqtt_publisher_identity='garage'

known_static_addresses:
48:04:CD:00:11:22 Alen
64:DD:CC:FF:EE:AA Amanda

Monitor App Config:
home_presence_app:
  module: home_presence_app
  class: HomePresenceApp
  plugin: 
    - HASS
    - MQTT
  monitor_topic: monitor
  mqtt_event: MQTT
  user_device_domain: device_tracker
  #everyone_not_home: everyone_not_home
  #everyone_home: everyone_home
  #somebody_is_home: somebody_is_home
  depart_check_time: 30
  depart_scans: 3
  minimum_confidence: 50
  not_home_timeout: 15
  system_check: 30
  system_timeout: 60
  home_gateway_sensors:
     - binary_sensor.motion_frontdoor
     - cover.garage_modtm
     - binary_sensor.netatmo_motion_human

  location:
    - dach
    - garage

  home_motion_sensors:
    - binary_sensor.0x0aaaaaa_occupancy
    - binary_sensor.0x00bbbbb_occupancy
    - binary_sensor.0x001ccc6_occupancy
    - binary_sensor.0x00158bc_occupancy
    
  log_level: DEBUG
  known_devices:
    - 48:04:CD:00:11:22 Alen
    - 64:DD:CC:FF:EE:AA Amanda
  
  known_beacons:
    - D9:3C:BB:EF:FF:FF MiBand

Everyone Home and Everyone not Home and Somebody is Home are always "Away"

Have a monitor.xxxx_None sensor with value undefined show up

I noticed that I have monitor.xxxx_None (xxx being the name) with value "unknown" show up in a log which seems to be the cause of a lot of false positives. Maybe it creates incorrect confidence value?

This started happening since I added another node to my network to make things more stable. There are numerous times when person is marked offline but when I check AppDaemon I can see that at least one node is showing 100% confidence level.

Maybe this wouldn't be that big of an issue if scanning only happened when gateways are triggered instead of also do scans when nodes "appear" to go offline which does happen on wifi. Maybe have that at least as an option? So I have had automations trigger in the middle of the night. I think I am almost ready to switch back to manually wrangling my nodes.

Thanks for the help as usual.

Screen Shot 2021-06-24 at 11 33 14 AM

AppDaemon starvation

Hello i'm in the phase of testing the app now.

Simply added the app to AppDaemon with very basic configuration (2 monitor nodes).
After a while (more or less 1 day), the app seems to crash and cause AD starvation.
Below a portion of the logs and my conf.
This is the only appdaemon app running on my system at the moment.

Thank you

appdaemon_logs.txt
config.txt

Wrong message type for MQTT Listener: MQTT instead of MQTT_MESSAGE

Hello! I am trying to implement your new script in ADv4, but I'm struggling to get it running as posted.

Specifically, I wasn't getting any feedback from the MQTT service (publish was working fine, the subscription wasn't receiving any events). Changing the following line:

        self.mqtt.listen_event(self.presence_message, 'MQTT', wildcard = '{}/#'.format(self.presence_topic))

to this:

        self.mqtt.listen_event(self.presence_message, 'MQTT_MESSAGE', wildcard = '{}/#'.format(self.presence_topic))

seems to solve the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.