Two automations not turning on/off lights

Hi

Ive got two different light ramps with three gui10 lights that are controlled by a button. Ive made automations to turn them on and off which worked initially. But now, one of the three lights doenst turn on and off via the button. Both work fine. And running the automation via the meny turns it on and off. Its just the button function that doesnt work?

Any work around? Using device to catch and trigger when its pressed

Code? Logs? Something to look at?

Ofc, want code for the automation? Logs doesnt say anything besides that the event has triggered " action on" or do you mean a different log.

This is one of them. I use the ui to create them.

alias: släck noels tak
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: 34710e313a8839b69996958250aacf60
    type: action
    subtype: "off"
    discovery_id: 0x804b50fffee9fa1b action_off
condition: []
action:
  - type: turn_off
    device_id: 3421dfec32c31e604668d3c37aa52d49
    entity_id: 7c192ab25eb39388b39b0c2e62ef3ef3
    domain: light
  - type: turn_off
    device_id: 9d11d404193508a3256c1d43fa871c26
    entity_id: 56f7d472db8564ae6d5e840d5556e73f
    domain: light
  - type: turn_off
    device_id: c0f078c5587a943a7f50d13b2a5c70e3
    entity_id: ee8ab442381b1627f6c247f8f1e0c2f9
    domain: light
mode: single

Can you format the code properly?

and a tip, use service light.turn_off/on with entity names

service: light.turn_off
data: {}
target:
  entity_id:
    - light.light1
    - light.light2
    - light.light3

it will be a lot easier when you change the light f.e. because it is broken…just replace it and give it the same name :wink:

Understood i will try that instead. Could it be related to my problem?

Yes Sorry i will correct it.

If for some reason the device ID changed, it could be related…
It could also be that if one of the actions fails (or has an error code), it would terminate the automation, and therefor not call the remaining actions…

The turn_off service call has only one action, so even if one of them would return a failure, it would still call the service on all 3, as it executes simultaneously :wink:

PS: Totally agree with Arh…without proper code it will be difficult to assist :wink:

Ofcourse, my apologies. Ive hopefully corrected it now.

I will try the service part. Does that also mean i should catch the button command using services and not device?

Does issuing multiple commands at once become an issue? Should i place a pause somewhere? Its just strange that manually starting the automation works but not by triggering it. I can see thats its being triggered and executes other commands, its like its skipping the 3rd light

Here is the second automation. This time its a Wiz wifi light.

alias: sovrumsfjärr hold on
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: cb01538a81a7892e214d1bf4afa8b924
    type: action
    subtype: brightness_move_up
    discovery_id: 0x5c0272fffed123da action_brightness_move_up
condition: []
action:
  - type: turn_on
    device_id: 4d19c149e7509250cdfd3a5435c723d9
    entity_id: cbc13991372f4dcabfdcd984b3108622
    domain: switch
  - type: turn_on
    device_id: c022124f94d5669a2c2fa23bcb7e782f
    entity_id: 694704877c8dac543ed49f3a640cb855
    domain: light
  - type: turn_on
    device_id: 7dacc689bbcb33de4c0583566ecfbb05
    entity_id: c7d29e018a3baa8c11a12aeaa8dff595
    domain: light
  - type: turn_on
    device_id: 7bcce57df9739591bf58b5ed85c4a352
    entity_id: 1139193ed572162e0e6949b98533f318
    domain: light
mode: single

Edit: i noticed both lights that arent working are being called for at the last part. If that is significant.

No

It shouldn’t, but I think it is easier to debug

No

What does the automation trace say?


Also here there are device_id’s…try service/entity name…I think it is just more reliable

Could be; if you use the service call, you can combine them all in just one call :thinking:

Thx for your replies. I had another button/light combo fail on me when i got home. Ill redo the automation, write names instead and try service to see if it works out.

Thx for the help.

so i finally came home from work and checked the traces and none of the buttons which are ikea switches register. Yet, they control the lights. i have no idea whats firing to turn on and off the lights tbh, but despite turning them on and off several times just now, there is no trace of an event firing thats being catched by HA.

the one with the code above is this model:

could it be connected directly to the bulbs? it does have that function and i did reset the entire room at once.

Yes, Ikea switches can be connected directly to a bulb.

For HA to detect it, you’ll need to pair it with Z2M.
Once you press a button, you can see it in the Z2M logs:

Debug 2023-11-20 20:08:59Received Zigbee message from 'Switch Toilet Downstairs', type 'commandOff', cluster 'genOnOff', data '{}' from endpoint 1 with groupID 0
Info 2023-11-20 20:08:59MQTT publish: topic 'zigbee2mqtt/Switch Toilet Downstairs', payload '{"action":"off","battery":21,"click":"off","linkquality":87,"update":{"installed_version":570492465,"latest_version":604241926,"state":"available"},"update_available":true}

Once pared, it should also appear in HA as a switch [MQTT]

yes it was connected and was working when i configured the automations. its like its since then disconnected from that network and bonded with the lights.

im trying to rejoin it to the network but the interview fails each time. but it seems ive found what the problem is.

EDIT: finally got it to pair and setting the same name made it slot into the automations after doing the usual “function registration” with pressing and holding. its now working.

im guessing, since all my other switches are ikea similar to this model (both 2 button and 5 button) and i did the pairing in the same way, that this probably is the fault on the other ones. im going to reset them.

thanks for your help aceindy.

EDIT 2; using call service worked on the non ikea wifi light. thank you