Home (Monitor) Presence App V2

Thx, just a final question: These Pis must be dedicated to run monitor, or can they also have a secondary version of HA installed and running. My primary HA is Hassio in VM on a NUC.

I spoke too soon…

I am using the addon and your appdeamon program on the same RPi4 with HomeAssistantOS. None of my known_devices or known_beacons get loaded into the monitor script. I have not set them in the addon config as your docs says that the appdemon program should load them into all nodes but its not happening.

I also seem to have this mqtt message in the broker - not sure if its related.

image

home_presence_app.yaml

home_presence_app:
  module: home_presence_app
  class: HomePresenceApp
  home_gateway_sensors:
    - binary_sensor.hall_frontdoor
    
  known_devices:
    - 50:50:A4:00:EB:89 stephen_phone
    # - 14:87:6A:BD:75:82 april_phone
  
  # known_beacons:
  #   - DC:0D:30:01:02:BE white_ibeacon
  #   - FC:58:FA:53:F9:6A black_itag

  user_device_domain: device_tracker

EDIT: and this keeps happening too. The addon seems fine and continues to frunction.

2020-08-23 23:39:45.041266 INFO home_presence_app: Processing System Unavailable for Hassio
2020-08-23 23:39:45.085334 WARNING home_presence_app: Node at Hassio is Offline, will need to be checked
2020-08-23 23:42:15.042888 INFO home_presence_app: Processing System Unavailable for Hassio
2020-08-23 23:42:15.089198 WARNING home_presence_app: Node at Hassio is Offline, will need to be checked
2020-08-23 23:43:16.022878 INFO home_presence_app: Processing System Unavailable for Hassio
2020-08-23 23:43:16.049824 WARNING home_presence_app: Node at Hassio is Offline, will need to be checked

The Pis don’t need to be dedicated. monitor.sh is a very small script, that can run on any Linux.

BUT, you don’t need to have a second instance from Home Assistant. Maybe my use case gives a little example:
I have a Pi Zero WH on my guest toilet, as it is right next to the front door of our apartment. A PI 3b+ in our garage, and another Pi 3b+ in our living room. Every Pi has monitor.sh running. The Pi Zero is “dedicated” as I can’t find anything useful to run on this one. Both other Pis do a lot more than just monitor.sh.
My Home Assistant instance is running on a Pi4 with 4GB. On this machine I don’t need monitor.sh, as this machine is strategically in the middle of the apartment. There I’d run the Presence App V2.

For a useful presence detection, you run your nodes near to entry points like the garage or the front door or the terrace door. These doors trigger a scan, if they are opened/closed, as this is the moment you want to know, if someone is leaving or coming. The movement inside the apartment is nothing I would want to know.

That’s why I don’t need (or find it useful) to run monitor.sh on the machine, I’m running HA on. Normally people don’t come or leave through windows, so I need to know, if something changes at the doors. :slight_smile: Then I can run some automations and a useful presence detection.

I hope this was a little explanatory, if not, just ask. :slight_smile:

1 Like

Hello @Eeeeeediot,

What it means is that the node is not being accessed, as its not responding to system_check. Do ensure the monitor scripts are connected to the broker, by first running them in debug mode, before trying out the app.

As long as it keeps saying Processing System Unavailable for Hassio, it means the node not responding to checks.

Regards

Hi @Odianosen25 I’m trying to use the install script as in the repo but it comes up with this error

bash: line 17: $'\r': command not found
[STEP 1/10] Updating system...
bash: -c: line 166: syntax error: unexpected end of file

I am trying to install on Ubuntu 18.04?

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

EDIT: So I’ve installed and configured AppDaemon as a docker container. I downloaded the home_presence_app folder from the repository and placed it into the apps folder and when I run Appdaemon I get these errors

2020-08-24 20:57:48.101511 WARNING AppDaemon: File '/home/matt/docker/appdaemon/ apps/home_presence_app/home_presence_app.example.yaml' invalid structure - ignoring

and

2020-08-24 21:00:58.117971 WARNING AppDaemon: No app description found for: /home/matt/docker/appdaemon/apps/home_presence_app/home_presence_app.py - ignoring

The only app it sees in the webgui is the hello_world one.

Is anyone successfully using the Hass.io Monitor Addon and this Appdaemon app together on the device (RPi4 for me) that is running HA? I think there is an issue that is causing the Appdeamon app to lose connection with the addon. Issue Report Here

I wondered if anyone managed to overcome this issue?

