Giter Site home page Giter Site logo

how to use about ad-espresense-ips HOT 102 OPEN

corgan2222 avatar corgan2222 commented on May 29, 2024
how to use

from ad-espresense-ips.

Comments (102)

KuotenoAshiato avatar KuotenoAshiato commented on May 29, 2024 2

Yes, it would be this version

   
                           y2
   |----------------------*| x2
   |                       |
   |                       |
   |                       |
 y1|*______________________|
       x1                

I think just adding the z parameter in my room_solve function should work, but it could be that a device gets misguided if to close to the roof of a room or a ground, depending also on which height the tracker is placed.
I'll do some changes and would need another one to test this, as I currently neither have the tracker setup nor the house for such a test :/

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024 1

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024 1

It reads from espresense/rooms and writes to espresense/ips and espresense/location.

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024 1

Ahh yeah, that's it. From the README: This requires at least 3 ESPresense nodes that can get a "fix" on the particular device. The more devices the better. To get a decently accurate position you need at least 5 or 6. But this can find the location of something even if the particular room doesn't have a base station (You can put nodes on the perimeter of your house instead of the "center" of rooms). We need futher work to actually determine if the item is actually in a particular room (we'll need some kind of floorplan).

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024 1

I don't log anything for that case atm because it happens pretty often and would just clog the logs. I could add a periodic stats print out to help people tho. Good idea.

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024 1

MaxDistance 0 does no filtering. Atm is does help to set the maxDistance higher than your otherwise would. This is all VERY beta. I'd like to make maxDistance only apply to the mqtt room topic and use another topic so we get all the data.

from ad-espresense-ips.

KuotenoAshiato avatar KuotenoAshiato commented on May 29, 2024 1

So for your first question:
The room feature is exactly for the case of the ESPs not beeing in the center. Without the calculations of the AppDaemon, one esp can just work on its own. For it to approximately use the scale of the room, it is only configurable in the range. As youre increasing this range, youre increasing it into each direction. So, if you're having the device at an edge of one room and setting the range to the length of the other edge for full coverage, then you're expanding to that width aswell towards behind the edge, which ( in some cases) could be another room or outside.

The AppDaemon in that case uses position based calculations to get a hold of your positions between those ESPs that can see you at the same time. The more ESPs see you, the more accurate your position gets.
The only problem with that is, that to determine a special room, you would need to have some case of coordinate based Floorplan to put the coordinates of your device in relation to the room it is in.

I made some changes to a fork of this project where I implemented the basic functionality of this feature, I'm still doing some testing tho, to get it more accurate, once I'm able to set up more devices

from ad-espresense-ips.

Franz37 avatar Franz37 commented on May 29, 2024 1

Hello,

I tried to set up the appdeamon, but I don't know what I am supposed to see and if it really works.
I still see the "location" corresponding to the first set up i made (without appdeamon installed), but the new room created with the description below doesn't come up.

Tried to name with some suffix like "room_ips" to see if something were implemented in my HA.

One more question, in the appdaemon.yaml example, the token and the url of HA are written between quotes "xxxx" , should I have it as well ?

appdaemon:
  time_zone: Europe/Stockholm
  latitude: !secret latitude
  longitude: !secret longitude
  elevation: 26
  plugins:
    HASS:
      type: hass
      ha_url: http://192.168.1.200:8123
      token: !secret hass_token 
      namespace: default
      app_init_delay: 30
      appdaemon_startup_conditions:
        delay: 30
    MQTT:
      type: mqtt
      client_host: 192.168.1.200
      client_user: !secret mqtt_user
      client_password: !secret mqtt_pass
      namespace: mqtt
      birth_topic: appdaemon
      will_topic: appdaemon
ESPresenseIps:
  module: espresense-ips
  class: ESPresenseIps
  pluggins:
    - HASS
    - MQTT
  rooms:
    salon_ips: [-2.5, 0, 0.8]
    entree_ips: [-3.8, 3.8, 0.1]
    chambre_francois_ips: [-0.5, 5.5, 0]
    buanderie_ips: [-24, 4, 0]
  devices:
  - id: iBeacon:426c7565-4368-6172-6d42-6561636f6e73-3838-4949
    name: bluecharm_1_ips
    timeout: 30
    away_timeout: 120
  - id: iBeacon:426c7565-4368-6172-6d42-6561636f6e74-3838-4949
    name: bluecharm_2_ips
    timeout: 30
    away_timeout: 120
  roomplans:
  - name: salon_ips
    y1: 0.0
    x1: 0.0
    y2: 5.0
    x2: -5.0
  - name: chambre_francois_ips
    y1: 5.0
    x1: 0.0
    y2: 10
    x2: -4.5
  - name: entree_ips
    y1: 2.0
    x1: -5.0
    y2: 10.0
    x2: -7.0
  - name: cuisine_ips
    y1: 2.0
    x1: -7.0
    y2: 7
    x2: -12.0
  - name: salle_de_bain_ips
    y1: 7.0
    x1: -7.0
    y2: 10
    x2: -11.0
Appdeamon log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: AppDaemon 4
 Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
-----------------------------------------------------------
 Add-on version: 0.8.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 7.1  (aarch64 / raspberrypi3-64)
 Home Assistant Core: 2021.12.9
 Home Assistant Supervisor: 2021.12.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] appdaemon.sh: executing... 
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/aarch64/APKINDEX.tar.gz
(1/7) Installing libgfortran (10.3.1_git20211027-r0)
(2/7) Installing openblas (0.3.18-r1)
(3/7) Installing py3-numpy (1.21.4-r0)
(4/7) Installing pkgconf (1.8.0-r0)
(5/7) Installing python3-dev (3.9.7-r4)
(6/7) Installing py3-numpy-f2py (1.21.4-r0)
(7/7) Installing py3-scipy (1.7.2-r0)
Executing busybox-1.34.1-r3.trigger
OK: 236 MiB in 74 packages
[cont-init.d] appdaemon.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[21:12:30] INFO: Starting AppDaemon...
2022-01-24 21:12:37.925614 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-01-24 21:12:37.926970 INFO AppDaemon: Python version is 3.9.7
2022-01-24 21:12:37.928486 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2022-01-24 21:12:37.929853 INFO AppDaemon: Added log: AppDaemon
2022-01-24 21:12:37.931130 INFO AppDaemon: Added log: Error
2022-01-24 21:12:37.932509 INFO AppDaemon: Added log: Access
2022-01-24 21:12:37.933708 INFO AppDaemon: Added log: Diag
2022-01-24 21:12:38.159492 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-01-24 21:12:40.741537 INFO HASS: HASS Plugin Initializing
2022-01-24 21:12:40.742763 INFO HASS: HASS Plugin initialization complete
2022-01-24 21:12:40.744624 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin
2022-01-24 21:12:40.809581 INFO MQTT: MQTT Plugin Initializing
2022-01-24 21:12:40.814095 INFO MQTT: Using appdaemon_mqtt_client as Client ID
2022-01-24 21:12:40.818127 INFO AppDaemon: HTTP is disabled
2022-01-24 21:12:40.857639 INFO HASS: Connected to Home Assistant 2021.12.9
2022-01-24 21:12:40.999251 INFO MQTT: Connected to Broker at URL 192.168.1.200:1883
2022-01-24 21:12:41.011492 INFO AppDaemon: App 'ESPresenseIps' added
2022-01-24 21:12:41.017821 INFO AppDaemon: Found 1 total apps
2022-01-24 21:12:41.021765 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2022-01-24 21:12:41.032530 INFO AppDaemon: Got initial state from namespace mqtt
2022-01-24 21:12:41.035814 INFO MQTT: MQTT Plugin initialization complete
2022-01-24 21:12:41.148395 INFO HASS: Evaluating startup conditions
2022-01-24 21:12:41.151375 INFO HASS: Delaying startup for 30 seconds
2022-01-24 21:13:11.178533 INFO HASS: Startup condition met: hass state=RUNNING
2022-01-24 21:13:11.180431 INFO HASS: All startup conditions met
2022-01-24 21:13:11.257202 INFO AppDaemon: Got initial state from namespace default
2022-01-24 21:13:13.135582 INFO AppDaemon: Scheduler running in realtime
2022-01-24 21:13:13.147299 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2022-01-24 21:13:13.151242 INFO AppDaemon: App initialization complete

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024 1

I live in an apartment, I might not be able to help on that subject easily :/
I will gladly help if a can though, don't hesitate to ask if needed. I'm trying to implement this system with home assistant floorplan to be able to see my devices realtime in the apartment. I'm having trouble with "Unable to decode MQTT message" currently, but once its up and running, I'm all up for enhancing this nice plugin :)

from ad-espresense-ips.

KuotenoAshiato avatar KuotenoAshiato commented on May 29, 2024 1

for 'U', 'L', etc. shaped rooms, the current way of approacing this would be to break down the 'U' into three different rectangles and join the sides of those with the coordinates. Although those would be technically different rooms, as long as you're keeping the same name, a later run automation on the MQTT Topic should sense no difference.
Example:

 roomplans:
  - name: uroom #Base
    y1: 0.0
    x1: 0.0
    y2: 1.0
    x2: 4.0
  - name: uroom #Left
    y1: 1.0
    x1: 0.0
    y2: 5.0
    x2: 2.0
  - name: uroom #Right
    y1: 1.0
    x1: 3.0
    y2: 5.0
    x2: 4.0

