I am having some issues with a few of my scripts that take a really long time to execute. I am not sure if it is because of the door locks (as they seem to take a while to respond to commands) or if its the call to turn off groups that have quite a few entities in them.
I’m running the latest HassIO release on ESXi, with Aotec Z-stick, GE Jasco Zwave switches (like 30 of them, all but 1 are Plus) and 2 Schlage Zwave locks.
When I’m laying in bed and I execute this good night script (via Alexa) it runs through the steps very slowly and sometimes things happen out of order. It will take a few seconds (at least usually) for the door locks to trigger, then I’ll lay there for at least 10-15 seconds for the lights to turn out and sometimes another 10 plus seconds for the fans to turn on. Also, sometimes it happens out of order. Like the fans will turn on before the lights turn off, or the bedroom lights will turn off before the hallway light. For the most part we are really good at turning all the other lights off in the house before we lay down, so it really shouldn’t even have to turn off any of those.
goodnight: alias: Goodnight sequence: - alias: Lock Doors service: lock.lock data: entity_id: - lock.back_door - lock.front_door - delay: seconds: 2 - alias: Turn off lights besides bedroom service: script.turn_on data_template: entity_id: > {% if is_state('group.Goodnight_lights', 'on') %} script.goodnight_lights_off {% else %} script.no_delay {% endif %} - alias: Turn off bedroom lights service: homeassistant.turn_off data: entity_id: - light.master_dimmer - switch.master_light - delay: seconds: 2 - alias: Turn on fans service: homeassistant.turn_on data_template: entity_id: > {% if states('sensor.bedroom_temperature') | float > 67 %} group.Master_Bedroom_Fans {% elif states('sensor.bedroom_temperature') | float > 63 %} switch.master_outlet {% else %} input_boolean.dummy {% endif %}
I don’t get any errors in my logs from this. I have another similar script that I use when I leave the house and a bunch of times I just stood by the door waiting for it to lock and the lights to turn off an I eventually just gave up and opened it on my phone and did everything manually.
Everything else on this setup runs really fast and smooth. Z-wave does take a bit t respond after a heal or system reboot, but after that everything responds almost instant, reboots are fast, automations normally happen within a second, (like if one light is turned off, to another one off), and the interface is snappy. It just seems, for the most part, these two scripts are painstakingly slow.