Hi all. I have just started using the Companion app and it works very well. I have several iPhones using the app and each appears in the “integration” part of the system (as expected). All of the iPhones show several sensors - battery, steps, location etc. Very cool.
Now - when I catch an event when a device_tracker is being updated I also want to get some info from the geocoded_location-sensor that belongs to the same iPhone. The question is how I find the link between the two…
Example:
The mobile app “Jeas iPhone” has several sensors, for example:
- device_tracker.jeas_iphone_3 shows lat/long and other info.
- sensor.geocoded_location_2 shows address, country etc.
If I (in appdaemon) know the entity_id=device_tracker.jeas_iphone_3, how do I find out it is related to sensor.geocoded_location_2? I can’t see any attributes in any of the entities that points on a “master” entity or similar. The MobileApp integration must have stored this info somewhere but I can’t figure out where. I would like to send a customized notification to the mobile app offering to open the garage door when the device is close to home and moving fast enough. Not a question of life and death but since it can be done it has to be done.
I would like to keep the code as generic as possible and not have to hard code these relations.
There is probably something fundamental and simple I have missed - do you know what??