from ad-espresense-ips.

duceduc avatar duceduc commented on May 29, 2024 1

Hello. I am not sure if I am doing this correctly. I still need to create the kitchen and bedrooms up top, but I cannot scroll beyond this screenshot.
2022-02-24_12-18-37

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

You give it the locations of your base stations and it tries to calculate where the tracker is in relation to those base stations. It could be overlayed on a floor plan so you could see where stuff is. Or you could tell if your inside your house, or outside.

from ad-espresense-ips.

michaeldvinci avatar michaeldvinci commented on May 29, 2024

Could you help explain what the third number in the plot coordinates is?

garage: [0, 8, 0.4]
office: [5, 1.5, 0.5]
family: [0, 0, 0]

How did you define the the .4, .5, and 0 as they are height/z, right?

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Yeah one thing I've noticed is because antennas work better when higher up, trilateration for height doesn't work well yet. I think trying to put all base stations at the same height would be better to start with.

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Hello, as answer to your comment mKeRix/room-assistant#842 (comment) I'm looking into this, but I'm not sure what to do with this app.
What's the out coming from this?

The idea is we can deduce the location even if there isn't a base station in that room. So you could put 4 devices on the four corners of your house and it can find where it must be based on the distances measured from the 4 points. In practice the more base stations the better, so i'd still have 6 or so, but we should be able to show the location +-1m in your house if it works.

from ad-espresense-ips.

Alfiegerner avatar Alfiegerner commented on May 29, 2024

Hi @DTTerastar , probably being a bit dense here but still not getting it.

So the base station locations are defined as per:

garage: [0, 8, 0.4]
office: [5, 1.5, 0.5]
family: [0, 0, 0]

How do define the perimeters of the rooms?

Any idea how you'd model an L shaped house? Thanks!

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

That's the coordinates of the base station only. I don't yet have any perimeters of rooms. That would be a later step once we get the positioning right. The code is really very dumb so far, all it does is trying and work out the most likely position by taking all fixes (distances to base stations) and base station locations and minimizing the total error based on a guess of where the device is. It outputs both the raw x,y,z as as well as a latt, long, and altitude. The latter is just the former plus the latt, long, and elevation specified in your appdaemon.yaml

from ad-espresense-ips.

Alfiegerner avatar Alfiegerner commented on May 29, 2024

Thanks makes sense now, I'll plug it in and have a play and let you know how I go.

from ad-espresense-ips.

Alfiegerner avatar Alfiegerner commented on May 29, 2024

Got it up and running, definitely lots of potential!

I found moving around the house would cause the 'holding' of old values, as we don't expire distances once we're out of range. I added a noddy timeout which helped a lot:


...
        dr["updated"] = time.time():
....
                if ("distance" in device["rooms"][r]) and (time.time() - device["rooms"][r]["updated"] < 10):
                    distance_to_stations.append(device["rooms"][r]["distance"])
                    stations_coordinates.append(device["rooms"][r]["pos"])

Something a bit more sophisticated like weighting the values might help but that's getting a bit outside my ken.

It would be nice to see which stations are currently 'fixed' to help debug - i'm a python novice and couldn't work out how to get the room name so gave up on that.

In terms of accurancy I can definitely see a case with this for adding that Android setting to specify tx power, I'll see if I can come back to that. I'm using room-assistant for base stations at the moment while I wait for some esp32s to arrive, and found that the ability to override transmission power increased accuracy a lot.

Thanks @DTTerastar for this, nice bit of work.

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Yeah, when I originally wrote it I didn't set the maxDistances very low so all nodes would send a value. It's annoying that you need maxDistances to make Home Assistant work right, but it kills this use case. That's part of why I send both room and devices. I want to make one the unfiltered view of all data, and the other is specifically for HA. Either that or just use the AppDaemon app to do the job of mqtt room since it doesn't really work all that well. Oh and if you're not using ESPresence you don't have the really nice kalman filtering, right?

from ad-espresense-ips.

Alfiegerner avatar Alfiegerner commented on May 29, 2024

I think last updated filtering instead of Max distance would be useful- what I saw without it was that old values would contaminate current position whether that testing was high or low. I have 10 base stations over a fairly large area so it's not unusual to walk out of range of a device while it's still reporting as 'close'.

Oh and room assistant uses Kalman filtering too, will be interesting to see how well the espsence and room assistant stations play together.

Would you happy with me doing a small PR to add an 'updatedWithin' property, defaulting to existing behaviour of not being used?

from ad-espresense-ips.

ee02217 avatar ee02217 commented on May 29, 2024

Should I see a new topic generated by this appdaemon?
How do I confirm this is working fine?

(Sorry for the probably dumb question)

from ad-espresense-ips.

ee02217 avatar ee02217 commented on May 29, 2024

It doesn't show up for me.
But I don't see any error in logs :(

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Can you post the redacted apps.yml?

from ad-espresense-ips.

ee02217 avatar ee02217 commented on May 29, 2024

Here you go.
I still dont have the 3rd base station, maybe that is the problem. But I expected some errors at least.

~/appdaemon$ more appdaemon.yaml

appdaemon:
  time_zone: Europe/Lisbon
  latitude: 38.XXXXXXX
  longitude: -9.YYYYYY
  elevation: 60
  plugins:
    HASS:
      type: hass
      ha_url: "http://192.168.1.XXX:8123"
      token: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      app_init_delay: 30
      appdaemon_startup_conditions:
        delay: 30
    MQTT:
      type: mqtt
      client_host: 192.168.1.XXX
      namespace: mqtt
      birth_topic: appdaemon
      will_topic: appdaemon

http:
  url: "http://192.168.1.XXX:5050"
admin:
api:
hadashboard:


logs:
  main_log:
    filename: /home/ee02217/appdaemon/logs/appdaemon.log
  access_log:
    filename: /home/ee02217/appdaemon/logs/access.log
  error_log:
    filename: /home/ee02217/appdaemon/logs/error.log
  diag_log:
    filename: /home/ee02217/appdaemon/logs/diag.log
    log_generations: 5
    log_size: 1024
    format: "{asctime} {levelname:<8} {appname:<10}: {message}"
  test_log:
    name: TestLog
    filename: /home/ee02217/appdaemon/logs/test.log

ee02217@NUC:~/appdaemon/apps$ more apps.yaml

ESPresenseIps:
  module: espresense-ips
  class: ESPresenseIps
  pluggins:
    - HASS
    - MQTT
  rooms:
    livingroom: [1, 0.5, 0]
    bedroom: [16, 3.5, 0]
  devices:
  - id: apple:ZZZZ:X-YY
    name: AppleWatch_Sergio
    timeout: 30
    away_timeout: 120

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Trilateration requires 3 to do be able to find the location. It really needs more like 4 or 5 to do a decent job with all of error present in rssi measurements.

from ad-espresense-ips.

ee02217 avatar ee02217 commented on May 29, 2024

Oh man... really sorry!
I just expected some error or something (this is my first adventure in the appdaemon)

Just a final confirmation, I read the above conversation, and I'll need to increase the Max Distance to the max?

from ad-espresense-ips.

ee02217 avatar ee02217 commented on May 29, 2024

Completely understand. And very keen to help you test this. Already ordered two more esp32 :)
Biggest problem where I’m from is that walls really mess up signals (concrete).
I already have my home 3D map ready for experiences :D

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Completely understand. And very keen to help you test this. Already ordered two more esp32 :) Biggest problem where I’m from is that walls really mess up signals (concrete). I already have my home 3D map ready for experiences :D

Sweet! I need the help!

from ad-espresense-ips.

dmccabe79 avatar dmccabe79 commented on May 29, 2024

OK, maybe I need another cup of coffee before I attempt to wrap my head around this. So we're plotting X,Y,Z coordinates, I got that. How do I determine what is correct? How do I figure X and Y? Z is height in meters, but the others?

from ad-espresense-ips.

ee02217 avatar ee02217 commented on May 29, 2024

Has anyone noticed the amount of RAM this is using to bee quite high?

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

OK, maybe I need another cup of coffee before I attempt to wrap my head around this. So we're plotting X,Y,Z coordinates, I got that. How do I determine what is correct? How do I figure X and Y? Z is height in meters, but the others?

X and Y are also meters. You gotta have a floor plan and measure where the base stations are in relation to each other.

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Has anyone noticed the amount of RAM this is using to bee quite high?

I haven't. Does it continuously increase like a memory leak?

from ad-espresense-ips.

dmccabe79 avatar dmccabe79 commented on May 29, 2024

OK, maybe I need another cup of coffee before I attempt to wrap my head around this. So we're plotting X,Y,Z coordinates, I got that. How do I determine what is correct? How do I figure X and Y? Z is height in meters, but the others?

X and Y are also meters. You gotta have a floor plan and measure where the base stations are in relation to each other.

Do you have a recommended means of doing this?

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

I estimated mine using a thing like this: https://amzn.to/3uDLcLl

Eventually i'd like to have some sort of gps attachment, or phone app to figure it out.

from ad-espresense-ips.

dmccabe79 avatar dmccabe79 commented on May 29, 2024

I could probably figure it out by just walking the area. X and Y might be tricky to calculate. Z is the easy one

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

from ad-espresense-ips.

dmccabe79 avatar dmccabe79 commented on May 29, 2024

If the distance is 5 meters... is that X? Then what is Y?

