pi@raspberrypi:/home/hass/.homeassistant/python $ ./life360.sh
./life360.sh: 4: ./life360.sh: username360: not found
./life360.sh: 5: ./life360.sh: password360: not found
Error: Unknown option '='.
Use 'mosquitto_pub --help' to see usage.
./life360.sh: 7: ./life360.sh: mqtt_host: not found
./life360.sh: 8: ./life360.sh: mqtt_port: not found
./life360.sh: 9: ./life360.sh: mqtt_user: not found
./life360.sh: 10: ./life360.sh: mqtt_pass: not found
timeout: invalid time interval ‘=’
Try 'timeout --help' for more information.
./life360.sh: 14: ./life360.sh: function: not found
1491944218 INFO: requesting access token
grep: Po: No such file or directory
grep: (?<="access_token":")\w*: No such file or directory
curl: option -: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
./life360.sh: 16: ./life360.sh: bearer_id: not found
./life360.sh: 17: ./life360.sh: Syntax error: "}" unexpected
Line 4 is just setting a variable named username360 equal to whatever you have in quotes. You have something weird going on. Was the script copied and pasted fine? Copy the script from https://pastebin.com/raw/3q3ntT0a and use nano or vi to paste it. Maybe windows is putting some weird characters in there or something?
If that doesn’t work, paste the following in the shell prompt:
var=‘test’ bash -c ‘echo $var’
Thanks a lot for that, I’ve been jumping through hoops trying to get life360 from IFTTT to an input_boolean in homeassistant etc. etc.
The location works great. Well, it probably all does, but I can’t seem to get the sensor for battery info to work in HASS. I can do a mosquitto_pub in terminal, and I get the battery stats just fine. But not in HASS. My sensor.yaml has
where my NAME and DEVICE_ID is what was auto-populated in known.devices.yaml (is that rght? My name used in the app, then a 32 character string as device id?). Other than the topic, it’s the exact same configuration as I use for owntracks.
EDIT: If I delete the device ID from the sensor.yaml file (so just do state_topic: “owntracks/MYNAME/#”), then it works fine. So I guess this works, now I’m more just curious about why it doesn’t with the device ID?
The tracker makes its own entry in known_devices.yaml with name and DEVICE_ID, but in the mqtt topic it sends, it has inserted four dashes within the ID. So for my known_devices.yaml, I have someting like (auto-created, I didn’t write any of this, except changing the “name”):
Which is really weird, since it gets the location with the un-dashed ID, but needs the dashes for the battery sensor. And the location seems to work just fine, even though the mqtt topic has the dashes.
Hello I am trying to get this working. I have been using Life 360 for at least 5 years and would like to use it with HA, I am getting an Error when running the script, I copied and pasted 3 different scripts from here but get the same Error
File “life360.sh”, line 13
function bearer {
^
SyntaxError: invalid syntax
And then using the developer tool in home assistant to send a test message. If nothing pops up on your terminal (the message you sent), then that’s your problem (perhaps username/password in you home assistant configuration file?)
OK I have had Owntracks running for a few months and mosquitto mqtt broker running for about 6 months I’m not sure if I understand the
mosquitto_pub="/path/to/mosquitto_pub" Is this the topic or the actual path to mosquitto_pub
Edit: looks to me its the path But I’m having trouble finding the path. I installed mosquitto on a raspberry pi
If you are on a raspberry (or, I guess, any unix, but specifically for raspbian), I’d recommend doing:
sudo apt-get install mlocate
sudo updatedb
The you can type
locate XXX
and find anything (maybe not hidden stuff, or things the current user doesn’t have access to, I’m not sure about the exact details). Very helpful. I’d try:
Well not sure what I’m doing wrong all mine looks the same as yours even the location and still getting the same Error.
I know the user name and password is OK, I logged off and back on. I guess I’ll check the script line by line add it instead of copy and paste.
just with XXXXX replaced with usernames and passwords, but all the quotation marks (") are also included.
Try copying mine from the github, and only changing the username/passwords. I’m not saying I think you made any mistakes, but I know from time to time I have made some small error (like an extra space or something stupid like that), and I couldn’t fix it until I just started from scratch.
@Aephir Well I checked everything an all was fine i even deleted the script and made a new one then added my info and still had the same Error. I’m going to put a fresh copy of everything on another SD card and see if I get the same Error.
Thanks again for your help I’ll let you know what I found out.