PDA

View Full Version : Home automation ; how to trigger a clean Squeezebox server shutdown ?



reniera
2011-01-23, 15:01
Hi,

I'd like to automate the shutdown of SB server:

I have a magic button at home that turns off all lights when we go to sleep or when leaving home (=when I turn the alarm on). This is extremely handy because I stopped counting the times kids leave the light on. Turning the alarm on, also reduces temperature of central heating.

For those who are interested, this is all managed with a PLC Crouzet Millenium XD26 so it's a bit smarter than cutting everything off : 1 push on the button turns external lights off, 2nd push turns lights off in peripheral rooms, 3rd and 4th push turns lights off in the all rooms. When turning the alarm on (=when leaving home), the sequence is automatic but at nigh, the external lights stays on for 5 minutes. When coming home (=when turning the alarm off) at night only, some lights go on automatically for some time. Imagination is the limit. It must be smart and transparent enough but eventually wife is happy. Kids are even more happy because now, they have an excuse for leaving everything on since they say it's all taken care of magically :( I still need to deal about that.

I'd like to go one step further and also turn off some equipments that are unlikely to be used at home when we sleep or when we're out i.e. oven, hi-fi stuffs, adsl modem/wi-fi repeater/TV decoders, printers, PCs, VoIP phones, TVs, countless battery chargers, Nintendo, PS3, a PopcornHour C-200 on order, a Touch and two Radios, etc... that have pervasively entered our home. All together these stuffs takes at least 70W on a permanent basis when idle. This is the power that I need to maintain the jacuzzi at 36C !

I tested that I can pull the plug of Touch; it always restarts OK (so far). My problem is to shutdown the SQ server nicely. It's a Dockstar/debian. Perhaps I'll go to vortexbox in a near future.

Coming back to the QUESTION : How can I generate a clean shutdown based on a contact on a relay (before taking power off) ?

Also, I have battery packs in the two radios. Shutting power off is therefore useless because I consume power to charge the battery later. In the worst case, batteries are empty when I need them. So I'd like to initiate a clean shutdown of the Radios as well. Any magic mechanism that the server send a CLI command before shutting down ?

Thanks for your ideas.

pski
2011-01-23, 17:34
Hi,

I'd like to automate the shutdown of SB server:

I have a magic button at home that turns off all lights when we go to sleep or when leaving home (=when I turn the alarm on). This is extremely handy because I stopped counting the times kids leave the light on. Turning the alarm on, also reduces temperature of central heating.

For those who are interested, this is all managed with a PLC Crouzet Millenium XD26 so it's a bit smarter than cutting everything off : 1 push on the button turns external lights off, 2nd push turns lights off in peripheral rooms, 3rd and 4th push turns lights off in the all rooms. When turning the alarm on (=when leaving home), the sequence is automatic but at nigh, the external lights stays on for 5 minutes. When coming home (=when turning the alarm off) at night only, some lights go on automatically for some time. Imagination is the limit. It must be smart and transparent enough but eventually wife is happy. Kids are even more happy because now, they have an excuse for leaving everything on since they say it's all taken care of magically :( I still need to deal about that.

I'd like to go one step further and also turn off some equipments that are unlikely to be used at home when we sleep or when we're out i.e. oven, hi-fi stuffs, adsl modem/wi-fi repeater/TV decoders, printers, PCs, VoIP phones, TVs, countless battery chargers, Nintendo, PS3, a PopcornHour C-200 on order, a Touch and two Radios, etc... that have pervasively entered our home. All together these stuffs takes at least 70W on a permanent basis when idle. This is the power that I need to maintain the jacuzzi at 36C !

I tested that I can pull the plug of Touch; it always restarts OK (so far). My problem is to shutdown the SQ server nicely. It's a Dockstar/debian. Perhaps I'll go to vortexbox in a near future.

Coming back to the QUESTION : How can I generate a clean shutdown based on a contact on a relay (before taking power off) ?

Also, I have battery packs in the two radios. Shutting power off is therefore useless because I consume power to charge the battery later. In the worst case, batteries are empty when I need them. So I'd like to initiate a clean shutdown of the Radios as well. Any magic mechanism that the server send a CLI command before shutting down ?

Thanks for your ideas.

Most UPS monitoring software provides for a controlled shutdown based-on voltage to a serial port. I'm not sure how the same devices are signaled via a usb port but I would assume a lack/presence of voltage does the trick.

p

Fred
2011-01-24, 07:21
The Command Line Interface (CLI) proposes a shutdown command which cleanly shuts down the server. You can find information on the CLI in the Technical Documents section of the server (from the web gui).

agillis
2011-01-25, 15:03
Hi,

I'd like to automate the shutdown of SB server:

I have a magic button at home that turns off all lights when we go to sleep or when leaving home (=when I turn the alarm on). This is extremely handy because I stopped counting the times kids leave the light on. Turning the alarm on, also reduces temperature of central heating.

For those who are interested, this is all managed with a PLC Crouzet Millenium XD26 so it's a bit smarter than cutting everything off : 1 push on the button turns external lights off, 2nd push turns lights off in peripheral rooms, 3rd and 4th push turns lights off in the all rooms. When turning the alarm on (=when leaving home), the sequence is automatic but at nigh, the external lights stays on for 5 minutes. When coming home (=when turning the alarm off) at night only, some lights go on automatically for some time. Imagination is the limit. It must be smart and transparent enough but eventually wife is happy. Kids are even more happy because now, they have an excuse for leaving everything on since they say it's all taken care of magically :( I still need to deal about that.

I'd like to go one step further and also turn off some equipments that are unlikely to be used at home when we sleep or when we're out i.e. oven, hi-fi stuffs, adsl modem/wi-fi repeater/TV decoders, printers, PCs, VoIP phones, TVs, countless battery chargers, Nintendo, PS3, a PopcornHour C-200 on order, a Touch and two Radios, etc... that have pervasively entered our home. All together these stuffs takes at least 70W on a permanent basis when idle. This is the power that I need to maintain the jacuzzi at 36C !

I tested that I can pull the plug of Touch; it always restarts OK (so far). My problem is to shutdown the SQ server nicely. It's a Dockstar/debian. Perhaps I'll go to vortexbox in a near future.

Coming back to the QUESTION : How can I generate a clean shutdown based on a contact on a relay (before taking power off) ?

Also, I have battery packs in the two radios. Shutting power off is therefore useless because I consume power to charge the battery later. In the worst case, batteries are empty when I need them. So I'd like to initiate a clean shutdown of the Radios as well. Any magic mechanism that the server send a CLI command before shutting down ?

Thanks for your ideas.

Should be no problem to sens a command to a Linux box to go into sleep mode. With VortexBox you could hit a URL to do it.

pski
2011-01-25, 16:06
Should be no problem to sens a command to a Linux box to go into sleep mode. With VortexBox you could hit a URL to do it.

Also, there is a sleep command which powers players:

webIU/HELP (lower left)/Technical Information/the Squeezebox Server Command line interface.

CLI commands can be "piped" via telnet to the server's port 9090.

reniera
2011-01-25, 16:49
Should be no problem to sens a command to a Linux box to go into sleep mode. With VortexBox you could hit a URL to do it.

Interresting. Can you say a bit more about this ?

reniera
2011-01-25, 16:56
Most UPS monitoring software provides for a controlled shutdown based-on voltage to a serial port. I'm not sure how the same devices are signaled via a usb port but I would assume a lack/presence of voltage does the trick.

p

I have a ups on order to try this. Thanks

aubuti
2011-01-25, 21:25
I realize this isn't exactly what the OP requested, but what about shutting down the server (or suspending or hibernating) anytime none of the SBs have been used for X minutes? The ServerPowerControl does this very smoothly. True, it doesn't fit squarely into the existing unified PLC Crouzet Millenium XD26 smarthome system, but it does achieve the same objective. You shutdown the SBs via the existing system, and after X minutes the server does a clean shutdown as well.