I don't understand what you mean by calculate. Just pick a corner, call
that 0,0 and measure the distance from there to the base station.

On Sat, Oct 2, 2021 at 8:14 PM dmccabe79 @.***> wrote:

I could probably figure it out by just walking the area. X and Y might be
tricky to calculate. Z is the easy one


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AALMBSPPMAHKGGZISK52WVLUE6N7RANCNFSM5EJXDUOQ
.

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

x is the distance off one wall, y is the distance off the other.

+------------------------------------+
|                              
|
|
|
|  <- x- >         *
|                       
|                  ^
|                  y 
|                  v
+------------------------------------+

from ad-espresense-ips.

dmccabe79 avatar dmccabe79 commented on May 29, 2024

Perfect. Thanks.

I work in aviation. XYZ coordinates are way different to me. Thanks for the explanation.

from ad-espresense-ips.

michaeldvinci avatar michaeldvinci commented on May 29, 2024

Has anyone noticed the amount of RAM this is using to bee quite high?

I haven't. Does it continuously increase like a memory leak?

Mine's finally up and running, and my Pi4 4GB went from ~8% CPU usage to ~50% with AppDaemon running. I'm going to let it go overnight and see if it mellows out

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Oh this does use a ton of CPU. The multilateration is a lot of math, and python is a pig. Atm it does it for every single measurement which probably isn't right either. It should take probably wait 15 seconds before recalcing... Except when moving quickly... Then is should be more like every couple seconds.

from ad-espresense-ips.

nmajin avatar nmajin commented on May 29, 2024

Couple questions...

  1. I know the room perimeter is still being worked out, but if I have all my ESP devices NOT in the center of the room, what should I put for values? I have 4 rooms and 4 devices I plan to setup
  2. Do we actually need to use this AppDaemon or could we setup each ESPresence with the measured "Maximum distance to report (in meters):" and use that instead?

Note: I have one ESPresense at the moment that I modified to 2 meters for one of my rooms and that works pretty good to determine if I am in that room or not

And bonus question...I assume that with multiple ESPresense capturing my watch (in this case) around the house (properly putting a device in all rooms) will update my watch to that room and only go into "not_home" when I am truly away from home? I am trying to use my watch as my main tracking device overall.

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Hearing you've forked this has made my day :) Thank you for helping! I've gotten a little burned out...

from ad-espresense-ips.

KuotenoAshiato avatar KuotenoAshiato commented on May 29, 2024

You're Welcome! I've searched for something like this for quite sometime. As soon as i get the time to measure the correct distances of each room, I'll try to improve the speed of the room recognition as with enough ESPs and a big enough room, the jitter of the coordinates shouldn't be that much of a Problem.

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Awesome! I got very disheartened when I realized "Areas" are not a concept AppDaemon supports or wants to support: AppDaemon/appdaemon#505

from ad-espresense-ips.

mjcumming avatar mjcumming commented on May 29, 2024

I think the right way to do this is by training, Place a selection of ESP32's around your home. The number would depend on levels and square footage. Then create a list of rooms. Take your BT device and walk around each room and train the system on expected readings for each room. This would be the most robust solution versus manually trying to solve by triangulating.

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Yes, I think that could also work very well. I think BOTH should be tried. Having the exact coordinates would be awesome on a floorplan to find stuff tho :)

from ad-espresense-ips.

gravyflex avatar gravyflex commented on May 29, 2024

Z is elevation in meters

On Sun, Sep 19, 2021 at 12:20 PM Michael Vinci @.***>
wrote:

Could you help explain what the third number in the plot coordinates is?

garage: [0, 8, 0.4]
office: [5, 1.5, 0.5]
family: [0, 0, 0]

How did you define the the .4, .5, and 0 as they are height/z, right?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#2 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AALMBSOCJM6YYBYZGNK36I3UCYETFANCNFSM5EJXDUOQ
.

I am a little confused with this. The elevation from the floor of the room to the height that the esp32 is at in meters?

Also, how do you account for the rooms in a multi story house? Would you need to do anything special?

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Basically since your "house" has a single elevation listed in hass and appdaemon, this z is just an offset from that elevation. If you put the elevation on your first floor, then make z 0 or the height off the floor. If you make the top of your house the elevation z's would all be negative. I picked the first method.

from ad-espresense-ips.

duceduc avatar duceduc commented on May 29, 2024

I am getting this error when from appdaemon.

error:
2022-01-24 10:08:47.723331 INFO MQTT: Unable to decode MQTT message

This is what I have in these files.
appdaemon.yaml

appdaemon:
  latitude: !secret home_latitude
  longitude: !secret home_longitude
  elevation: !secret home_elevation
  time_zone: Japan
  plugins:
    HASS:
      type: hass
      ha_url: http://192.168.1.20:8123
      token: !secret appdaemon_token
      namespace: default
    MQTT:
      type: mqtt
      client_host: 192.168.1.20
      namespace: mqtt
      birth_topic: appdaemon
      will_topic: appdaemon

http:
  url: http://127.0.0.1:5050
hadashboard:
admin:
api:

apps.yaml

ESPresenseIps:
  module: espresense-ips
  class: ESPresenseIps
  pluggins:
    - HASS
    - MQTT
  rooms:
    masterroom: [5, 4, 0.5]
    shionroom: [5, 4, 0.5]
    livingroom: [6, 10, 0.5]    
    kitchen: [3, 5, 0.5]
  devices:
  - id: roomAssistant:04ea2071-f457-46d3-97a1-xxxxx
    name: DucESPresense
    timeout: 30
    away_timeout: 120
  - id: roomAssistant:f7ae1827-e0c9-4900-b7e8-xxxx
    name: EriESPresense
    timeout: 30
    away_timeout: 120
  - id: apple:iphone7-1
    name: Shionisp
    timeout: 30
    away_timeout: 120

from ad-espresense-ips.

gravyflex avatar gravyflex commented on May 29, 2024

Does your MQTT server need auth?

from ad-espresense-ips.

duceduc avatar duceduc commented on May 29, 2024

You mean does it require a username/ password? Yes, it does.

from ad-espresense-ips.

gravyflex avatar gravyflex commented on May 29, 2024

Your appdaemon.yaml is missing client_user and client_password under MQTT if I am seeing correctly.

from ad-espresense-ips.

duceduc avatar duceduc commented on May 29, 2024

Yea, I just added these but still get same error. Do I need to restart HA since I added the ad-espresense-ips folder under apps folder?
edited: Restarted HA just just for the sake of it, but no go. Still same error.

MQTT:
  type: mqtt
  client_host: 192.168.1.20
  client_user: !secret mqtt_user
  client_password: !secret mqtt_pass
  namespace: mqtt
  birth_topic: appdaemon
  will_topic: appdaemon

error:

2022-01-24 10:32:17.009236 INFO ESPresenseIps: Subscribing to topic espresense/rooms/masterroom
2022-01-24 10:32:17.017121 INFO MQTT: Topic espresense/rooms/masterroom already unsubscribed from
2022-01-24 10:32:17.024626 INFO ESPresenseIps: Subscribing to topic espresense/rooms/shionroom
2022-01-24 10:32:17.026891 INFO MQTT: Topic espresense/rooms/shionroom already unsubscribed from
2022-01-24 10:32:17.035383 INFO ESPresenseIps: Subscribing to topic espresense/rooms/livingroom
2022-01-24 10:32:17.037914 INFO MQTT: Topic espresense/rooms/livingroom already unsubscribed from
2022-01-24 10:32:17.047197 INFO ESPresenseIps: Subscribing to topic espresense/rooms/kitchen
2022-01-24 10:32:17.049573 INFO MQTT: Topic espresense/rooms/kitchen already unsubscribed from
2022-01-24 10:32:17.058345 INFO AppDaemon: App initialization complete
2022-01-24 10:33:16.773583 INFO MQTT: Unable to decode MQTT message
2022-01-24 10:33:16.884486 INFO MQTT: Unable to decode MQTT message
2022-01-24 10:33:17.150575 INFO MQTT: Unable to decode MQTT message       

from ad-espresense-ips.

ASNNetworks avatar ASNNetworks commented on May 29, 2024

For some reason, this is not working for me. The app loads fine through AppDaemon, but there are no new topics. I have four ESP32's setup, each in a corner of my home. So I created a rectangle shape where the perimeter is defined by.

In MQTT Explorer I see 'appdeamon = online', so it should be connected just fine. Also no error logs regarding MQTT. But I don't see other new topics onder espresense.
NVIDIA_Share_USo4goVEUK

App is loaded fine:
NVIDIA_Share_wRmzo8LFuk

And this is my app.yaml code:

ESPresenseIps:
  module: espresense-ips
  class: ESPresenseIps
  pluggins:
    - HASS
    - MQTT
  rooms:
    woonkamer_i: [0, 0, 1]
    slaapkamer_i: [7.6, 0.5, 0]
    kantoor_i: [0, 11, 0.5]
    keuken_i: [7.3, 10.6, 2]
  devices:
  - id: "[REDACTED]"
    name: Fold2
    timeout: 5
    away_timeout: 60

I wish there is more information on how to actually use this appdaemon, how to troubleshoot and where to look for. I really want to use and test, but I have no idea what to do when looking at the minimal documentation.

Edit: to add, I have restarted AppDaemon, Home Assistant, MQTT multiple times, no difference.

