0.113: Automations & Scripts, and even more performance!

please allow me this one to follow-up then, an automation triggered by the state change of a closing/opening cover:

  - alias: Cover stookhok
    trigger:
      platform: state
      entity_id: cover.raamverduistering_stookhok
    condition:
      condition: template
      value_template: >
        {{trigger.to_state.attributes.current_position !=
          trigger.from_state.attributes.current_position}}
    mode: parallel # <----?
    max: 35
    action:
      service: script.raamverduistering_stookhok
      data_template:
        old: '{{trigger.from_state.attributes.current_position}}'
        new: '{{trigger.to_state.attributes.current_position}}'

the script it calls is using:

script:
  raamverduistering_stookhok:
    mode: restart
    sequence:
      - service: input_select.select_option
        entity_id: input_select.raamverduistering_stookhok
        data_template:
          option: >
            {{'Opening' if new|float > old|float else 'Closing'}}
      - delay: 2
      - service: input_select.select_option
        entity_id: input_select.raamverduistering_stookhok
        data_template:
          option: >
            {% if new|float == 100 %} Open
            {% elif new|float == 0 %} Closed
            {% else %} Stationary
            {% endif %}

dont think the automation should use mode: restart too, because then it would halt the script? do I use parallel here, or even queued 
?

Personally I’d move the actions directly into the automation, get rid of the script, and then change the mode of the automation to restart.

But if you want to have both the automation & the script, the script probably needs to be restart. But so does the automation. If the automation restarts, it won’t cause the script to restart, it will actually stop the script and then start it. Yes, effectively it’s the same thing, but the actual mechanism is different. Since the script is being stopped and then started, the script itself is not restarting. It’s being restarted.

But those are technicalities. You can move the actions to the automation and get rid of the script, or keep them both. Either way the automation should use restart mode.

Okay, I think I understand where you are coming from.
In that case I would suggest that we just extend ‘restart’ mode to accept a queue (again a default of 1) that way 3 will accept multiples.

  1. Parallel : as is.
  2. Queued : so setting max: 10 allows the 10 oldest to run
  3. Restart : setting max: 10 allows the 10 newest to run

Most people will just run with the default value anyway so it’s not a biggie and only special circumstances will require them to delve and the can study the options for those times.
No need for FIFO after all
:man_shrugging:

Talk about confusing! :stuck_out_tongue_winking_eye: Restart means if it’s running then stop it and start it again. There’s nothing to queue, because by the time you get to starting the new run all old runs are gone.

Again, no promises yet, but I think a new mode – queued_fifo – or a new parameter to the existing queued mode – something like dequeue_oldest: true/false – makes more sense.

But, yeah, an even more advanced feature that might be rarely used, but when it’s needed, 


1 Like

Amigos, não consigo encontrar onde corrigir o erro abaixo, iniciado após a atualização para 113, o que pode ser?

Registrador: homeassistant
Fonte: runner.py:101
Primeira ocorrĂȘncia: 10:26:51 (5 ocorrĂȘncias)
Último registro: 10:38:22

Erro ao executar o trabalho: sessĂŁo do cliente nĂŁo fechada

could someone gently help me? :blush:

That error does not say much, you should open a issue https://github.com/home-assistant/core/issues/new?template=BUG_REPORT.md where you add details about your installation, which integrations you use, and warnings/errors from your log file (home-assistant.log)

I have lost access to hue groups after the upgrade :frowning_face: Only hue lights are working.
“Allow hue groups” is checked, removed hue entry from configuration.yaml.
Previous versions configured by yaml have been working flawlessly.

Did you lose groups, or Zones? I saw someone else mentioning losing zones. I know that for me in the past they both showed up as groups, but maybe they are handled differntly now?

Both groups created manually via hue API and zones.

Me 2 all my LightwaveRF lights show up as sensors, this is nowhere near ready for general release, and so much worse than the old configuration, the slow death of .yaml, starting to feel like windows, everything hidden in registry files and no real system control. I think this project may be going down the wrong road trying too appeal to the masses.

Looks like mdc-theme-surface controls the background of the pop-up body background. I can’t figured out the pop-up header background, though - it almost seems like it’s hardcoded as white.

did you enable hue_groups in the options of the integration:

Thanks bram sorted it on discord.

Are you using ha-card-background?

If so try card-background-color instead. I think that’s what fixed the pop-up header colour for me.

1 Like

That was it, thanks!

time_changed should go down to 1 or 0 in 0.114 :slight_smile:

4 Likes

I’m tempted to ask how you managed to do this but am not sure I’d understand the answer.

Is it something like, taking 50 processes watching for an individual state change and replacing them with one process that looks for any change in state and then compares it to the 50 we’re interested in?

1 Like

Please default automation to queued
 just update my dev env to 113 and found non stop warning for automation and script
 Yes, they are valid automation.

With 0.113 update xiaomi hub and all the xiaomi devices have disconnected. Does anyone experience the same issue?

remove from YAML and add using intergration
 this is since 112

1 Like

Since I updated to Version 0.113. After some hours, the system goes likely into something like deep sleep. The syslog shows hrtimer: Interrupt took 9425827 ns. After some refreshes of webui, homeassistant gets available. Homeassistant is running in a Qemu VM under Proxmox.