Motion lights at night for hungry pregnant person

All my lights are set to not be activated after midnight. I have lots of cats and they set them off, so easiest solution - time range node in node red. They’re off off from midnight, back on at 7am but then it’s dependent on lux sensors so that in winter/summer they turn up when appropriate

Except, I now find myself pregnant and with that comes 2am snacks and toilet trips. I don’t want to change my setup in the sense that if I do, the lights will go on and off constantly as the cats run around the house.

My thoughts were using a tradfri button, I have a couple spare. I could press it before i get out of bed which sort of activates the sensors so that they operate outside of my usual boundaries. Whe I get back into bed and press the button , they go back to normal

How would I present this in node red? I haven’t a clue

Is this my best option? Happy to buy more tech…

How have you integrated tradfri button with HA?

Zigbee2mqtt and blueprint exchange

Button works. Once you get it integrated into HA you’re basically just going to want to tie it to an entity.

One option is an input boolean helper and an automation. That calls input_boolean.toggle every time you press the button if it’s between midnight and whatever time you wake up. Also an automation that sets the input boolean to off at midnight so it starts off. Then in your flows you can check of it’s between two times or if that toggle is on.

An alternative is an energy monitoring smart outlet on your phone charger next to your bed. That’s what I do personally. See what the power use is when your phone is plugged in and fully charged and make a threshold sensor with that number. Then in node red let your lights flow proceed if it’s in between two times or if the threshold sensor is off (i.e. youre out of bed). Then you just grab your phone when you get out of bed and plug it back in when you’re finished snacking.

Idk if you find that easier then a button but figured I’d throw it out there

You can you event all node in node red to trigger the flow when you press the button. For this you need to know what is the event which is produced when the button is pressed. This can be found from the debug window. I am adding a sample flow which could give you an idea of how to use this.

[{"id":"1a60866e.eb60fa","type":"server-events","z":"e0867982.9fe578","name":"HueEvent","server":"2993e8b4.fc1e78","version":1,"event_type":"hue_event","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"},{"property":"event_type","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":60,"y":280,"wires":[["5e9fd622.0bf928"]]},{"id":"2993e8b4.fc1e78","type":"server","name":"Home Assistant","addon":true}]

image

You can share your node red flow for more help.

You need to check this out.

1 Like