from ad-espresense-ips.

eladore avatar eladore commented on May 29, 2024

I also try to get this system running with 10 esps but I cannot understand how the floor plan works in a multi level house as it just has x and y coordinates but no z coordinate. In this case I would need to put different rooms in the floor plan at the same coordinates. How should es presence know in which room I am…?

I understood that I can put z values for each base station but what about the floor plans?

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

Maybe having multiple floor plans and using the device z value, select the appropriate floor plan maybe ? I guess ESPs from downstairs will detect devices from top levels so we can’t rely on which ESPs triggered the detection.
But this solution might require some changes to the .py file :/

from ad-espresense-ips.

KuotenoAshiato avatar KuotenoAshiato commented on May 29, 2024

Yes, @stan69b is correct. I'll try some changes once I have the time for it.

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

Cleanest way i can think of right now would be changing the configuration yaml :

roomplans:
    floor_one
      - level: 0 //meters
      - name: salon_ips
        y1: 0.0
        x1: 0.0
        y2: 5.0
        x2: -5.0
   floor_two
     - level: 2.30 //meters
     - name: chambre
        y1: ...

(syntax might be wrong on the yaml above but you get the point I hope)

Then in the python side, checking the z index of device, take a margin of error, i guess we don't usually hold our devices to the ceiling so a device at 2.10 meters z should be on level_2 rather than level_1 and check the calculation with the matching floor.

On an other subject, how are y1, x1, y2, x2 used ?
like mesures in meter of all 4 sides ?

|------------------------|
|       x2               |
|                        |
| y1                 y2  |
|      x1                |
|________________________| 

?
and for un even "U" shaped room, this would mean making 2-3 separate rooms and matching them all to the same room in Home Assistant i suppose ?

Or could it be the 2 points of the diagonal of the room ?

                            y2
    |----------------------*| x2
    |                       |
    |                       |
    |                       |
y1|*________________________|
      x1                

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

Hey, I finally manage to get coordinates for some of my devices.

MacBook Pro and a currently unknown device works (yeah, I really don’t know what this device is, I need to put the coordinates on a plan to find it haha but I know it’s in my flat.)

iPhone, iPad and android tablet are detected when I log the ESP32s detected devices but won’t return any coordinates and are marked as unavailable in home assistant.

My apple watch, mi band 6 and apple tags are just not found. The mi band was detected once when I activated the discovery of the smart band but has been invisible ever since….

iPhone, iPad and android tablet were working prior to installing espresenseIps but I doubt it is related, the devices still show up on the ESP32 logs.

If anyone has any tips for any of those little hiccups, please do share :D
I Know iDevices are kind of a pain, but hopefully, having only one model of each in my home, I should me able to identify them with device models (until friends come over and wreak havoc in the house 😂)

from ad-espresense-ips.

eladore avatar eladore commented on May 29, 2024

Yes, it would be this version

   
                           y2
   |----------------------*| x2
   |                       |
   |                       |
   |                       |
 y1|*______________________|
       x1                

I think just adding the z parameter in my room_solve function should work, but it could be that a device gets misguided if to close to the roof of a room or a ground, depending also on which height the tracker is placed. I'll do some changes and would need another one to test this, as I currently neither have the tracker setup nor the house for such a test :/

I could help and test it but I am not very firm with custom flashing of the esp32. I just used the fantastic Browser Flasher...

But you are right with the thinking of the misguidance. The floor doesn't reduce the Bluetooth signal as much as I thought. Is feels nearly as if the ceiling isn't there =) Therefore I think we would need a lot of ESPs. I have 10, but currently just 4 installed for ESPresence. For a test I could install 5 in each floor. That should be enough or not?

from ad-espresense-ips.

KuotenoAshiato avatar KuotenoAshiato commented on May 29, 2024

I think that should be enough. In terms of firmware, theres no need for installing customs on the ESP, as this all is an analysis based on the default data the ESP sends into MQTT.

from ad-espresense-ips.

eladore avatar eladore commented on May 29, 2024

Oh perfect... then is just have to install the Ips Solver

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

Made a little tool to help in creating floorplans for this plugin. You can draw your floorplan in the browser and export the plan to a ESPresenseIPS compatible yaml code.
Other features are to come if all goes to plan.

https://github.com/stan69b/ESPresenseIPS-Floorplan-Creator

Feedback welcome, still a work in progress, started coding this 2 days ago.

from ad-espresense-ips.

KuotenoAshiato avatar KuotenoAshiato commented on May 29, 2024

Awesome, this will definitely make it easier for new people to get into this project!

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

Scrolling and zooming are not implemented yet, this is a very early stage of the application. Yoiucould try zooming out your browser page but it might cause probleme with mouse tracking. I'll try to put the priority on this feature. Maybe tonight depending on how the day goes. Try keeping an eye on the repo.

Also, I should mention this on the repo itself but the app was made for google chrome, I have not and will not test it on anything else. (I can see you have a scrollbar bottom right, but that should not be there haha i think a can fix this one though.).

And i guess you can put up issues directly in the project so we don't flood this one ;)

EDIT : I just pushed an update, you should be able to scroll on the canvas. it's using "mousewheel" event, i'm on a mac and scrolling in any direction on the trackpad moves the rectanges.

from ad-espresense-ips.

dvbit avatar dvbit commented on May 29, 2024

Would this work for multi floor workaround ; have a separate copy of the appdaemon app per floor? :-)

from ad-espresense-ips.

duceduc avatar duceduc commented on May 29, 2024

I am trying this again and it seems l may have succeeded with no errors this time, but I do not see anything happening in MQTT Explorer. No new entries. In appdaemon log, there isn't any errors.

Edit1: I forgot to include the roomplans settings. There is a warning about unicode string. That is all the errors I see and still no new entries in MQTT.

Edit2: Nevermind. It seems to be working now. I see 2 new entries in MQTTT. User forgot to install the ad-espresense-ips package in appdaemon. :P

@stan69b Thanks for the update. The scroll works now. Created the floorplan. Now, I need to figure out how this works.

2022-02-25 10:00:35.922379 WARNING AppDaemon: in "<unicode string>", line 238, column 13: y1: 500

2022-02-25_9-41-57

I have inputted this line in the appdaemon config:

init_commands:
  - apk add --update python3 python3-dev py3-numpy py3-scipy
python_packages: []
system_packages: []

appdaemon.yaml:

secrets: /config/secrets.yaml

appdaemon:
  latitude: !secret home_latitude
  longitude: !secret home_longitude
  elevation: !secret home_elevation
  time_zone: Japan
  plugins:
    HASS:
      type: hass
      ha_url: http://192.168.1.20:8123
      token: !secret appdaemon_token
      namespace: default

    MQTT:
      type: mqtt
      client_host: 192.168.1.20
      client_user: !secret mqtt_user
      client_password: !secret mqtt_pass
      namespace: mqtt
      birth_topic: appdaemon
      will_topic: appdaemon

      
http:
  url: http://127.0.0.1:5050
hadashboard:
admin:
api:

app.yaml

ESPresenseIps:
  module: espresense-ips
  class: ESPresenseIps
  pluggins:
    - HASS
    - MQTT
  rooms:
    shionroom: [4, 5, 0.5]
    masterroom: [4, 5, 0.5]
    kitchen: [5, 3, 0.5]
    livingroom: [5, 6, 0.5]
    computerroom: [4, 4, 0.5]
  devices:
  - id: apple:1007:11-12
    name: DucESPresense
    timeout: 420
    away_timeout: 600
  - id: apple:1005:9-24
    name: DuciWESPresense
    timeout: 420
    away_timeout: 600

  - id: apple:1006:10-12
    name: EriESPresense
    timeout: 420
    away_timeout: 600
  - id: apple:1005:9-26
    name: EriiWESPresense
    timeout: 420
    away_timeout: 600

  - id: apple:iphone7-1
    name: ispESPresense
    timeout: 420
    away_timeout: 600

  - id: apple:iphone7-2
    name: isESPresense
    timeout: 420
    away_timeout: 600
    
  - id: tile:ed5cc31a97c6
    name: tmsESPresense
    timeout: 420
    away_timeout: 600

  roomplans:
      - name: shionroom
          y1: 500 #  <--- warning about unicode string
          x1: 700
          y2: 0
          x2: 300
      - name: masterroom
          y1: 0
          x1: 700
          y2: 500
          x2: 300
      - name: kitchen
          y1: 500
          x1: 300
          y2: 0
          x2: 0
      - name: livingroom
          y1: 500
          x1: 0
          y2: 0
          x2: 600
      - name: computerroom
          y1: 0
          x1: 200
          y2: 400
          x2: 600

initial log output:

