MQTT support would be great
MQTT support would be great. Then you can send the location updates to a mqtt server
@duffy6 I just added MQTT support in my fork. I haven't tested it extensively yet but it seems to work okay.
@joe248 @fjxmlzn
Nice project! However, I am not able to show the GPS coordinates in Home Assistant. Are you sure that your Home Assistant Configuration is correct?
I also needed to change "name" to "modelDisplayName" in the constansts.py since this generic name was not allowed.
Are you getting a configuration error in Home Assistant, or you're just not getting any data populated in the sensor?
If you watch the MQTT topic mosquitto_sub -t "FindMyHistory/#" what does the data look like for the device(s) you're trying to track?
I think the main problem is that I get a ValueError: Publish topic cannot contain wildcards. because of the line
MQTT_TOPIC_KEY = 'name' in the file "constants.py"
I tried to change the name, but that broke your code 😅 Try to find a solution now, but if you have any idea that would be great.
Seems to be related to https://stackoverflow.com/questions/64410064/java-paho-mqtt-publish-to-wildcard
Do any of your device or item names contain any non-alphanumeric characters? Those probably need to be filtered out.
I'm guessing you have a + or # in one of your device names. Try changing log_manager.py - add import re at the top, then towards the bottom right after topic_key_value is first defined, add this line: topic_key_value = re.sub(r"[\#\+]", '', topic_key_value) to remove any + or # in the names
Thanks for your help !! I actually had an "#" in my name and now this error got away.
However,
when stripping the name string in the topic_key_value = line, the string will differ and therefore fail in the If loops in the def refresh_log(self) just before and therefore, no updates are pushed into Home Assistant.
when stripping the name string in the
topic_key_value =line, the string will differ and therefore fail in the If loops in thedef refresh_log(self)just before and therefore, no updates are pushed into Home Assistant.
Glad you got it working. The topic_key_value is only used to generate the topic that is published over MQTT. It's not used to do anything else within the script. The only reason that this statement: if topic_key_value and topic_key_value != "NULL": would be false is if topic_key_value == "NULL" or contains only # or + characters.
Is it possible to do this on an iPad?
Unless you can manage to jailbreak your iPad and install MacOS somehow. it is not