Group state 'unknown' upon reload groups while all entities are 'on'

having a group with a few critical devices only having states ‘on’ or ‘off’, I still see this happening:

This isn’t always the case, but, on reloading groups and testing for unknown entities, this pops up.
I’ve even used the all: option to force the group to only be ‘on’ if all entities are ‘on’:

  critical_devices:
    name: Critical devices
    icon: mdi:toggle-switch
    all: true
    entities:
        - sensor.cv_garage_state
        - sensor.cv_stookhok_state
        - sensor.cv_zolder_state
        - sensor.zonneboiler_zolder_state
        - sensor.freezer_bijkeuken_state
        - sensor.koelkast_keuken_state

is this a bug (maybe on the reload)? or, is it the fact this group uses domain sensor (which is not listed in the supported domains)

how odd it is then, that this group is not always ‘unknown’ …

or, using this group, with a lot of sensors and mixed domains:

nicely being ‘off’. Or a group with only input_booleans, getting the state on/off, while it isn’t listed either.

Not a bug, they are sensors. Make them binary sensors.

yeah, as said, that could be something to go on,
but look at this:

nothings going on. It doesn’t resolve the state based on the domain. It resolves states based on the known states on/off/etc. binary_sensors aren’t unknown at startup where sensors are.

I feel like we’ve had this conversation about 10 times now since the startup changes occurred but with different platforms & integrations.

dont think it is that simple. these are MQTT sensors, and are loaded way before the group platform is ready, or other platforms are visible in the frontend (indicated by the yellow Bar during startup.)

sorry for the longer snippet, but it describes what’s happening at startup, first MQTT is setup, and, after quite a few other domains, group is setup.
As you can see, other integrations even wait for it to be ready, including the template domain.

2020-10-09 13:16:32 INFO (MainThread) [homeassistant.setup] Setting up mqtt
2020-10-09 13:16:32 INFO (MainThread) [homeassistant.setup] Setup of domain mqtt took 0.0 seconds
2020-10-09 13:16:32 INFO (MainThread) [homeassistant.setup] Setting up profiler
2020-10-09 13:16:32 INFO (MainThread) [homeassistant.setup] Setup of domain profiler took 0.0 seconds
2020-10-09 13:16:32 INFO (MainThread) [homeassistant.setup] Setting up timer
2020-10-09 13:16:32 INFO (MainThread) [homeassistant.setup] Setting up input_number
2020-10-09 13:16:34 INFO (MainThread) [homeassistant.setup] Setting up binary_sensor
2020-10-09 13:16:34 INFO (MainThread) [homeassistant.setup] Setup of domain binary_sensor took 0.0 seconds
2020-10-09 13:16:34 INFO (MainThread) [homeassistant.setup] Setup of domain light took 8.4 seconds
2020-10-09 13:16:34 INFO (MainThread) [homeassistant.setup] Setting up alarm_control_panel
2020-10-09 13:16:34 INFO (MainThread) [homeassistant.setup] Setup of domain alarm_control_panel took 0.0 seconds
2020-10-09 13:16:34 INFO (MainThread) [homeassistant.setup] Setup of domain life360 took 4.0 seconds
2020-10-09 13:16:34 INFO (MainThread) [homeassistant.setup] Setup of domain zeroconf took 4.0 seconds
2020-10-09 13:16:34 INFO (MainThread) [homeassistant.setup] Setting up geo_location
2020-10-09 13:16:34 INFO (MainThread) [homeassistant.setup] Setup of domain geo_location took 0.0 seconds
2020-10-09 13:16:34 INFO (MainThread) [homeassistant.setup] Setting up media_player
2020-10-09 13:16:34 INFO (MainThread) [homeassistant.setup] Setup of domain media_player took 0.0 seconds
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:34 INFO (MainThread) [homeassistant.setup] Setup of domain logbook took 9.3 seconds
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setting up tradfri
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setup of domain tradfri took 0.0 seconds
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setting up ipp
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setup of domain ipp took 0.0 seconds
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setting up plugwise
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setup of domain plugwise took 0.0 seconds
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setup of domain tag took 9.3 seconds
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setting up weather
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setup of domain weather took 0.0 seconds
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setting up switch
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setup of domain switch took 0.0 seconds
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setup of domain ffmpeg took 4.8 seconds
2020-10-09 13:16:35 INFO (MainThread) [homeassistant.setup] Setting up notify
2020-10-09 13:16:36 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:36 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:36 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2020-10-09 13:16:36 INFO (MainThread) [homeassistant.setup] Setting up samsungtv
2020-10-09 13:16:36 INFO (MainThread) [homeassistant.setup] Setup of domain samsungtv took 0.0 seconds
2020-10-09 13:16:36 INFO (MainThread) [homeassistant.setup] Setting up wake_on_lan
2020-10-09 13:16:36 INFO (MainThread) [homeassistant.setup] Setup of domain wake_on_lan took 0.0 seconds
2020-10-09 13:16:36 INFO (MainThread) [homeassistant.setup] Setup of domain variable took 5.9 seconds
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setting up stt
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setup of domain stt took 0.0 seconds
2020-10-09 13:16:37 WARNING (MainThread) [homeassistant.setup] Setup of feedreader is taking over 10 seconds.
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setting up denonavr
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setting up sonos
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setup of domain sonos took 0.0 seconds
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setting up synology_dsm
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setup of domain synology_dsm took 0.0 seconds
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setting up hue
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setup of domain hue took 0.0 seconds
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setting up ssdp
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setup of domain ssdp took 0.0 seconds
2020-10-09 13:16:37 WARNING (MainThread) [homeassistant.setup] Setup of input_text is taking over 10 seconds.
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setup of domain scene took 11.2 seconds
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setup of domain feedreader took 11.4 seconds
2020-10-09 13:16:37 INFO (MainThread) [homeassistant.setup] Setup of domain group took 7.3 seconds

this is at startup. Upon reload groups, this group changes back to unknown, even when all states of the entities in the group are fully known to the state machine.
Isn’t that odd then?
Second to that, they tend not to change to frequently (as a matter of fact, they should ideally never,) so how come the system changes from ‘unknown’ to ‘on’ again.

I do have 1 other automation happening on reload we discussed about, but that’s still a mystery to me too.

Even so, if it is a general thing, maybe something needs to be checked not to have this happen.

Nothing needs to be checked because this is outside the scope for the intentions of a group. It specifically says that they update based on the domain list in the docs. If the behavior changed, that’s on you because you are using it outside it’s intended use case. You know how to fix it, change them all to binary_sensors.

ok, cool.

group:

  critical_devices:
    name: Critical devices
    icon: mdi:toggle-switch
    all: true
    entities:
      - binary_sensor.cv_garage
      - binary_sensor.cv_stookhok
      - binary_sensor.cv_zolder
      - binary_sensor.zonneboiler_zolder
      - binary_sensor.freezer_bijkeuken
      - binary_sensor.koelkast_keuken

based on the same MQTT topic, now in an Mqtt binary_sensor
this

  - platform: mqtt
    name: Freezer Garage
    state_topic: '70:A3:B5:6C:31:D2/powerswitch-zwave/df12g93e/state'
    payload_on: 'on'
    payload_off: 'off'
    qos: 0
    device_class: power

versus:

  - platform: mqtt
    state_topic: '70:A3:B5:6C31:D2/powerswitch-zwave/df12g93e/state'
    name: Freezer Garage state
    force_update: true

can confirm the group is on at reload.

1 Like