[services.d] starting services
[services.d] done.
[10:00:32] INFO: Starting AppDaemon...
2022-02-25 10:00:34.989506 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-02-25 10:00:34.990036 INFO AppDaemon: Python version is 3.9.7
2022-02-25 10:00:34.990506 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2022-02-25 10:00:34.991068 INFO AppDaemon: Added log: AppDaemon
2022-02-25 10:00:34.991516 INFO AppDaemon: Added log: Error
2022-02-25 10:00:34.991998 INFO AppDaemon: Added log: Access
2022-02-25 10:00:34.992493 INFO AppDaemon: Added log: Diag
2022-02-25 10:00:35.045767 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-02-25 10:00:35.587094 INFO HASS: HASS Plugin Initializing
2022-02-25 10:00:35.587550 INFO HASS: HASS Plugin initialization complete
2022-02-25 10:00:35.588537 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin
2022-02-25 10:00:35.605328 INFO MQTT: MQTT Plugin Initializing
2022-02-25 10:00:35.606885 INFO MQTT: Using appdaemon_mqtt_client as Client ID
2022-02-25 10:00:35.608511 INFO AppDaemon: Initializing HTTP
2022-02-25 10:00:35.609454 INFO AppDaemon: Using 'ws' for event stream
2022-02-25 10:00:35.618523 INFO AppDaemon: Starting API
2022-02-25 10:00:35.626197 INFO AppDaemon: Starting Admin Interface
2022-02-25 10:00:35.627252 INFO AppDaemon: Starting Dashboards
2022-02-25 10:00:35.655238 INFO HASS: Connected to Home Assistant 2022.2.6
2022-02-25 10:00:35.667356 INFO MQTT: Connected to Broker at URL 192.168.1.20:1883
2022-02-25 10:00:35.692906 INFO AppDaemon: Got initial state from namespace mqtt
2022-02-25 10:00:35.699080 INFO MQTT: MQTT Plugin initialization complete
2022-02-25 10:00:35.909642 INFO HASS: Evaluating startup conditions
2022-02-25 10:00:35.913968 WARNING AppDaemon: Error loading configuration
2022-02-25 10:00:35.921019 WARNING AppDaemon: parser says
2022-02-25 10:00:35.922379 WARNING AppDaemon: in "<unicode string>", line 238, column 13:
 y1: 500
 ^
2022-02-25 10:00:35.923858 WARNING AppDaemon: mapping values are not allowed here
2022-02-25 10:00:35.927549 INFO HASS: Startup condition met: hass state=RUNNING
2022-02-25 10:00:35.928741 INFO HASS: All startup conditions met
2022-02-25 10:00:35.934835 WARNING AppDaemon: File '/config/appdaemon/apps/apps.yaml' invalid structure - ignoring
2022-02-25 10:00:35.939162 INFO AppDaemon: Found 0 total apps
2022-02-25 10:00:35.940920 INFO AppDaemon: Starting Apps with 0 workers and 0 pins
2022-02-25 10:00:35.942574 INFO AppDaemon: Running on port 5050
2022-02-25 10:00:36.086677 INFO AppDaemon: Got initial state from namespace default
2022-02-25 10:00:38.039970 INFO AppDaemon: Scheduler running in realtime
2022-02-25 10:00:38.049067 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2022-02-25 10:00:38.050691 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx to module import path
2022-02-25 10:00:38.051984 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_devices to module import path
2022-02-25 10:00:38.053300 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core to module import path
2022-02-25 10:00:38.054546 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/action_type to module import path
2022-02-25 10:00:38.055791 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/stepper to module import path
2022-02-25 10:00:38.057275 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/integration to module import path
2022-02-25 10:00:38.058625 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/type to module import path
2022-02-25 10:00:38.060231 INFO AppDaemon: Adding /config/appdaemon/apps/controllerx/cx_core/feature_support to module import path
2022-02-25 10:00:38.142685 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_version.py - ignoring
2022-02-25 10:00:38.145364 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_const.py - ignoring
2022-02-25 10:00:38.147711 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/controllerx.py - ignoring
2022-02-25 10:00:38.150242 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/__init__.py - ignoring
2022-02-25 10:00:38.152595 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/rgb_genie.py - ignoring
2022-02-25 10:00:38.155558 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/smartthings.py - ignoring
2022-02-25 10:00:38.158762 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/trust.py - ignoring
2022-02-25 10:00:38.161937 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/sonoff.py - ignoring
2022-02-25 10:00:38.164545 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/aqara.py - ignoring
2022-02-25 10:00:38.167787 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/ikea.py - ignoring
2022-02-25 10:00:38.170538 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/aurora.py - ignoring
2022-02-25 10:00:38.173856 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/livarno.py - ignoring
2022-02-25 10:00:38.176693 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/lutron.py - ignoring
2022-02-25 10:00:38.180001 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/tuya.py - ignoring
2022-02-25 10:00:38.182904 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/terncy.py - ignoring
2022-02-25 10:00:38.186244 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/phillips.py - ignoring
2022-02-25 10:00:38.188898 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/osram.py - ignoring
2022-02-25 10:00:38.191911 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/muller_licht.py - ignoring
2022-02-25 10:00:38.194621 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_devices/legrand.py - ignoring
2022-02-25 10:00:38.197958 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/controller.py - ignoring
2022-02-25 10:00:38.200740 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/__init__.py - ignoring
2022-02-25 10:00:38.204028 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/custom_controller.py - ignoring
2022-02-25 10:00:38.207053 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type_controller.py - ignoring
2022-02-25 10:00:38.210183 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/release_hold_controller.py - ignoring
2022-02-25 10:00:38.213126 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/color_helper.py - ignoring
2022-02-25 10:00:38.216222 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/action_type/__init__.py - ignoring
2022-02-25 10:00:38.219264 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/action_type/delay_action_type.py - ignoring
2022-02-25 10:00:38.222602 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/action_type/predefined_action_type.py - ignoring
2022-02-25 10:00:38.225784 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/action_type/scene_action_type.py - ignoring
2022-02-25 10:00:38.229009 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/action_type/call_service_action_type.py - ignoring
2022-02-25 10:00:38.232102 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/action_type/base.py - ignoring
2022-02-25 10:00:38.235841 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/stepper/__init__.py - ignoring
2022-02-25 10:00:38.238807 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/stepper/circular_stepper.py - ignoring
2022-02-25 10:00:38.241952 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/stepper/minmax_stepper.py - ignoring
2022-02-25 10:00:38.244672 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/__init__.py - ignoring
2022-02-25 10:00:38.247855 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/lutron_caseta.py - ignoring
2022-02-25 10:00:38.250733 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/z2m.py - ignoring
2022-02-25 10:00:38.253929 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/state.py - ignoring
2022-02-25 10:00:38.256896 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/mqtt.py - ignoring
2022-02-25 10:00:38.260142 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/deconz.py - ignoring
2022-02-25 10:00:38.262725 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/integration/zha.py - ignoring
2022-02-25 10:00:38.265888 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/__init__.py - ignoring
2022-02-25 10:00:38.268449 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/media_player_controller.py - ignoring
2022-02-25 10:00:38.271498 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/switch_controller.py - ignoring
2022-02-25 10:00:38.274085 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/light_controller.py - ignoring
2022-02-25 10:00:38.277282 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/type/cover_controller.py - ignoring
2022-02-25 10:00:38.279910 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/__init__.py - ignoring
2022-02-25 10:00:38.282898 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/cover.py - ignoring
2022-02-25 10:00:38.285625 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/media_player.py - ignoring
2022-02-25 10:00:38.288706 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/controllerx/cx_core/feature_support/light.py - ignoring
2022-02-25 10:00:38.291203 INFO AppDaemon: App initialization complete

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

I have this in my configuration as well, I think it helps in making IPS and Location apear in the mqtt messages
see: client_topic

    MQTT:
      type: mqtt
      client_host: 192.168.1.6
      namespace: mqtt
      client_user: *****
      client_password:  *****
      birth_topic: appdaemon
      will_topic: appdaemon
      client_topics:
        - appdaemon/#

the y1: 500 error seems to crash the app loading and AppDaemon says 0 apps are loaded. if you copy pasted some code, delete it and rewrite it. some invisible char might cause trouble

from ad-espresense-ips.

duceduc avatar duceduc commented on May 29, 2024

I think I got it working. I see 2 new entries in mqtt. But in ips topic, all my devices show currentroom: none. I think the roomplans numbers aren’t correct. I may not have set it up correctly there.

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

I had a bug in the floorplan creator, mesures were not in the right unit.... if you used my app, sorry about that. it has been fixed. in IPS topic, I don't have any room info, i just have some x,y and z coordinates. (so I don't think I understood correctly "But in ips topic, all my devices show currentroom: none" )

Screenshot 2022-02-26 at 08 50 25

from ad-espresense-ips.

duceduc avatar duceduc commented on May 29, 2024

At one point, I did saw a change to currentroom: computerroom, but most of the time. It stays at none. I have tried your updated code yet.
2022-02-26_16-56-30

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

mesures were in cm in the app export and not meters... i would think you would always be in the same room though given rooms were 100x larger :/ Weird thing is, I do not have "currentroom" in this message ...... I'll check this out today.

from ad-espresense-ips.

duceduc avatar duceduc commented on May 29, 2024

Open the mqtt explorer in full.. It's hidden most likely.

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

Screenshot 2022-02-26 at 09 10 27

Doubled check, but it's does not seem to be part of the json object.
My floorplan might be wrong, I'm juste now creating it with the app. I'll check this out after trying the new plan out :)

EDIT: Version i had of the python script seemed to be outdated (I took it from the release page initially. the one on the repo is more recent) . I have the currentRoom now.

from ad-espresense-ips.

duceduc avatar duceduc commented on May 29, 2024

Is it showing the correct rooms for your for currentroom?

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

Mostly with the macbook and the apple watch. AirTag is completely off. but the currentRoom is right based on the coordinates of the Airtag i think it is just mislocated. You can take the latest version of the Floorplan creator, you can attatch your broker to it and see your devices in real time. make sure the position on the floor plan matches the currentRoom.

