I’d like to implement a feature where if a human uses the zwave wall switches, the room automation goes into “manual mode” until a timer expires or presence is not detected.
This solves the following problems:
Guests who are surprised by the automation and just want it to stop.
Incorrectly configured automation that is misbehaving can be put into manual mode.
incomplete automation that doesn’t account for a room being used in a new way (someone hanging out in a hallway longer than expected, for example).
In the simplest case what I want is:
Motion sensor -> trigger light unless manual mode is set
Press any room button -> enter manual mode
However if I build this with switch and motion_sensor events the problem is that the motion sensor triggers a light state change event when then causes the manual mode.
I have a prototype for this in node-red using a state machine that keeps track of whether or not the motion sensor triggered the event and then ignores the next light state change event. However this is fragile. I can’t add global timers (for like fans or night mode or alarms) without specifically teaching the node read flow how to ignore every source of automation events for those switches.
What I’d rather have is the ability to distinguish physical button presses from switch state changes and have physical button presses trigger manual mode.
Assume we have a light switch represented by switch.bathroom.
You walk into the room, motion is detected and switch.bathroom is automatically turned on.
Now you press the light switch to turn it on (even though the light is on) in order to indicate you want to enter manual mode.
However, switch.bathroom is already on so how do you propose Home Assistant will know the light switch was operated manually?
The light switch needs to report more than just its state (on or off) it also needs to report ‘button pressed’ events and very few switches do that.
FWIW, I achieve what you proposed by monitoring the brightness of a dimmer switch (a separate property from the on/off state).
When someone enters the room, the motion sensor serves to set the light to a specific brightness (depending on the time of day). If the user manually changes the brightness level, that serves as a signal that they want manual control of the dimmer switch. The auto-off feature is disabled for 20 minutes after which it’s automatically re-enabled.
To add Taras’ suggestion, you can find other things that you normally do when you are is inside your room (e.g. adjusting air conditioning or a fan, charging your phone, turning a computer ON).
Those things will can be added as a trigger for an automation to turn ON an input_boolean which can temporarily disable (as a condition) on your motion-dependent lighting automation.
Obviously, you will need to find a way to integrate the things that you normally do to be detected inside Home Assistant.
I don’t see how the linked example could work if the light is already on (turned on by the motion sensor). Manually turning on a light that’s already on won’t trigger the State Trigger.
Perhaps not, but the person could press the light switch again to turn it off, then again to turn it back on… not great but would supposedly work (I haven’t tried it).
Can’t the switch be unpaired with the light?
That way the switch only talks to HA and sitch actions will create an event in HA that can be used in an automation?
Maybe I’m completely lost but I know for sure that is possible with ZigBee.
It could and is what I had originally used (I devised a way of doing it well before the State Object contained the user_id) but replaced it with brightness monitoring.
It worked but turning off a light, that is already on, and then turning it back on proved to be counter-intuitive, inconvenient, and disliked (in our home). Adjusting the brightness had much higher user-acceptance. Nevertheless, I didn’t delete my “How To” post in case someone else doesn’t mind that style of operation (but, for the record, I no longer use it).
What is the model of the zwave switch? Many new jasco switches, inovelli switches, and others will trigger a “central scene” command from the switch when it is pressed up or down manually.
You also can listen for this scene event by going to developer tools, and listen on zwave_js_value_notification. In this example, an event fires on my jasco switch when I press it but doesn’t fire when the light turns on or off by zwave command.
Exactly. Some devices can report ‘button pressed’ events (in addition to reporting the load’s state). I use UPB dimmer switches and they’re capable of reporting the rocker button’s activities (single/double-press, etc).
What the OP wants to do is fairly easy to achieve if the device is capable of reporting button events. Just needs some coaching from Z-Wave users (which leaves me out).
It would be good if the dev tools page was updated to include events such as this. I could try and put together a PR for the docs at some point, however I don’t actually know the events that are missing. Any chance of someone helping out with an updated list of available events? (I realise this is off-topic, sorry)
I use Aeotec nano Z-Wave switches (with the old deprecated Z-Wave integration) and am able to get an event when a switch is toggled. This requires a bit of extra configuration of the switch - see this description here.
Are you using the old integration? I have a dimmer where I use events from the second switch to switch off other lights. When I look at parameter 123 & 124 on my mobile, they look “dimmer” as if they may be read only, but I can change them. Screenshot_20210905-144039_Home Assistant|379x500
The control panel in zwavejs2mqtt allows you to change any config parameter you want with a “custom configuration”, even if the device isn’t in the database or the database listing in zwavejs for your device doesn’t list all the features/parameters.
I know some zwave devices have “hidden” config parameters that aren’t in the zwave alliance database. Older Jasco dimmers have hidden options to turn the device into an on/off switch or specify a minimum dim value, that weren’t listed in the database or device manual.
Zwavejs2mqtt has some more advanced config settings with its control panel vs just zwavejs. They keep adding features to zwavejs so its getting there, but this looks like a situation where if you’re trying to set an odd parameter for something like the Aeotec Nano it may be worth having those extra features in zwavejs2mqtt vs just zwavejs.
I have not personally used the old zwave integration, other then trying it once and thinking it was awful. The zwavejs2mqtt project is what pushed me over to Home Assistant, and I would say all the functionality the old integration had and more is in zwavejs2mqtt. The original zwave integration is deprecated and its database is not being updated, while zwavejs2mqtt is an actively developed project.
Here’s the screenshot of the config settings in the control panel: