Hello everybody,
forgive me for missing info, stupid questions, a wall of text and maybe even using the wrong channel. I just ported my Domoticz@Synology z-wave network to hass.io on raspberry pi (Home Assistant 0.77.3) and already struggle with the basics. I read a lot of documentation and forum discussions from which I created the automation scripts further down below.
The configuration check runs well (does that mean formatting is allright?), but it doesn’t really do, what I want it to do. Here is what I intended:
I have four different z-wave wall plugs which I use as light switches. Three of them have the ‘switch’ property and one (the one with a built-in dimmer) has the ‘light’ property. I created a group entry like this:
light_EG:
name: Light_EG
view: yes
entities:
- light.everspring_ad147_plugin_dimmer_module_level
- switch.unknown_node_26_switch
- switch.greenwave_powernode_1_port_switch
- switch.unknown_node_14_switch
I do have troubles with switching the everspring ‘light’ node and also the devices are seperated within the group. I read something about a ‘light group’ which might help, allthough I don’t really understand how it works, but this might be something for another thread …
What I want it to do is the following:
- between 6:30 and 23:00 I want all lights to turn on, if the luminance sensor reports a drop in brightness
- during the same time all lights should be turned off if the luminance sensor reports brightening conditions
- at 23:00 all lights should be switched off until next morning 6:30 (if there isn’t bright light outside then)
- whent the movement sensor (which physically is the same Fibaro z-wave sensor) senses motion between 23:00 and 6:30, all lights should be switched on for five minutes
- There should be a log message on every switching action
I don’t want the system being busy with rechecking every second if the conditions are met and I also don’t want it to switch back and forth too often. So is there a possibility to include in the trigger something like
from: above: '29'
to: below: '30'
and then ignore all changes for 15 minutes or so?
Finally, here come the scripts. I deliberately put in and-conditions so that adding conditions in the future is more convenient. I saw people putting the trigger once more into the conditions section, which I did here as well. Is this really needed? Or does it maybe even hurt?
EDIT: I updated the script throughout this thread. Please look at my latest post.
- alias: light.on.when.dark
trigger:
- platform: numeric_state
entity_id: 'sensor.fibaro_system_fgms001zw5_motion_sensor_luminance'
below: '30'
- platform: time
at: '06:30'
condition:
- condition: and
conditions:
- condition: time
after: '06:30'
before: '23:00'
- condition: numeric_state
entity_id: 'sensor.fibaro_system_fgms001zw5_motion_sensor_luminance'
below: '30'
action:
- service: switch.turn_on
data:
entity_id:
- group.light_EG
- service: persistent_notification.create
data:
message: 'Light has been switched on because of fading light.'
- alias: light.off.when.bright
trigger:
- platform: numeric_state
entity_id: 'sensor.fibaro_system_fgms001zw5_motion_sensor_luminance'
above: '35'
condition:
- condition: and
conditions:
- condition: time
after: '06:30'
before: '23:00'
- condition: numeric_state
entity_id: 'sensor.fibaro_system_fgms001zw5_motion_sensor_luminance'
above: '35'
action:
- service: switch.turn_off
data:
entity_id:
- group.light_EG
- service: persistent_notification.create
data:
message: 'Light has been switched off because of enough brightness.'
- alias: light.off.at.night
trigger:
- platform: time
at: '23:00'
action:
- service: switch.turn_off
data:
entity_id:
- group.light_EG
- service: persistent_notification.create
data:
message: 'Light has been switched off because it is late.'
- alias: light.on.when.nightly.movement
trigger:
- platform: state
entity_id: 'binary_sensor.fibaro_system_fgms001zw5_motion_sensor_sensor'
from: 'off'
to: 'on'
condition:
- condition: and
conditions:
- condition: time
after: '23:00'
before: '06:25'
action:
- service: switch.turn_on
data:
entity_id:
- group.light_EG
- service: persistent_notification.create
data:
message: 'Light has been switched on for five minutes because of movement during the night.'
What the scripts actually do is turning on the light constantly (allthough I changed a lot without longer testing recently).
Thanks for reading until here and thanks for being patient with a beginner. Looking forward to your suggestions.