- Introduced `scripts/mqtt_z2m_diag.py` for reusable MQTT and Zigbee2MQTT diagnostics. - Added `copilot-instructions.md` section for MQTT/Zigbee diagnostics tool usage. - Created `docs/mqtt-broker-broad-analysis.md` for comprehensive MQTT broker analysis. - Documented Salotto Overview Switch investigation in `docs/salotto-overview-switch-investigation.md`.
12 KiB
Salotto Overview Switch Investigation
Date: 2026-04-17
Instance: Casa
No write actions were taken during this pass. This was a read-only Home Assistant investigation.
Scope
This document investigates why the main Salotto light control in the Overview dashboard no longer works, while the individual Salotto lights still turn on correctly.
MQTT-level debugging was not needed for this pass because the Home Assistant entity, dashboard, history, and automation data were enough to isolate the problem.
Executive Summary
The Overview control is not directly toggling the Salotto light group.
Instead:
- The card displays
light.luci_buone_salotto. - Its tap action calls
switch.toggleonswitch.nitori_salotto_1_left. - The automation
automation.pulsanti_luce_salottolistens for changes on that switch and then turnslight.luci_buone_salottoon or off.
That means the dashboard button depends on an indirect path:
Overview card -> switch.nitori_salotto_1_left -> automation.pulsanti_luce_salotto -> light.luci_buone_salotto
Right now that path is out of sync:
light.luci_buone_salottois currentlyoffswitch.nitori_salotto_1_leftis currentlyon- the switch has not changed state since
2026-04-14T16:17:11Z - the light group has continued changing independently through
2026-04-17T09:59:53Z
So the Overview card is using the light group as its displayed state, but it is controlling a different entity whose state no longer matches the light group. That is the reason the button appears broken.
Confirmed Facts
1. The Casa instance was queried
The active Home Assistant instance returned:
- location name:
Home - base URL:
http://supervisor/core - architecture: Casa-sized instance with about
1414entities and11areas
This matches the expected Casa fingerprint.
2. The Overview dashboard Salotto control targets the wrong entity for a direct light toggle
In the lovelace dashboard, the main Salotto controls were found in multiple places, including:
.views[0].badges[4].views[0].sections[0].cards[1].views[9].sections[0].cards[3]
All of them display light.luci_buone_salotto, but the action is:
tap_action:
action: perform-action
perform_action: switch.toggle
target:
entity_id:
- switch.nitori_salotto_1_left
The icon tap action is wired the same way.
So the card is not toggling the light entity it displays.
3. The switch is part of a Zigbee2MQTT wall switch device
switch.nitori_salotto_1_left belongs to device:
- device:
nitori_salotto_1 - model:
Smart light switch - 3 gang without neutral wire - integration:
zigbee2mqtt
Related entities:
switch.nitori_salotto_1_leftswitch.nitori_salotto_1_centerswitch.nitori_salotto_1_right
4. The automation still links that switch to the Salotto light group
automation.pulsanti_luce_salotto is configured to react to state changes of the left switch and then control the group:
- if the switch is off ->
light.turn_offonlight.luci_buone_salotto - if the switch is on ->
light.turn_ononlight.luci_buone_salotto
So the dashboard button currently relies on this automation path instead of directly toggling the group.
5. The switch and the light group are no longer aligned
Current state snapshot:
switch.nitori_salotto_1_left:onlight.luci_buone_salotto:off
Recent history shows:
- the switch last changed on
2026-04-14T16:17:11Z - the light group continued changing after that, including:
2026-04-15T15:28:57Z->on2026-04-15T22:52:06Z->off2026-04-16T16:03:40Z->on2026-04-16T22:12:21Z->off2026-04-17T09:57:13Z->on2026-04-17T09:59:53Z->off
This confirms the light group is being controlled independently of the switch, so the dashboard button and the displayed light state can no longer be trusted to represent the same thing.
6. The automation path itself is not missing
Recent traces exist for automation.pulsanti_luce_salotto, including runs on 2026-04-13 and 2026-04-14, triggered by switch.nitori_salotto_1_left.
That means the automation definition is present and did run when the switch state changed. The issue is not a missing automation.
Diagnosis
The Overview control broke because it mixes:
- display state from
light.luci_buone_salotto - control action on
switch.nitori_salotto_1_left
This only behaves correctly while the switch state and the light group state stay synchronized.
They no longer do.
Once the switch remained on while the group was later turned off by some other path, pressing the Overview button stopped behaving like a normal room-light toggle. The card looks like a light control, but it is really driving an unrelated intermediate switch entity.
Secondary Findings
light.salottoalso exists as a separate group entity that includes all Salotto lights.light.luce_salottoexists but is currentlyunavailableand appears to be a Tuya entity. It does not appear to be the Overview control target found in this investigation.- The main failure is the dashboard action wiring, not a full outage of the Salotto light entities.
Recommended Fix
The safest fix is to make the Overview Salotto card toggle the actual light group it displays instead of the wall-switch entity.
Good options:
- Change the card action to toggle
light.luci_buone_salottodirectly. - If the desired room-level target is broader, use
light.salottodirectly instead.
Less robust option:
- Keep the switch-based path and add more logic to keep the switch state synchronized with the light group.
That indirect design is the source of the breakage, so direct light control is the cleaner fix.
Applied Changes
The following Home Assistant changes were applied on the Casa instance during this pass:
- The
lovelaceOverview Salotto controls were changed to togglelight.luci_buone_salottodirectly instead of callingswitch.toggleonswitch.nitori_salotto_1_left. - A new automation,
automation.sync_salotto_control_switches, was created to mirror the state oflight.luci_buone_salottoback to:switch.nitori_salotto_1_leftswitch.switch_cucina_neo_l2
The intent of that automation is:
- when the light group turns on -> both control switches should be turned on
- when the light group turns off -> both control switches should be turned off
This preserves:
- direct and reliable dashboard control of the actual light group
- consistent switch state for the two wall-switch control paths
Additional Finding: the Nitori switch is currently stale at the service layer
After applying the config fix, a direct switch.turn_off call was sent to switch.nitori_salotto_1_left to reconcile its stale on state with the currently off light group.
The service call was accepted, but Home Assistant could not verify a state change.
Current evidence:
light.luci_buone_salottoisoffswitch.switch_cucina_neo_l2isoffswitch.nitori_salotto_1_leftstill reportsonswitch.nitori_salotto_1_lefthas not changed state since2026-04-14T16:17:11Z- Home Assistant system logs contain repeated warnings that
switch.nitori_salotto_1_leftis "missing or not currently available" when targeted by services
This means the original dashboard problem and the current switch-state problem are related but not identical:
- Dashboard problem: fixed by changing the card to control the light group directly.
- Nitori state-sync problem: still blocked because the
switch.nitori_salotto_1_leftentity is not currently accepting or reflecting Home Assistant service commands reliably.
Practical Conclusion
The reliable control path is now:
Overview card -> light.luci_buone_salotto
The intended synchronization path is now:
light.luci_buone_salotto -> automation.sync_salotto_control_switches -> both wall-switch entities
However, the Nitori leg of that sync will only work once switch.nitori_salotto_1_left is healthy again at the Zigbee2MQTT/device layer.
So the configuration fix is in place, but full synchronization of the Salotto Nitori switch still depends on restoring normal commandability of that switch entity.
MQTT and Zigbee2MQTT Restore Diagnostics
Broker-level MQTT diagnostics were run against the Casa Zigbee2MQTT base topic after creating the local file:
.local/mqtt-home.env
What Zigbee2MQTT still knows about the device
The retained bridge/devices record still contains nitori_salotto_1:
- friendly name:
nitori_salotto_1 - IEEE address:
0xa4c1386a5b20e7a7 - model:
TS0013 - vendor:
Tuya - interview state:
SUCCESSFUL - supported:
true - type:
EndDevice
So the device has not been removed from Zigbee2MQTT and still exists in the coordinator database.
Important difference vs the working kitchen switch
Using the same broker-level probe against the working fallback switch Switch_Cucina_Neo produced:
- a live topic payload on
zigbee2mqtt_2/Switch_Cucina_Neo - fresh state values such as
state_l2 - a successful response on
zigbee2mqtt_2/bridge/response/device/configure
Using the same probe against nitori_salotto_1 produced:
- no live topic payload on
zigbee2mqtt_2/nitori_salotto_1 - no availability payload
- no bridge log output
- no response on
zigbee2mqtt_2/bridge/response/device/configure
This is a strong indicator that Zigbee2MQTT still has the device definition, but the device is not currently responding on the Zigbee network.
What this means
At this point the likely fault domain is one of:
- the switch has lost effective connectivity to the Zigbee mesh
- the switch is powered but stuck and not answering Zigbee commands
- the device has fallen off the mesh badly enough that reconfigure requests never complete
This is not behaving like a dashboard, automation, or Home Assistant entity-registry issue anymore.
Best Next Restore Step
The highest-probability recovery action now is:
- physically power-cycle the Nitori switch circuit or otherwise restore power to the device
- immediately retest Zigbee2MQTT commandability
- if it still does not answer, re-pair or re-interview the device in Zigbee2MQTT while preserving the same friendly name if possible
Because the kitchen comparison proved the MQTT request flow is correct, there is no value in continuing to tweak the Home Assistant dashboard or automation config until the Nitori device starts answering Zigbee2MQTT again.
Successful Recovery
The device was recovered without a power-cycle by putting nitori_salotto_1 back into pairing mode while Zigbee2MQTT permit-join was open.
During the recovery watch, Zigbee2MQTT reported:
bridge/response/permit_joinwithstatus: okbridge/eventwithtype: device_announcefornitori_salotto_1- fresh live payloads again on
zigbee2mqtt_2/nitori_salotto_1
Fresh MQTT payloads after re-announce included:
state_left: OFFstate_center: OFFstate_right: OFFbacklight_mode: normal- linkquality around
134-145
After the re-announce:
- Home Assistant updated
switch.nitori_salotto_1_leftback tooff switch.nitori_salotto_1_rightalso recovered from stale state and updated tooff- the Salotto light group and kitchen fallback switch remained synchronized
Final validation:
- The left Nitori button was pressed once after recovery.
switch.nitori_salotto_1_leftchanged fromofftoon.light.luci_buone_salottoturnedonimmediately after.switch.switch_cucina_neo_l2was then synchronized toonbyautomation.sync_salotto_control_switches.
So the switch is now restored at the Zigbee2MQTT layer and the end-to-end control path is working again:
nitori_salotto_1_left -> automation.pulsanti_luce_salotto -> light.luci_buone_salotto -> automation.sync_salotto_control_switches -> fallback switch state