Problems with command switch

54 views
Skip to first unread message

Juanjo Rodriguez

unread,
Mar 24, 2016, 8:36:47 AM3/24/16
to Home Assistant Dev
Hello group!!!
I have issue with command switch to manage using USB Home-Easy a remote plug.

if I run from command line works ok -> /bin/he853/he853-remote/he853 2001 1
if I run usint a custom python script works ok -> python he853-2001-off.py

But If I configure from HA the log shows command fail , thi is my yalm configuration

    luz:
      oncmd: sudo python /bin/he853/he853-2001-on.py
      offcmd: sudo python /bin/he853/he853-2001-off.py
      initial: 'off'
    luz2:
      oncmd: /bin/he853/he853-remote/he853 2001 1
      offcmd: /bin/he853/he853-remote/he853 2001 0
      initial: 'off'

If anyone can help will be nice!!
Regards.

Paulus Schoutsen

unread,
Mar 24, 2016, 10:38:18 AM3/24/16
to Home Assistant Dev

Sudo requires entering a password that home-assistant can't do


--
You received this message because you are subscribed to the Google Groups "Home Assistant Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-...@googlegroups.com.
To post to this group, send email to home-assi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/home-assistant-dev/c287ecf5-26d7-40b0-b1a4-005dc50b3c63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sean Dague

unread,
Mar 24, 2016, 11:06:24 AM3/24/16
to home-assi...@googlegroups.com
You could probably make a passwordless sudo entry for that command
matched to the user in question:

hausername ALL=(ALL) NOPASSWD: /usr/bin/python /bin/he853/he853-2001-on.py
hausername ALL=(ALL) NOPASSWD: /usr/bin/python /bin/he853/he853-2001-off.py

That would let the 'hausername' execute those commands under sudo with
no password.

It's enough of a security exposure, that you want to be really explicit
about what user and commands can be run like this.

-Sean
> <mailto:home-assistant-...@googlegroups.com>.
> To post to this group, send email to
> home-assi...@googlegroups.com
> <mailto:home-assi...@googlegroups.com>.
> <https://groups.google.com/d/msgid/home-assistant-dev/c287ecf5-26d7-40b0-b1a4-005dc50b3c63%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Home Assistant Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to home-assistant-...@googlegroups.com
> <mailto:home-assistant-...@googlegroups.com>.
> To post to this group, send email to home-assi...@googlegroups.com
> <mailto:home-assi...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/home-assistant-dev/CAKRfqu3hRX2bwCQ2x3t_%3D9VHkQ80HhH9n4nqydNEtmEAYLY-Yg%40mail.gmail.com
> <https://groups.google.com/d/msgid/home-assistant-dev/CAKRfqu3hRX2bwCQ2x3t_%3D9VHkQ80HhH9n4nqydNEtmEAYLY-Yg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--
Sean Dague
http://dague.net
Reply all
Reply to author
Forward
0 new messages