Hi @farstreet,
Thanks for sharing!
Regarding the reboot through shell command, I guess I can suggest a solution.
If you run home-assistant under different user, let’s say hass, then you need to grant this user sudo for reboot.
To do this, edit /etc/sudoers file with command sudo visudo and paste hass ALL = NOPASSWD: /sbin/reboot
Thanks… I experimented with sudoers already and I ended up rebuilding my hassbian config as I locked myself out of the sudo functionality… But I guess I’ll have to give it another go
Suggestion when modifying sudoers. Make sure you use visudo to edit the files since that has protections on making mistakes in the config files. Secondly, I assume you are using SSH to connect to your box to make the sudoers changes? I suggest you have two separate SSH sessions connected. Example if you are using Putty open up two separate instances/connections. That way you can leave one connected and logged in as root while you make the changes in the other connection. You can then disconnect one to test, etc. If you make a mistake you still have the other connection logged in to undo any changes that locked you out. Learned this one while administrating Cisco switches.
Thank you for sharing @farstreet! Noob question…on your travel time to work, wouldn’t it keep playing the same message if the time is more than 20 min? Does it only alert you once if yes, how?
Much appreciated. I tried tts few weeks ago when the wifey got home and it keeps repeating whenever she walks by the kitchen sensor lol. Now I know why. Will get it a try.
@farstreet hello friend thanks for sharing your config…
i saw your sensor.yaml and i have a idea… can u help me to build this template…
i want to do a template, … when proximity.sensor is less 100 give me “perto” else “longe”.
the example below is right?
value_template: >
{% if is_state('proximity.home') <= 100 %}
perto
{% else %}
longe
{% endif %}
entity_id: proximity.home
I wouldn’t use proximity.home for something that requires such an accuracy. Would rather look into nmap (once connected to wifi) or even beacons.
But as such your template looks ok, although I am using this sensor in km and not in m. In my setup, this would look at whether I am less than 100 km from home and not less than 100 m.
I got it to work for one command line only. Once I try to include another command (either by a new line or using “, /new/command”), visudo complains. How can I include many command lines for user homeassistant without giving full privileges?
I was trying to include OPTIONS in the command line. That’s what visudo was complaining.
Once included as: /bin/dd, /usr/bin/apt-get*, /sbin/reboot, /sbin/shutdown
Then it works (it was already stated by SmaginPV).