Xbox On, Shades Down

With my new Fyrtur blinds, I am now able to set an advanced scene for movie time. The windows in my dining room are southern facing and the sun comes right into my living room. During the day, the glare is horrible and makes TV viewing unwatchable.

I installed a Zooz Power Switch Zen15 on my Xbox and now when the Xbox comes on during the day, shades go down.

The way I’ve done this is to do two pistons. One which monitors the Xbox, and one which performs the actions that I want done. The reason for splitting these out is that I have multiple Xboxs in the house, and I want the first one, monitoring the Xbox, to be duplicatable and easily copied in case I want to use it for each Xbox. The Guest Room Xbox or the Study Xbox have different actions I want performed, and it is easier for me to duplicate that piston and improve that piston as needed.

Piston time Import code (e9pb)

The Xbox Monitoring Piston is pretty simple. Using the Wattage on the Plug, it determines if the Xbox is on by measuring Wattage for 10 seconds. I have an Xbox One X and an Xbox One S, and find their usage wattages are different. For the Xbox One X the wattage averages above 50 when on and the Xbox One S averages above 30 when on.

Lines 44 – 57 are the custom things that the piston does when this Xbox is on. Specifically Line 48 calls the next piston.

Piston Import Code (j43xvb)

This piston has three arguments that it accepts when it runs. On, Off and Deep. On does basic first line items like Turns off Motion sensors so lights don’t ‘trip on’ (line 64) and set Lights to 20% (line 84).

Line 38 is where this piston does some magic though. It checks to see if all Window Contacts are closed, and if so, it will shut all blinds. If all window contacts are not closed (i.e. one or more window is open), it checks each Window to see if that windows contact sensor is closed, and if so, it will shut the corresponding shade.

Back to Piston Arguments. Sending the argument ‘Off’, the piston reverses all changes.

Finally for the argument ‘Deep’, it turns all the lights that were 20% completely off.

The way I use ‘Deep’ is I have a Hue Tap Switch in the living room. When Button 3 gets pressed once, it Executes this Piston with the Argument ‘On’. If the button gets pressed again, it executes the piston with the Argument ‘Deep’. So one press puts the living room in movie mode, two presses and it’s time for a horror movie.

Comments are closed.