if you have used the floorplan creator before, make a backup of your localstorage before updating to the new version. just in case ;)

from ad-espresense-ips.

duceduc avatar duceduc commented on May 29, 2024

if you have used the floorplan creator before, make a backup of your localstorage before updating to the new version. just in case ;)

too late. need to redo again.

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

Arg, sorry about that. made a mistake and lost mine way before the latest version. I have a yaml to json if you want t try. see readme "deleted local storage section"

from ad-espresense-ips.

duceduc avatar duceduc commented on May 29, 2024

I've tried, but when I paste the yam code, nothing appears in the json box and the save button does nothing. The formatting and spacing should be correct as per your sample. May need to redo.

I am on a Windows pc. Where is the backup localstorage file?

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

yeah, it is peaky. the json code should appear after pasting yaml, save will put it in the localstorage.
you can open the inspector on your browser and debug the error. make the appropriate changes in the converter. or try to match my sample :) if you need to discuss this more, open an issue on the actual project if you don't mind :)

from ad-espresense-ips.

Franz37 avatar Franz37 commented on May 29, 2024

Anyone get it working ?

I have followed every steps and but still not able to see the ips topic in my mqtt broker and wondering if it can come from this:

In the app daemon, under "apps", the EspresensIps status is terminated.
status

The pluging HASS and MQTT seems active
plugin

and below my configs:

appdaemon option:

init_commands:

  • apk add --update python3 python3-dev py3-numpy py3-scipy
    python_packages: []
    system_packages: []

appdaemon.yaml

secrets: /config/secrets.yaml

appdaemon:
  time_zone: !secret time_zone
  latitude: !secret latitude
  longitude: !secret longitude
  elevation: !secret elevation
  production_mode: False
  plugins:
    HASS:
      type: hass
      ha_url: !secret url_home_assistant
      token: !secret hass_token
      namespace: default
      app_init_delay: 30
      appdaemon_startup_conditions:
        delay: 30
    MQTT:
      type: mqtt
      client_host: 192.168.1.200
      client_user: !secret mqtt_user
      client_password: !secret mqtt_pass
      namespace: mqtt
      birth_topic: appdaemon
      will_topic: appdaemon
      client_topics:
        - appdaemon/#

http:
  url: http://192.168.1.200:5050
admin:
api:
hadashboard:

apps.yaml: where I spread 5 base station through the house.

ESPresenseIps:
  module: espresense-ips
  class: ESPresenseIps
  pluggins:
    - HASS
    - MQTT
  devices:
    - id: iBeacon:426c7565-4368-6172-6d42-6561636f6e73-3838-4949
      name: 'Bluecharm 1_ips'
      timeout: 60
      away_timeout: 300
  rooms:
      Salon: [0.010078125,5.285,0]
      Hall: [4.180078125,7.105,0]
      Bureau: [7.030078125,4.625,0]
      Buanderie: [10.620078125,6.995,0]
      Garage: [13.630078125,1.565,0]
  roomplans:
      - name: Salon
        y1: 3.94
        x1: 0
        y2: 6.3
        x2: 3.12
      - name: Chambre Francois
        y1: 6.3
        x1: 0
        y2: 8.72
        x2: 2.61
      - name: Entree
        y1: 3.94
        x1: 3.12
        y2: 6.29
        x2: 4.31
      - name: Cuisine
        y1: 3.94
        x1: 4.31
        y2: 7.17
        x2: 6.98
      - name: Hall
        y1: 6.3
        x1: 2.61
        y2: 8.74
        x2: 4.31
      - name: Salle de bain 2
        y1: 7.17
        x1: 4.31
        y2: 8.74
        x2: 6.26
      - name: Bureau
        y1: 3.94
        x1: 6.98
        y2: 6.33
        x2: 8.5
      - name: Chambre 1
        y1: 3.94
        x1: 8.5
        y2: 6.33
        x2: 10.76
      - name: Couloir
        y1: 6.33
        x1: 6.99
        y2: 7.18
        x2: 9.63
      - name: Buanderie
        y1: 6.33
        x1: 9.63
        y2: 7.18
        x2: 10.76
      - name: Salle de bain 1
        y1: 7.18
        x1: 6.26
        y2: 8.74
        x2: 8.875078125
      - name: Chambre 3
        y1: 7.17
        x1: 8.87
        y2: 8.74
        x2: 10.76
      - name: Garage
        y1: 0
        x1: 9.51
        y2: 2.88
        x2: 13.775078125

and below the log from the addon:

AppDaemon
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh

Add-on: AppDaemon
Python Apps and Dashboard using AppDaemon 4.x for Home Assistant

Add-on version: 0.9.2
You are running the latest version of this add-on.
System: Home Assistant OS 8.4 (aarch64 / raspberrypi4-64)
Home Assistant Core: 2022.8.1
Home Assistant Supervisor: 2022.07.0

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/appdaemon.sh
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/aarch64/APKINDEX.tar.gz
(1/7) Installing libgfortran (11.2.1_git20220219-r2)
(2/7) Installing openblas (0.3.20-r0)
(3/7) Installing py3-numpy (1.22.3-r0)
(4/7) Installing pkgconf (1.8.0-r0)
(5/7) Installing python3-dev (3.10.5-r0)
(6/7) Installing py3-numpy-f2py (1.22.3-r0)
(7/7) Installing py3-scipy (1.7.2-r1)
Executing busybox-1.35.0-r13.trigger
OK: 230 MiB in 56 packages
cont-init: info: /etc/cont-init.d/appdaemon.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun appdaemon (no readiness notification)
s6-rc: info: service legacy-services successfully started
[15:25:18] INFO: Starting AppDaemon...
2022-08-05 15:25:27.920088 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-08-05 15:25:27.921065 INFO AppDaemon: Python version is 3.10.5
2022-08-05 15:25:27.921673 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2022-08-05 15:25:27.922204 INFO AppDaemon: Added log: AppDaemon
2022-08-05 15:25:27.922665 INFO AppDaemon: Added log: Error
2022-08-05 15:25:27.923025 INFO AppDaemon: Added log: Access
2022-08-05 15:25:27.923455 INFO AppDaemon: Added log: Diag
2022-08-05 15:25:28.286189 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-08-05 15:25:29.082988 INFO HASS: HASS Plugin Initializing
2022-08-05 15:25:29.083454 INFO HASS: HASS Plugin initialization complete
2022-08-05 15:25:29.084271 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin
2022-08-05 15:25:29.274228 INFO MQTT: MQTT Plugin Initializing
2022-08-05 15:25:29.275942 INFO MQTT: Using appdaemon_mqtt_client as Client ID
2022-08-05 15:25:29.277520 INFO AppDaemon: Initializing HTTP
2022-08-05 15:25:29.278438 INFO AppDaemon: Using 'ws' for event stream
2022-08-05 15:25:29.288250 INFO AppDaemon: Starting API
2022-08-05 15:25:29.297203 INFO AppDaemon: Starting Admin Interface
2022-08-05 15:25:29.298159 INFO AppDaemon: Starting Dashboards
2022-08-05 15:25:29.328926 INFO HASS: Connected to Home Assistant 2022.8.1
2022-08-05 15:25:29.465588 INFO HASS: Evaluating startup conditions
2022-08-05 15:25:29.467657 INFO HASS: Delaying startup for 30 seconds
2022-08-05 15:25:29.469893 WARNING AppDaemon: App 'rooms' missing 'class' or 'module' entry - ignoring
2022-08-05 15:25:29.470556 WARNING AppDaemon: App 'roomplans' missing 'class' or 'module' entry - ignoring
2022-08-05 15:25:29.474505 INFO AppDaemon: App 'ESPresenseIps' added
2022-08-05 15:25:29.475382 INFO AppDaemon: Found 1 total apps
2022-08-05 15:25:29.476698 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2022-08-05 15:25:29.478569 INFO AppDaemon: Running on port 5050
2022-08-05 15:25:29.844434 INFO MQTT: Connected to Broker at URL 192.168.1.200:1883
2022-08-05 15:25:30.332835 INFO AppDaemon: Got initial state from namespace mqtt
2022-08-05 15:25:30.333675 INFO MQTT: MQTT Plugin initialization complete
2022-08-05 15:25:35.114935 INFO AppDaemon: New client Admin Client connected
2022-08-05 15:25:59.485737 INFO HASS: Startup condition met: hass state=RUNNING
2022-08-05 15:25:59.488876 INFO HASS: All startup conditions met
2022-08-05 15:25:59.530106 INFO AppDaemon: Got initial state from namespace default
2022-08-05 15:26:01.541226 INFO AppDaemon: Scheduler running in realtime
2022-08-05 15:26:01.559512 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2022-08-05 15:26:01.561386 INFO AppDaemon: App initialization complete

It looks like I have a problem in my MQTT broker, and found this in the log:

1659708766: New connection from 172.30.32.1:50562 on port 1883.
error: received null username or password for unpwd check

Maybe here is the problem and appdaemon doesnt pass the username and password well

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

The IPS plugin is an add-on to espresence base system. It seems that espresence is running, but ips is not. I believe that the new home assistant version does not support older version of python (2.7 amd even older 3.x i think) and maybe there is a compatibility issue with latest update. Do you have any logs relative to the "terminated" status ? Any exception or crash that could help us point you in the right direction ?

