#Aqara Opple switch not triggering
1 messages · Page 1 of 1 (latest)
info 2023-10-16 10:05:28: MQTT publish: topic 'zigbee2mqtt/0x04cf8cdf3c7c4cb5/action', payload 'button_1_single'````
description: ""
use_blueprint:
path: Datortarps/zigbee2mqtt-aqara-opple-switch-2-bands-blueprint-wxcjkg12lm.yaml
input:
switch: sensor.0x04cf8cdf3c7c4cb5_action
button_1_single:
- service: switch.toggle
data: {}
target:
entity_id: switch.office_standing```
Ive tried several different blueprints, none seem to trigger the automation. The blueprint im using above worked on another instance of HA with the same Aqara switch. Not sure what to do now
max_exceeded: silent
trigger:
- platform: state
entity_id: sensor.0x04cf8cdf3c7c4cb5_action
attribute: action
action:
- variables:
command: '{{ trigger.to_state.state }}'
- choose:
- conditions:
- '{{ command == ''button_1_single'' }}'
sequence:
- service: switch.toggle
data: {}
target:
entity_id: switch.office_standing```
there is no action attribute on those entities, remove that from the trigger
ok, so just make the trigger look like this?
- platform: state
entity_id: sensor.0x04cf8cdf3c7c4cb5_action
action:
- variables:
command: '{{ trigger.to_state.state }}'
....```
correct
Thanks! Ill give it a shot
Worked! Thanks so much, i just had to remove that line from the blueprint and it worked right away.
Ok, so I think my command is still wrong as the automation is triggering but the defined action isn't occurring. I see Choose: No action taken in the trace.
then the command was not button_1_single
It looks like it is in the z2m logs but im not totally sure im looking at the right thing: info 2023-10-16 10:05:28: MQTT publish: topic 'zigbee2mqtt/0x04cf8cdf3c7c4cb5/action', payload 'button_1_single'
Check the state changes of the entity
Easiest is to go to the device in HA and check the log there
all i see in the log book on the entity is 0x04cf8cdf3c7c4cb5 Action 11:57:52 AM - 18 minutes ago 0x04cf8cdf3c7c4cb5 Action changed to button_1_single 11:57:52 AM - 18 minutes ago 0x04cf8cdf3c7c4cb5 Action 11:57:16 AM - 18 minutes ago 0x04cf8cdf3c7c4cb5 Action changed to button_1_single
okay, and what do you see in the automation trace
especially when you click on the last step, and then changed variables
I see this in the changed variables command: button_1_single
In trace timeline though i see:
Triggered by the state of sensor.0x04cf8cdf3c7c4cb5_action at October 17, 2023 at 2:32:41 PM
Define variables command
Choose: Option 1 executed
(scene.office_open) turned 2023-10-17T18:32:41.671766+00:00
(scene.office_open) turned 2023-10-17T18:32:41.671944+00:00
Stopped because of unknown reason "null" at October 17, 2023 at 2:32:41 PM (runtime: 0.01 seconds)```
So it looks like its actually catching the command and looks like it's activating the scene but then maybe gets interrupted by the "unknown reason"?
Can you share the entire automation
Please use a code share site to share code or logs, for example:
- https://dpaste.org/ (select YAML for the language, and consider picking a longer expiry)
- http://pastie.org/ (select YAML for the language)
- https://paste.debian.net/ (you guessed it, select YAML as the language)
Please don't use Pastebin, since it can randomly add spaces to the main view. Please also don't share text as images since it makes it harder for people to help you. Remember that others may have colour blindness, impaired vision, etc.
This seems to be the action of the double press
I just changed the automation from "acivate scene" to "call service" --> toggle light and it works perfectly. So there seems to be something up with the activate scene.
Yeah, the automation seems to catch the right event but then doesnt actually activate the scene
And in the step detail trace i see Executed: October 17, 2023 at 4:05:37 PM Result: params: domain: scene service: turn_on service_data: {} target: entity_id: - scene.office_closed running_script: false
So its definitely getting to the right part of the automation. Its just not actually doing the scene change. The scene works when activated manually
@trim ledge Thanks for all your help so far! Any ideas on the above?
not sure, that result looks fine
does something happen if you put this in devtools > services
service: scene.turn_on
target:
entity_id: scene.office_closed
Yep, the scene activates like you would expect.
then I don't have a clue why it doesn't work in the automation, as that one performs the same thing
Is it possible that the state is changing back to no button pressed too quickly? I ask because I see an event in the trace timeline immediately after the button press event that I see the error on. And when i press the button the state changes extremely quickly, so much so that i cant see it really, its just a flicker.
Should i change that to single?
I would suggest to change the trigger
trigger:
platform: state
entity_id: sensor.0x04cf8cdf3c7c4cb5_action
not_to: "None"
Interesting. Changed to above and it did one action of the scene. The scenes are just a light and a switch either on or off. When i did the action to turn them off, the light went off but not the switch. Triggered by the state of sensor.0x04cf8cdf3c7c4cb5_action at October 18, 2023 at 4:33:53 PM Define variables command Choose: Option 1 executed (scene.office_closed) turned 2023-10-18T20:33:53.438682+00:00 (light.office_lamp) turned off Stopped because of unknown reason "null" at October 18, 2023 at 4:33:53 PM (runtime: 0.01 seconds)