ESPresense / ad-espresense-ips

DEAD: See https://github.com/ESPresense/ESPresense-companion
63 stars 9 forks source link

how to use #2

Open corgan2222 opened 3 years ago

corgan2222 commented 3 years ago

Hello, as answer to your comment https://github.com/mKeRix/room-assistant/issues/842#issuecomment-922391919 I'm looking into this, but I'm not sure what to do with this app. What's the out coming from this?

Franz37 commented 2 years ago

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
ASNNetworks commented 2 years ago

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.

eladore commented 2 years ago

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?

stan69b commented 2 years ago

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 :/

KuotenoAshiato commented 2 years ago

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

stan69b commented 2 years ago

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                
KuotenoAshiato commented 2 years ago

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 :/

stan69b commented 2 years ago

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 :)

KuotenoAshiato commented 2 years ago

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
stan69b commented 2 years ago

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 😂)

eladore commented 2 years ago

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?

KuotenoAshiato commented 2 years ago

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.

eladore commented 2 years ago

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

stan69b commented 2 years ago

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.

KuotenoAshiato commented 2 years ago

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

duceduc commented 2 years ago

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

stan69b commented 2 years ago

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.

dvbit commented 2 years ago

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

duceduc commented 2 years ago

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
stan69b commented 2 years ago

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

duceduc commented 2 years ago

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.

stan69b commented 2 years ago

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
duceduc commented 2 years ago

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

stan69b commented 2 years ago

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.

duceduc commented 2 years ago

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

stan69b commented 2 years ago
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.

duceduc commented 2 years ago

Is it showing the correct rooms for your for currentroom?

stan69b commented 2 years ago

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 ;)

duceduc commented 2 years ago

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.

stan69b commented 2 years ago

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"

duceduc commented 2 years ago

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?

stan69b commented 2 years ago

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 :)

Franz37 commented 2 years ago

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:

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

stan69b commented 2 years ago

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 ?

Franz37 commented 2 years ago

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.

rfortunatov commented 2 years ago

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.

Franz37 commented 2 years ago

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.

rfortunatov commented 2 years ago

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

DTTerastar commented 2 years ago

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

rfortunatov commented 2 years ago

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

DTTerastar commented 2 years ago

:nudge: @rfortunatov

DTTerastar commented 2 years ago

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

theculby5 commented 2 years ago

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:

In MQTT Config:

ESPresenseIps: module: espresense-ips class: ESPresenseIps pluggins:

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.

DTTerastar commented 2 years ago

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

theculby5 commented 2 years ago

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?

theculby5 commented 2 years ago

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

rfortunatov commented 2 years ago

: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. https://github.com/ESPresense/ad-espresense-ips/pull/25 - here's a pull request for that one. Feel free to comment

rfortunatov commented 2 years ago

@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. :)

DTTerastar commented 1 year ago

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.

stan69b commented 1 year ago

@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.