from ad-espresense-ips.

Franz37 avatar Franz37 commented on May 29, 2024

Now it looks like that the app EspresenseIPS appear as: "Loaded" in appdaemon for now 35 min. Is it the status that we want ?

Here is the last log I have,

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh

Add-on: AppDaemon
Python Apps and Dashboard using AppDaemon 4.x for Home Assistant

Add-on version: 0.9.2
You are running the latest version of this add-on.
System: Home Assistant OS 8.4 (aarch64 / raspberrypi4-64)
Home Assistant Core: 2022.8.1
Home Assistant Supervisor: 2022.07.0

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/appdaemon.sh
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/aarch64/APKINDEX.tar.gz
(1/7) Installing libgfortran (11.2.1_git20220219-r2)
(2/7) Installing openblas (0.3.20-r0)
(3/7) Installing py3-numpy (1.22.3-r0)
(4/7) Installing pkgconf (1.8.0-r0)
(5/7) Installing python3-dev (3.10.5-r0)
(6/7) Installing py3-numpy-f2py (1.22.3-r0)
(7/7) Installing py3-scipy (1.7.2-r1)
Executing busybox-1.35.0-r13.trigger
OK: 230 MiB in 56 packages
cont-init: info: /etc/cont-init.d/appdaemon.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun appdaemon (no readiness notification)
s6-rc: info: service legacy-services successfully started
[19:50:48] INFO: Starting AppDaemon...
2022-08-05 19:50:57.312796 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-08-05 19:50:57.313260 INFO AppDaemon: Python version is 3.10.5
2022-08-05 19:50:57.313648 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2022-08-05 19:50:57.314033 INFO AppDaemon: Added log: AppDaemon
2022-08-05 19:50:57.314439 INFO AppDaemon: Added log: Error
2022-08-05 19:50:57.314973 INFO AppDaemon: Added log: Access
2022-08-05 19:50:57.315373 INFO AppDaemon: Added log: Diag
2022-08-05 19:50:57.676226 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-08-05 19:50:58.475982 INFO HASS: HASS Plugin Initializing
2022-08-05 19:50:58.476439 INFO HASS: HASS Plugin initialization complete
2022-08-05 19:50:58.477099 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin
2022-08-05 19:50:58.670471 INFO MQTT: MQTT Plugin Initializing
2022-08-05 19:50:58.672105 INFO MQTT: Using appdaemon_mqtt_client as Client ID
2022-08-05 19:50:58.673545 INFO AppDaemon: Initializing HTTP
2022-08-05 19:50:58.674497 INFO AppDaemon: Using 'ws' for event stream
2022-08-05 19:50:58.684128 INFO AppDaemon: Starting API
2022-08-05 19:50:58.693151 INFO AppDaemon: Starting Admin Interface
2022-08-05 19:50:58.694074 INFO AppDaemon: Starting Dashboards
2022-08-05 19:50:58.724719 INFO HASS: Connected to Home Assistant 2022.8.1
2022-08-05 19:50:58.861324 INFO HASS: Evaluating startup conditions
2022-08-05 19:50:58.863495 INFO HASS: Delaying startup for 30 seconds
2022-08-05 19:50:58.866879 INFO AppDaemon: App 'ESPresenseIps' added
2022-08-05 19:50:58.867806 INFO AppDaemon: Found 1 total apps
2022-08-05 19:50:58.869340 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2022-08-05 19:50:58.871692 INFO AppDaemon: Running on port 5050
2022-08-05 19:50:59.223032 INFO MQTT: Connected to Broker at URL 192.168.1.200:1883
2022-08-05 19:50:59.730246 INFO AppDaemon: Got initial state from namespace mqtt
2022-08-05 19:50:59.732739 INFO MQTT: MQTT Plugin initialization complete
2022-08-05 19:51:27.454720 INFO AppDaemon: New client Admin Client connected
2022-08-05 19:51:28.882444 INFO HASS: Startup condition met: hass state=RUNNING
2022-08-05 19:51:28.883227 INFO HASS: All startup conditions met
2022-08-05 19:51:28.932807 INFO AppDaemon: Got initial state from namespace default
2022-08-05 19:51:30.944393 INFO AppDaemon: Scheduler running in realtime
2022-08-05 19:51:30.965769 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2022-08-05 19:51:30.967047 INFO AppDaemon: App initialization complete

And there is a successfull connection log in my broker:

1659721152: New connection from 172.30.32.1:33710 on port 1883.
1659721152: New client connected from 172.30.32.1:33710 as appdaemon_mqtt_client (p2, c1, k60, u'mqttuser').

This as been runing for 35min like this and no crash noticed but still no "IPS" topic when looking in the mqtt explorer.

from ad-espresense-ips.

rfortunatov avatar rfortunatov commented on May 29, 2024

Now it looks like that the app EspresenseIPS appear as: "Loaded" in appdaemon for now 35 min. Is it the status that we want ?

Here is the last log I have,

s6-rc: info: service s6rc-oneshot-runner: starting

s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh

Add-on: AppDaemon

Python Apps and Dashboard using AppDaemon 4.x for Home Assistant

Add-on version: 0.9.2

You are running the latest version of this add-on.
System: Home Assistant OS 8.4 (aarch64 / raspberrypi4-64)
Home Assistant Core: 2022.8.1
Home Assistant Supervisor: 2022.07.0

Please, share the above information when looking for help

or support in, e.g., GitHub, forums or the Discord chat.
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0 cont-init: info: running /etc/cont-init.d/01-log-level.sh cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0 cont-init: info: running /etc/cont-init.d/appdaemon.sh fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/aarch64/APKINDEX.tar.gz fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/aarch64/APKINDEX.tar.gz (1/7) Installing libgfortran (11.2.1_git20220219-r2) (2/7) Installing openblas (0.3.20-r0) (3/7) Installing py3-numpy (1.22.3-r0) (4/7) Installing pkgconf (1.8.0-r0) (5/7) Installing python3-dev (3.10.5-r0) (6/7) Installing py3-numpy-f2py (1.22.3-r0) (7/7) Installing py3-scipy (1.7.2-r1) Executing busybox-1.35.0-r13.trigger OK: 230 MiB in 56 packages cont-init: info: /etc/cont-init.d/appdaemon.sh exited 0 s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting services-up: info: copying legacy longrun appdaemon (no readiness notification) s6-rc: info: service legacy-services successfully started [19:50:48] INFO: Starting AppDaemon... 2022-08-05 19:50:57.312796 INFO AppDaemon: AppDaemon Version 4.2.1 starting 2022-08-05 19:50:57.313260 INFO AppDaemon: Python version is 3.10.5 2022-08-05 19:50:57.313648 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml 2022-08-05 19:50:57.314033 INFO AppDaemon: Added log: AppDaemon 2022-08-05 19:50:57.314439 INFO AppDaemon: Added log: Error 2022-08-05 19:50:57.314973 INFO AppDaemon: Added log: Access 2022-08-05 19:50:57.315373 INFO AppDaemon: Added log: Diag 2022-08-05 19:50:57.676226 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin 2022-08-05 19:50:58.475982 INFO HASS: HASS Plugin Initializing 2022-08-05 19:50:58.476439 INFO HASS: HASS Plugin initialization complete 2022-08-05 19:50:58.477099 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin 2022-08-05 19:50:58.670471 INFO MQTT: MQTT Plugin Initializing 2022-08-05 19:50:58.672105 INFO MQTT: Using appdaemon_mqtt_client as Client ID 2022-08-05 19:50:58.673545 INFO AppDaemon: Initializing HTTP 2022-08-05 19:50:58.674497 INFO AppDaemon: Using 'ws' for event stream 2022-08-05 19:50:58.684128 INFO AppDaemon: Starting API 2022-08-05 19:50:58.693151 INFO AppDaemon: Starting Admin Interface 2022-08-05 19:50:58.694074 INFO AppDaemon: Starting Dashboards 2022-08-05 19:50:58.724719 INFO HASS: Connected to Home Assistant 2022.8.1 2022-08-05 19:50:58.861324 INFO HASS: Evaluating startup conditions 2022-08-05 19:50:58.863495 INFO HASS: Delaying startup for 30 seconds 2022-08-05 19:50:58.866879 INFO AppDaemon: App 'ESPresenseIps' added 2022-08-05 19:50:58.867806 INFO AppDaemon: Found 1 total apps 2022-08-05 19:50:58.869340 INFO AppDaemon: Starting Apps with 1 workers and 1 pins 2022-08-05 19:50:58.871692 INFO AppDaemon: Running on port 5050 2022-08-05 19:50:59.223032 INFO MQTT: Connected to Broker at URL 192.168.1.200:1883 2022-08-05 19:50:59.730246 INFO AppDaemon: Got initial state from namespace mqtt 2022-08-05 19:50:59.732739 INFO MQTT: MQTT Plugin initialization complete 2022-08-05 19:51:27.454720 INFO AppDaemon: New client Admin Client connected 2022-08-05 19:51:28.882444 INFO HASS: Startup condition met: hass state=RUNNING 2022-08-05 19:51:28.883227 INFO HASS: All startup conditions met 2022-08-05 19:51:28.932807 INFO AppDaemon: Got initial state from namespace default 2022-08-05 19:51:30.944393 INFO AppDaemon: Scheduler running in realtime 2022-08-05 19:51:30.965769 INFO AppDaemon: Adding /config/appdaemon/apps to module import path 2022-08-05 19:51:30.967047 INFO AppDaemon: App initialization complete

