this post was submitted on 05 Nov 2025
9 points (100.0% liked)

homeassistant

16933 readers
93 users here now

Home Assistant is open source home automation that puts local control and privacy first.
Powered by a worldwide community of tinkerers and DIY enthusiasts.

Home Assistant can be self-installed on ProxMox, Raspberry Pi, or even purchased pre-installed: Home Assistant: Installation

Discussion of Home-Assistant adjacent topics is absolutely fine, within reason.
If you're not sure, DM @GreatAlbatross@feddit.uk

founded 2 years ago
MODERATORS
 

I have an Inovelli White Series Matter+Thread light switch. It has a custom button called Config that you can use for automations. Config is listed under Events in Device Info. I've noticed some unexpected behavior whenever I run sudo docker compose restart.

Here's what happens after compose restart exits.

  • Home Assistant WebUI comes up
  • Inovelli switch entities become unavailable
  • 5 minutes passes in the unavailable state
  • Inovelli switch comes back to life, setting all of its entity's values back to what they were before
  • Config event fires

The Config event firing on reboot is really bad because it triggers an automation I have that listens for the Config event to fire...

How should I be coding the automation to ignore Config events from reboots? I found some Event docs and also a forum post, but they didn't turn out too helpful.

Here's the automation I came up with based on the links above. Unfortunately, this still triggers the automation on reboot.

alias: Inovelli switch 
description: ""
triggers:
  - trigger: state
    entity_id:
      - event.inovelli_on_off_switch_config
conditions:
  - condition: not
    conditions:
      - condition: state
        entity_id: event.inovelli_on_off_switch_config
        state: unavailable
      - condition: state
        entity_id: event.inovelli_on_off_switch_config
        state: unknown
actions:
  - choose:
      - conditions:
          - condition: state
            entity_id: event.inovelli_on_off_switch_config
            attribute: event_type
            state: multi_press_1
        sequence:
          - action: script.inovelli_switch_turn_on
            metadata: {}
            data: {}
mode: single

Running HA 2025.10.4 in Docker Compose.

top 9 comments
sorted by: hot top controversial new old
[–] CondorWonder@lemmy.ca 3 points 3 weeks ago (1 children)

I work around this with the uptime integration then conditions in automations that uptime must be over whatever time I want.

You could try using not_from in your state trigger but I’ve had limited success with that working recently. Something like this:

#…
  - trigger: state
    entity_id:
      - event.inovelli_on_off_switch_config
    not_from:
      - unavailable
      - unknown
#…
[–] paequ2@lemmy.today 2 points 3 weeks ago* (last edited 3 weeks ago) (1 children)

Aaaah, ok! Here's what I added based on your uptime idea.

conditions:
  - condition: state
    entity_id: switch.inovelli_on_off_switch_load_control
    state:
      - "on"
      - "off"
    for:
      hours: 0
      minutes: 3
      seconds: 0

I'm using if the switch has been in the "on" or "off" state for 3 minutes or more as my gate. (Since during the reboot the state is either "unavailable" or "unknown".)

Seems to be working so far! Thanks!

[–] Serinus@lemmy.world 2 points 3 weeks ago* (last edited 3 weeks ago) (1 children)

Does that mean you can't turn the light off and back on quickly, in the case of something like forgetting something in the room?

[–] paequ2@lemmy.today 1 points 3 weeks ago (1 children)

Uh, don't think so. Here's what the whole automation looks like.

alias: Inovelli switch 
description: ""
triggers:
  - trigger: state
    entity_id:
      - event.inovelli_on_off_switch_config
conditions:
  - condition: state
    entity_id: switch.inovelli_on_off_switch_load_control
    state:
      - "on"
      - "off"
    for:
      hours: 0
      minutes: 3
      seconds: 0
actions:
  - choose:
      - conditions:
          - condition: state
            entity_id: event.inovelli_on_off_switch_config
            attribute: event_type
            state: multi_press_1
        sequence:
          - action: script.inovelli_switch_turn_on
            metadata: {}
            data: {}
mode: single
  • Wait for a Config button press (different than on/off rocker button)
  • Check if main rocker button has been in "on" or "off" state for at least 3 minutes
  • If yes, then run script

The main on/off switch is unaffected by this automation. (Double checked to make sure I could turn on and off the fan quickly.)

[–] Serinus@lemmy.world 1 points 3 weeks ago

I read that as "on state for 3 minutes" or "off state for 3 minutes" and not a combination of on/off for 3 minutes. Easy to test. Turn the light off. Turn the light back on.

[–] JelleWho@lemmy.world 2 points 3 weeks ago (1 children)

I've used the "uptime" entity to see when HA has rebooted. This can also be intergrated into a condition

description: ""
triggers:
  - value_template: "{{ now() - states('sensor.uptime')|as_datetime > timedelta(minutes=1) }}"
    trigger: template
conditions: []
actions:
  - action: light.turn_off
    metadata: {}
    data: {}
    target:
      entity_id:
        - light.milight_hub_badkamer
        - light.milight_hub_wc
mode: single
[–] JelleWho@lemmy.world 2 points 3 weeks ago (1 children)

Another option I use is to filter our "from unknown"

alias: from_state != unknown
condition: template
value_template: "{{ trigger.from_state.state != 'unknown' }}"
[–] paequ2@lemmy.today 1 points 3 weeks ago (1 children)

I'm still new to HA, but it seems like since Config is an event I can't check if the previous state was from "unknown". That only works for things that have values? I think?

[–] JelleWho@lemmy.world 1 points 3 weeks ago* (last edited 3 weeks ago)

Go to your automation. Make sure it has triggered recently with your bug. Go to it's traces. Click on the trigger circle (if there are multiple) Scroll down and in 'step details' look at the "Changed variables" tab

What does it say?

Traces menu