2020-08-24 22:09:29.046698 INFO home_presence_app: Processing System Unavailable for Hassio
2020-08-24 22:09:29.230148 WARNING home_presence_app: Node at Hassio is Offline, will need to be checked
2020-08-24 22:13:00.020143 INFO home_presence_app: Processing System Unavailable for Hassio
2020-08-24 22:13:00.129576 WARNING home_presence_app: Node at Hassio is Offline, will need to be checked
2020-08-24 22:16:29.039978 INFO home_presence_app: Processing System Unavailable for Hassio
2020-08-24 22:16:29.150478 WARNING home_presence_app: Node at Hassio is Offline, will need to be checked
2020-08-24 22:20:59.043362 INFO home_presence_app: Processing System Unavailable for Hassio
2020-08-24 22:20:59.147062 WARNING home_presence_app: Node at Hassio is Offline, will need to be checked
2020-08-24 22:34:30.022391 INFO home_presence_app: Processing System Unavailable for Hassio
2020-08-24 22:34:30.112202 WARNING home_presence_app: Node at Hassio is Offline, will need to be checked
2020-08-24 22:39:00.021633 INFO home_presence_app: Processing System Unavailable for Hassio
2020-08-24 22:39:00.124770 WARNING home_presence_app: Node at Hassio is Offline, will need to be checked
2020-08-24 22:45:59.039523 INFO home_presence_app: Processing System Unavailable for Hassio
2020-08-24 22:45:59.147782 WARNING home_presence_app: Node at Hassio is Offline, will need to be checked
2020-08-24 22:49:59.046381 INFO home_presence_app: Processing System Unavailable for Hassio
2020-08-24 22:49:59.173678 WARNING home_presence_app: Node at Hassio is Offline, will need to be checked

i bought a Raspberry Pi Zer W and installed the script on it and everything seems to be working so far.

However, i noticed that your docs say that i need to install requirement.txt to reboot nodes. I get an error when i try to install it and AppDeamon doesnt start - any idea what am i doing wrong?

Hass.io Addon config.

system_packages:
  - ffmpeg
python_packages:
  - requirements.txt
init_commands: []

AppDeamon Log

Looking in links: https://wheels.hass.io/alpine-3.11/aarch64/
Collecting requirements.txt
  ERROR: Could not find a version that satisfies the requirement requirements.txt (from versions: none)
ERROR: No matching distribution found for requirements.txt
WARNING: You are using pip version 19.2.3, however version 20.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[01:15:21] FATAL: Failed installing package requirements.txt
[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.
[s6-finish] sending all processes the KILL signal and exiting.

EDIT: I also tried paramiko in the addon config too but still didn’t work.

Did you use the install script? I keep getting an error show in the post above yours?

No. I have appdaemon running on HASSIO and manually installed monitor.sh on a pi zero.

When I had them both on the same pi there was an mqtt conflict

Right now, you are trying to install a package that is called requirements.txt. I very much doubt, there is such a package… :wink: Why do you even try to install it?

Your setup should be like this:

  • PiZero with monitor.sh running
  • HA machine with HomePresenceAppV2 running. No Hass.io addon or else, just this appdaemon app

If you use the Hass.io-addon on your HA machine, you would make the HA machine a node, too. That isn’t necessary or useful.

Hey @paddy0174.

That is how I have it set up but in the docs it says you need to install it to reboot nodes

What would the best arguments/settings to use if I have only 1 node and it is at my front door?

Also, would this advice change if I put an additional node upstairs?

Thanks

Hi @Odianosen25 would you be able to help please? Many thanks!

I’m new to Monitor and AppDaemon, and just trying to get my head round it all at the moment. Could someone help me understand what this paragraph means from the GitHub readme please?

In the main node, have good spacing between scans, not only to avoid unnecessarily flooding your environment with scans but also allowing the app to take over scans intermittently. I have mine set at 120 secs throughout for now

Where do I set this interval scan? I also only thought scans occurred when triggered by a listed gateway sensor (if using -tar or -tdr), so is this needed?

The closest setting I could find for this is PREF_MINIMUM_TIME_BETWEEN_SCANS - is this correct?

Thanks.

Is possible for the same pi zeros to also have additional functionality like reporting temperature and humidity from a Xiaomi blender LYWSDCGQ sensor? Something room assistant has

Hey @Odianosen25

Is it possible to have your app to create a binary sensor that monitors the status of each node? One of my raspberry Pi zeros stops responding and it would be nice to get a notification when it goes offline.

If you have gateway sensor it will get triggered on scan, however if you dont thats the interval part you can set

1 Like

It actually already creates a sensor for each individual Monitor instance running. I think the default name is "sensor.<monitor_name>_state.

However, the current state of that entity is only reflecting the MQTT payload message (e.g. {“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

@emteedubs,

Hello that’s a good suggestion and apologies to you and all I haven’t been able to respond to any queries so far.

Can you add this to the Gut repository? So when next I got time to focus on this, can get it done.

Regards

Yes as I said to @emteedubs above, will add it to the next version.

Regards