🔘

long_short_toggle_4_magic_cube_and_other_things - 2023-12-07 by SirGoodenough

This script was invented to be used with my Magic Cube Blueprints. I released it as a standalone Script Blueprint because I saw others struggling with how so convert cube rotation to actions in other places.

To use this blueprint, install it from the source in the normal way. After that add your unique name for the Script, and add an icon and change the entity_id if desired. You should only need to run the blueprint once, as you will be calling the unique name/entity you added above to use the code. This script has no inputs in the Blueprint screen because all the data is added to control the action live at each use.

This requires you call this script with a couple of data values. One is a positive or negative number between 360 and -360 that in the original, represents the input angle from the cube movement. The other data point is the entity of the device(s) that you are trying o control. Only 1 of the short_entity or long_entity is required 4 this Blueprint to work.
NOTE: the trigger variable below will be different for Z2M and ZHA and others. Look at my documentation for that cube integration help if you need it.

Sample call / use of this script with ZHA:
yaml - service: script.cube_long_short_toggle data: angle: '{{ trigger.event.data.args.relative_degrees | default(0.1) | float(0.2) }}' short_entity: light.kitchen_down_lights long_entity: light.kitchensink

Sample call / use of this script with Z2M:
yaml - service: script.cube_long_short_toggle data: angle: '{{ trigger.payload_json.action_angle | default(0.1) | float(0.2) }}' short_entity: light.kitchen_down_lights long_entity: light.kitchensink

🗿Notice👮🏿‍♂️:

  • Copies of the original Blueprint that were converted via the 'Take Control' feature or other means are officially not supported by me.

  • I may or may not be able to support you when you have a problem after you make changes to my code, as some of the code is no longer mine.

  • I & my license also require attribution as a link back to the original should you use this code in your own creation.

  • Here is a link to my license & the original github post expected to be followed & referenced as attribution should you use this code elsewhere.

200
Stars
5.1K
Views
961
Imports

Import to Home Assistant

Click to import this blueprint directly into your Home Assistant instance.

Configuration

Requires 0 inputs to configure

Source Code

View on GitHub

Details

Complexity
Simple
Author
SirGoodenough
Last Updated
Nov 4, 2025

Related Blueprints

More button actions automations you might like

View all
🔘
Button Actions
complex
17 inputs

Send a mobile notification when add-on update is available

Send a mobile notification when add-on update is available

Send a notification to the provided mobile devices whenever an update for the given Home Assistant add-on is available. Supports full notification customization, notification groups, auto-dismissal when the add-on is updated and button for starting the update directly from your notification tray, with optional notification after the update completed succesfully. 📕 Full documentation regarding this blueprint is available here. 🚀 This blueprint is part of the Awesome HA Blueprints project. ℹ️ Version 2021.10.26
addon
text
entity
+2
1.2K1.6K2.5K
🔘
Button Actions
complex
37 inputs

Controller - IKEA E1524/E1810 TRÅDFRI Wireless 5-Button Remote

Controller - IKEA E1524/E1810 TRÅDFRI Wireless 5-Button Remote

Controller automation for executing any kind of action triggered by the provided IKEA E1524/E1810 TRÅDFRI Wireless 5-Button Remote. Allows to optionally loop an action on a button long press. Supports deCONZ, ZHA, Zigbee2MQTT. Automations created with this blueprint can be connected with one or more Hooks supported by this controller. Hooks allow to easily create controller-based automations for interacting with media players, lights, covers and more. See the list of Hooks available for this controller for additional details.

More Info

ℹ️ Version 2025.04.19 📝 Changelog 📕 Full documentation regarding this blueprint is available here. 🚀 This blueprint is part of the Awesome HA Blueprints project. Please consider leaving a star on GitHub! 🌟
select
device
entity
+3
1.2K9.2K702
🔘
Button Actions
complex
19 inputs

Controller - IKEA E1743 TRÅDFRI On/Off Switch & Dimmer

Controller - IKEA E1743 TRÅDFRI On/Off Switch & Dimmer

Controller automation for executing any kind of action triggered by the provided IKEA E1743 TRÅDFRI On/Off Switch & Dimmer. Allows to optionally loop an action on a button long press. Supports deCONZ, ZHA, Zigbee2MQTT. Automations created with this blueprint can be connected with one or more Hooks supported by this controller. Hooks allow to easily create controller-based automations for interacting with media players, lights, covers and more. See the list of Hooks available for this controller for additional details.

More Info

ℹ️ Version 2025.04.19 📝 Changelog 📕 Full documentation regarding this blueprint is available here. 🚀 This blueprint is part of the Awesome HA Blueprints project. Please consider leaving a star on GitHub! 🌟
select
device
entity
+3
1.2K1.7K786
🔘
Button Actions
complex
15 inputs

Controller - IKEA E1744 SYMFONISK Rotary Remote

Controller - IKEA E1744 SYMFONISK Rotary Remote

Controller automation for executing any kind of action triggered by the provided IKEA E1744 SYMFONISK Rotary Remote. Allows to optionally loop a custom action during controller rotation. Supports deCONZ, ZHA, Zigbee2MQTT. Automations created with this blueprint can be connected with one or more Hooks supported by this controller. Hooks allow to easily create controller-based automations for interacting with media players, lights, covers and more. See the list of Hooks available for this controller for additional details.

More Info

ℹ️ Version 2025.04.19 📝 Changelog 📕 Full documentation regarding this blueprint is available here. 🚀 This blueprint is part of the Awesome HA Blueprints project. Please consider leaving a star on GitHub! 🌟
select
device
entity
+3
1.2K6.0K4.8K
🔘
Button Actions
complex
13 inputs

Controller - IKEA E1766 TRÅDFRI Open/Close Remote

Controller - IKEA E1766 TRÅDFRI Open/Close Remote

Controller automation for executing any kind of action triggered by the provided IKEA E1766 TRÅDFRI Open/Close Remote. Supports deCONZ, ZHA, Zigbee2MQTT. Automations created with this blueprint can be connected with one or more Hooks supported by this controller. Hooks allow to easily create controller-based automations for interacting with media players, lights, covers and more. See the list of Hooks available for this controller for additional details.

More Info

ℹ️ Version 2025.04.19 📝 Changelog 📕 Full documentation regarding this blueprint is available here. 🚀 This blueprint is part of the Awesome HA Blueprints project. Please consider leaving a star on GitHub! 🌟
select
device
entity
+3
1.2K10.6K4.0K