Page 1 of 2

Shutdown domoticz pi

Posted: Monday 17 October 2016 12:55
by DaWauZ
Hello,

Maybe its in the wrong subforum, excuse me for that but I dont know exactly what should then be the right one.

I would like to create a shutdown switch, to shutdown the rpi with domoticz itself. I dont know if that is possible, but its also shitty to shut it down by a command (sudo poweroff) as I dont have a display/keyboard on the pi.

Is it possible to do that and how?

Re: Shutdown domoticz pi

Posted: Monday 17 October 2016 13:10
by Cornholio1234
why don't you just ssh into your pi like the rest of the world? :-)

Re: Shutdown domoticz pi

Posted: Monday 17 October 2016 13:21
by DaWauZ
Well, because I have to start my laptop, and so on.
Its easier to do it by the domoticz app on my phone. Why not automate it.

Re: Shutdown domoticz pi

Posted: Monday 17 October 2016 13:47
by alexsh1
Yes, it is possible. You have to come up with your own script (as demon) and as soon as you issue a command, which can be adopted as a virtual sensor in Domoticz, RPI will be reboot/shutdown.

Please see below:
https://lowpowerlab.com/guide/atxraspi/

Re: Shutdown domoticz pi

Posted: Monday 17 October 2016 16:11
by Egregius

Code: Select all

http://192.168.2.10:8084/json.htm?type=command&param=system_shutdown 
should do it as that is the url that the www gui calls.

Re: Shutdown domoticz pi

Posted: Monday 17 October 2016 17:29
by jannl
I have a reboot button on my frontpage.

Re: Shutdown domoticz pi

Posted: Tuesday 18 October 2016 18:16
by DaWauZ
Egregius wrote:

Code: Select all

http://192.168.2.10:8084/json.htm?type=command&param=system_shutdown 
should do it as that is the url that the www gui calls.
Where in which gui do yo see this?
I cant find it in the webgui of domoticz?

Re: Shutdown domoticz pi

Posted: Tuesday 18 October 2016 22:54
by Egregius
I have a restart and shutdown option in the menu.
Then used feveloper view of my browser to see the url.

Re: Shutdown domoticz pi

Posted: Wednesday 19 October 2016 14:35
by DaWauZ
Ok but I dont, domoticz is running on a rpi.
How can I get that options?

Re: Shutdown domoticz pi

Posted: Wednesday 19 October 2016 15:15
by jannl
Hm, I run domoticz on a pi. The restart in somewhere in the lower part of the settings menu

Re: Shutdown domoticz pi

Posted: Wednesday 19 October 2016 15:30
by DaWauZ
I found it now, on my laptop resolution 1366x768 the bottom of the options menu are not visible.
I connected a larger external screen and now I see them.

In the dev view the link is this: <a id="cShutdown" href="javascript:SwitchLayout('Shutdown')"><img src="images/shutdown.png"> <span data-i18n="Shutdown System">Computer afsluiten</span></a>

How can I use this on a switch, it cant because its html ...

Re: Shutdown domoticz pi

Posted: Wednesday 19 October 2016 15:51
by Egregius
The link is as I posted it earlier.
You need to open the network tab of develover view and click the button to see the action.
Image
Just a normal switch command in the screenshot, shutdown url posted above

Re: Shutdown domoticz pi

Posted: Wednesday 19 October 2016 18:46
by jannl
The info is also in wiki as far as I remember

Re: Shutdown domoticz pi

Posted: Wednesday 19 October 2016 18:57
by Egregius

Re: Shutdown domoticz pi

Posted: Wednesday 19 October 2016 20:32
by DaWauZ
ok, i created a switch, push off button and gave it an off action http://192.168.1.14/json.htm?type=comma ... m_shutdown
But nothing happens...

Re: Shutdown domoticz pi

Posted: Wednesday 19 October 2016 21:17
by Egregius
Logfile? Authentication?

Re: Shutdown domoticz pi

Posted: Wednesday 19 October 2016 21:21
by DaWauZ
I only get these :

Code: Select all

2016-10-19 20:34:35.928 Error: Error opening url: http://192.168.1.14/json.htm?type=command¶m=system_reboot
I have to log in, in my webgui.

Re: Shutdown domoticz pi

Posted: Wednesday 19 October 2016 22:05
by Egregius
Something is wrong with your url. 'Param' got replaced.

Re: Shutdown domoticz pi

Posted: Thursday 20 October 2016 6:53
by DaWauZ
yeah I dont know why, @ the action is really typed http://192.168.1.14/json.htm?type=comma ... m_shutdown

Re: Shutdown domoticz pi

Posted: Monday 31 October 2016 6:38
by DaWauZ
Its solved, i'm really shaming myself, I forgot the :8080 port in the url.