Toggle a switch

Hello folks,
please allow me a stupid question. I want simply toggle a switch based on sensor data via Node-RED.

I bought a Gosund Smart socket and a Xiaomi Aqara Magic Cube.

The integrations of the Gosund Smart Socket via Wifi and ToyaLocal as well as Xiaomi Aqara Magic Cube via Zigbee and MQTT were successful.

The socket switch.smart_socket_d_kuchel_kaffee_local can be switched successfully in the UI:

The Xiami Cube sensor works great as well:

Back in Node-RED

  1. The sensor payload can be debugged perfectly.

  2. But I’m not able to toggle the switch switch.smart_socket_d_kuchel_kaffee_local
    Question a: How can I toggle a switch in Node Red?
    Question b: How can I switch on and switch of the entity switch.smart_socket_d_kuchel_kaffee_local?
    Which nodes do I’ve to take with which config?

Thank you for your replay

have you tried a call service node?

1 Like

It is a dream. Thank you so much! A was searching 2 hours for a documentation.