And there is a successfull connection log in my broker:

1659721152: New connection from 172.30.32.1:33710 on port 1883. 1659721152: New client connected from 172.30.32.1:33710 as appdaemon_mqtt_client (p2, c1, k60, u'mqttuser').

This as been runing for 35min like this and no crash noticed but still no "IPS" topic when looking in the mqtt explorer.

you have to add python script from repository to you app daemon apps folder so that you configuration folder looks something like

/home/roman/appdaemon/:
--apps/
----apps.yaml
----espresense-ips.py
----requirements.txt
--appdaemon.yaml
--system_packages.txt

Also, don't forget to install required packages at least if you're running on Docker.
system_packages.txt file in config root should contain:

musl
libcurl
curl-dev
gcc
g++
python3
python3-dev
py3-numpy
py3-scipy
gfortran
openblas
openblas-dev
make

requirements.txt in apps folder should contain

scipy
numpy

I've managed to get it running on docker appdaemon, though positioning is not as good as I expected. While having distance to one of base stations less then 1m I still get overall position outside of 1m circle of that base station. Maybe you'll get better results. Cheers.

from ad-espresense-ips.

Franz37 avatar Franz37 commented on May 29, 2024

Thanks, It seems to work with your tips but for some reason sometime it doesn't work for a long time and it appears again without any changes. I don't know what can be the problem. As for now, it works

I have to fine tune the roomplans and the positionning of the base station but seems to work so far. Speed is not as fast as the base station itself.

Let's see.

from ad-espresense-ips.

rfortunatov avatar rfortunatov commented on May 29, 2024

Thanks, It seems to work with your tips but for some reason sometime it doesn't work for a long time and it appears again without any changes. I don't know what can be the problem. As for now, it works

I have to fine tune the roomplans and the positionning of the base station but seems to work so far. Speed is not as fast as the base station itself.

Let's see.

As of now my latest findings are that ESPresense base stations has some kind of smoothing algorithm that changes the distance from base station way slower that rssi changes. In addition this particular application uses generic approximation algorithm that attempts to solve position based on distance from base stations, though as far as I see in case we have e.g. 3 base stations with distances 4.5, 3.7, 4.0 and 1 base station with distance 1.0 the algorithm positions you not in 1.0 circle of 4th station, but somewhere very close to first three stations. So I assume there's some weighting involved. In addition ESPresense base stations do not transmit distances less than 1m which makes navigation harder. As of now I stick to using just ESPresense without IPs add-on while trying to get this working

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

I'm really not good at python so i'm going to try implementing this in dotnet via NetDaemon. This is a starting point for someone else who is doing it: https://github.com/rumbu13/NetDaemonR/blob/0ab69420d6f92d73d15b02e52a830499d10b81f3/NetDaemonApps/Automations/PresenceApp/BleDeviceHandler.cs

from ad-espresense-ips.

rfortunatov avatar rfortunatov commented on May 29, 2024

what a coincidence, I'm a net dev too. Will take a look at your code later when I'm done with my work

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

:nudge: @rfortunatov

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

I tried master and I did eventually get some pretty pictures
image
I'm going to work on it a bit and release it

from ad-espresense-ips.

theculby5 avatar theculby5 commented on May 29, 2024

OK, I hate to go back to the basics. I'm getting errors in the setup of the AppDaemon and MQTT.
In MQTT Logs:

2022-09-11 21:49:25: Client disconnected, not authorised.
2022-09-11 21:49:41: New connection from 172.30.32.1:34712 on port 1883.
error: received null username or password for unpwd check

In AppDaemon Logs:

2022-09-11 21:47:34.130918 CRITICAL MQTT: MQTT Client Disconnected Abruptly. Will attempt reconnection
2022-09-11 21:47:34.481700 CRITICAL MQTT: Could not complete MQTT Plugin initialization, trying again in 5 seconds
2022-09-11 21:47:44.489963 CRITICAL MQTT: Could not Complete Connection to Broker, please Ensure Broker at URL 192.168.1.140:1883 is correct and broker is not down and restart Appdaemon
2022-09-11 21:47:45.144120 CRITICAL MQTT: Could not complete MQTT Plugin initialization, trying again in 5 seconds
2022-09-11 21:47:50.154871 CRITICAL MQTT: Could not complete MQTT Plugin initialization, for Connection was refused due to Not Authorised

In AppDaemon.Yaml

appdaemon:
time_zone: America/New_York
latitude: 34.xxxxxxxxx
longitude: -84.xxxxxxxx
elevation: xxxxx
plugins:
HASS:
type: hass
ha_url: http://192.168.1.140:8123
token: "xxxxxxxxxxxxxx"
namespace: default
app_init_delay: 30
appdaemon_startup_conditions:
delay: 30
MQTT:
type: mqtt
client_host: 192.168.1.140
namespace: mqtt
birth_topic: appdaemon
will_topic: appdaemon
client_user: xxxxxxxxxxxxx
client_pass: xxxxxxxxxxxxx
client_topics:
- appdeamon/#

In MQTT Config:

ESPresenseIps:
module: espresense-ips
class: ESPresenseIps
pluggins:
- HASS
- MQTT
draw_interval: 3

rooms:
angelaoffice: [1, 4.33, 3.2]
office: [1.524, 3.6576, 3.2]
family: [0, 3.81, 0.4572]
kitchen: [3.9624, 1.2192, 1.2192]
dining: [0, 3.6576, 0.4572]
masterbed: [4.8768, 4.8768, 3.2]
masterbath: [3.2004, 3.81, 3.3]
graceroom: [3.5052, 1.524, 3.2]
livingroom: [3.9624, 1.2192, 0.4572]

devices:

  • id: iBeacon:xxxxxxxxxxxxxxxxxxxxx-1
    name: Angela Phone
    timeout: 30
    away_timeout: 120
  • id: iBeaconxxxxxxxxxxxxxxxxxxxxxxxx-1
    name: Lawrnece Phone
    timeout: 30
    away_timeout: 120
  • id: apple:xxxxxxxxxxxxx
    name: Grace iPhone
    timeout: 30
    away_timeout: 120

roomplans:

  • name: Living Room
    y1: 0.0
    x1: 0.0
    y2: 7.0
    x2: 6.0
  • name: Family Room
    y1: 7.0
    x1: 0.0
    y2: 10.0
    x2: 2.0
  • name: Master Bath
    y1: 7.0
    x1: 2.0
    y2: 10.0
    x2: 6.0
  • name: Kitchen
    y1: 10.0
    x1: 0.0
    y2: 13.5
    x2: 5.0
  • name: Office
    y1: 10.0
    x1: 0.0
    y2: 13.5
    x2: 5.0
  • name: Dining
    y1: 10.0
    x1: 0.0
    y2: 13.5
    x2: 5.0
  • name: Grace Room
    y1: 10.0
    x1: 0.0
    y2: 13.5
    x2: 5.0
  • name: Angela Office
    y1: 10.0
    x1: 0.0
    y2: 13.5
    x2: 5.0

Has someone seen this? I am able to connect with MQTT Explorer using the above MQTT UID/Pass. I had the original configuration without having the "client_user" & "client_pass" in the appdaemon.yaml. I added it later as a troubleshooting step.

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

appdaemon.yaml not appdeamon.yaml? Maybe that's the issue?

from ad-espresense-ips.

theculby5 avatar theculby5 commented on May 29, 2024

Screenshot 2022-09-14 094150
Thanks for the reply. It was just my dyslexia showing in my typing. Is this something that has been seen before?

from ad-espresense-ips.

theculby5 avatar theculby5 commented on May 29, 2024

I corrected the original post. Fairly obvious when its done 5 times. Thanks for pointing it out.

from ad-espresense-ips.

rfortunatov avatar rfortunatov commented on May 29, 2024

:nudge: @rfortunatov

indeed it worked pretty well, sorry for long delay, had a pretty mad end of quarter and was overwhelmed with work. as of now it work almost stable except for really small areas like bathroom which is 2x1.5 though it's probably just sensor positioning that is bad. I've also made some fine tunings to the script so that it reports when device is not home and allows to select device color along with some prettifications for the code. #25 - here's a pull request for that one. Feel free to comment

from ad-espresense-ips.

rfortunatov avatar rfortunatov commented on May 29, 2024

@DTTerastar Also, I guess it's time to create a new version for Floorplan creator as of now it generates yaml that is not usable for the app. I'm not very good at JS, but might try contributing to your repository, if the last quarter won't be a hell of development. :)

from ad-espresense-ips.

DTTerastar avatar DTTerastar commented on May 29, 2024

Have you tried the espresense companion addon? It doesn't support editing the rooms yet, but it could. I'm using svelte and dynamic svgs it's pretty cool.

from ad-espresense-ips.

stan69b avatar stan69b commented on May 29, 2024

@DTTerastar Also, I guess it's time to create a new version for Floorplan creator as of now it generates yaml that is not usable for the app. I'm not very good at JS, but might try contributing to your repository, if the last quarter won't be a hell of development. :)

Has the yaml format changed for floorplans ? If it has, I'll have a look and update the floorplan creator to incorporate these changes.

from ad-espresense-ips.

Related Issues (17)

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.