{
  "title": "Motion Control",
  "views": [
    {
      "title": "Board demo",
      "path": "demo",
      "icon": "mdi:chip",
      "type": "sections",
      "max_columns": 3,
      "sections": [
        {
          "type": "grid",
          "column_span": 2,
          "cards": [
            {
              "type": "heading",
              "heading": "Motor controls",
              "icon": "mdi:engine",
              "heading_style": "title"
            },
            {
              "type": "tile",
              "entity": "switch.motion_control_core_motors_enabled",
              "name": "Shared motor enable",
              "icon": "mdi:engine",
              "tap_action": {
                "action": "toggle"
              },
              "grid_options": {
                "columns": 12,
                "rows": 2
              }
            },
            {
              "type": "button",
              "entity": "button.motion_control_core_stop_all_motors",
              "name": "STOP ALL MOTORS",
              "icon": "mdi:stop-circle",
              "show_state": false,
              "tap_action": {
                "action": "perform-action",
                "perform_action": "button.press",
                "target": {
                  "entity_id": "button.motion_control_core_stop_all_motors"
                }
              },
              "hold_action": {
                "action": "none"
              },
              "grid_options": {
                "columns": 12,
                "rows": 2
              }
            },
            {
              "type": "entities",
              "show_header_toggle": false,
              "entities": [
                {
                  "entity": "number.motion_control_core_jog_speed",
                  "name": "Jog speed (mm/s)",
                  "icon": "mdi:speedometer"
                }
              ],
              "grid_options": {
                "columns": 24,
                "rows": "auto"
              }
            },
            {
              "type": "vertical-stack",
              "cards": [
                {
                  "type": "entities",
                  "title": "X motor",
                  "show_header_toggle": false,
                  "entities": [
                    {
                      "entity": "number.motion_control_core_x_current",
                      "name": "Current (A)",
                      "icon": "mdi:current-dc"
                    }
                  ]
                },
                {
                  "type": "horizontal-stack",
                  "cards": [
                    {
                      "type": "button",
                      "entity": "button.motion_control_core_x_reverse_200_steps",
                      "name": "−50 mm",
                      "icon": "mdi:arrow-left-bold",
                      "show_state": false,
                      "tap_action": {
                        "action": "perform-action",
                        "perform_action": "button.press",
                        "target": {
                          "entity_id": "button.motion_control_core_x_reverse_200_steps"
                        }
                      },
                      "hold_action": {
                        "action": "none"
                      }
                    },
                    {
                      "type": "button",
                      "entity": "button.motion_control_core_x_forward_200_steps",
                      "name": "+50 mm",
                      "icon": "mdi:arrow-right-bold",
                      "show_state": false,
                      "tap_action": {
                        "action": "perform-action",
                        "perform_action": "button.press",
                        "target": {
                          "entity_id": "button.motion_control_core_x_forward_200_steps"
                        }
                      },
                      "hold_action": {
                        "action": "none"
                      }
                    }
                  ]
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": "auto"
              }
            },
            {
              "type": "vertical-stack",
              "cards": [
                {
                  "type": "entities",
                  "title": "Y1 motor",
                  "show_header_toggle": false,
                  "entities": [
                    {
                      "entity": "number.motion_control_core_y1_current",
                      "name": "Current (A)",
                      "icon": "mdi:current-dc"
                    }
                  ]
                },
                {
                  "type": "horizontal-stack",
                  "cards": [
                    {
                      "type": "button",
                      "entity": "button.motion_control_core_y1_reverse_200_steps",
                      "name": "−50 mm",
                      "icon": "mdi:arrow-left-bold",
                      "show_state": false,
                      "tap_action": {
                        "action": "perform-action",
                        "perform_action": "button.press",
                        "target": {
                          "entity_id": "button.motion_control_core_y1_reverse_200_steps"
                        }
                      },
                      "hold_action": {
                        "action": "none"
                      }
                    },
                    {
                      "type": "button",
                      "entity": "button.motion_control_core_y1_forward_200_steps",
                      "name": "+50 mm",
                      "icon": "mdi:arrow-right-bold",
                      "show_state": false,
                      "tap_action": {
                        "action": "perform-action",
                        "perform_action": "button.press",
                        "target": {
                          "entity_id": "button.motion_control_core_y1_forward_200_steps"
                        }
                      },
                      "hold_action": {
                        "action": "none"
                      }
                    }
                  ]
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": "auto"
              }
            },
            {
              "type": "vertical-stack",
              "cards": [
                {
                  "type": "entities",
                  "title": "Y2 motor",
                  "show_header_toggle": false,
                  "entities": [
                    {
                      "entity": "number.motion_control_core_y2_current",
                      "name": "Current (A)",
                      "icon": "mdi:current-dc"
                    }
                  ]
                },
                {
                  "type": "horizontal-stack",
                  "cards": [
                    {
                      "type": "button",
                      "entity": "button.motion_control_core_y2_reverse_200_steps",
                      "name": "−50 mm",
                      "icon": "mdi:arrow-left-bold",
                      "show_state": false,
                      "tap_action": {
                        "action": "perform-action",
                        "perform_action": "button.press",
                        "target": {
                          "entity_id": "button.motion_control_core_y2_reverse_200_steps"
                        }
                      },
                      "hold_action": {
                        "action": "none"
                      }
                    },
                    {
                      "type": "button",
                      "entity": "button.motion_control_core_y2_forward_200_steps",
                      "name": "+50 mm",
                      "icon": "mdi:arrow-right-bold",
                      "show_state": false,
                      "tap_action": {
                        "action": "perform-action",
                        "perform_action": "button.press",
                        "target": {
                          "entity_id": "button.motion_control_core_y2_forward_200_steps"
                        }
                      },
                      "hold_action": {
                        "action": "none"
                      }
                    }
                  ]
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": "auto"
              }
            },
            {
              "type": "vertical-stack",
              "cards": [
                {
                  "type": "entities",
                  "title": "Z motor",
                  "show_header_toggle": false,
                  "entities": [
                    {
                      "entity": "number.motion_control_core_z_current",
                      "name": "Current (A)",
                      "icon": "mdi:current-dc"
                    }
                  ]
                },
                {
                  "type": "horizontal-stack",
                  "cards": [
                    {
                      "type": "button",
                      "entity": "button.motion_control_core_z_reverse_200_steps",
                      "name": "−50 mm",
                      "icon": "mdi:arrow-left-bold",
                      "show_state": false,
                      "tap_action": {
                        "action": "perform-action",
                        "perform_action": "button.press",
                        "target": {
                          "entity_id": "button.motion_control_core_z_reverse_200_steps"
                        }
                      },
                      "hold_action": {
                        "action": "none"
                      }
                    },
                    {
                      "type": "button",
                      "entity": "button.motion_control_core_z_forward_200_steps",
                      "name": "+50 mm",
                      "icon": "mdi:arrow-right-bold",
                      "show_state": false,
                      "tap_action": {
                        "action": "perform-action",
                        "perform_action": "button.press",
                        "target": {
                          "entity_id": "button.motion_control_core_z_forward_200_steps"
                        }
                      },
                      "hold_action": {
                        "action": "none"
                      }
                    }
                  ]
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": "auto"
              }
            }
          ]
        },
        {
          "type": "grid",
          "cards": [
            {
              "type": "heading",
              "heading": "Lighting & outputs",
              "icon": "mdi:led-strip-variant",
              "heading_style": "title"
            },
            {
              "type": "tile",
              "entity": "light.motion_control_core_rgb",
              "name": "RGB · WS2812",
              "tap_action": {
                "action": "more-info"
              },
              "features": [
                {
                  "type": "light-brightness"
                },
                {
                  "type": "light-color",
                  "controls": "hue_saturation"
                },
                {
                  "type": "light-color-favorites"
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": 4
              }
            },
            {
              "type": "tile",
              "entity": "light.motion_control_core_header_pwm_1",
              "name": "AUX · PWM 1",
              "features": [
                {
                  "type": "light-brightness"
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": 2
              }
            },
            {
              "type": "tile",
              "entity": "light.motion_control_core_header_pwm_2",
              "name": "AUX · PWM 2",
              "features": [
                {
                  "type": "light-brightness"
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": 2
              }
            },
            {
              "type": "tile",
              "entity": "light.motion_control_core_spindle_pwm",
              "name": "Spindle · PWM",
              "features": [
                {
                  "type": "light-brightness"
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": 2
              }
            },
            {
              "type": "tile",
              "entity": "light.motion_control_core_laser_port_pwm",
              "name": "Laser port · PWM",
              "features": [
                {
                  "type": "light-brightness"
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": 2
              }
            },
            {
              "type": "tile",
              "entity": "switch.motion_control_core_spindle_relay",
              "name": "Spindle relay",
              "icon": "mdi:electric-switch",
              "grid_options": {
                "columns": 12,
                "rows": 1
              }
            }
          ]
        },
        {
          "type": "grid",
          "column_span": 2,
          "cards": [
            {
              "type": "heading",
              "heading": "Inputs & interlocks",
              "icon": "mdi:shield-check-outline",
              "heading_style": "title"
            },
            {
              "type": "entities",
              "title": "Door & safety inputs",
              "show_header_toggle": false,
              "state_color": true,
              "entities": [
                {
                  "entity": "binary_sensor.motion_control_core_e_stop",
                  "name": "E-stop",
                  "icon": "mdi:stop-circle-outline"
                },
                {
                  "entity": "binary_sensor.motion_control_core_door",
                  "name": "Door",
                  "icon": "mdi:door"
                },
                {
                  "entity": "binary_sensor.motion_control_core_motor_fault",
                  "name": "Motor fault",
                  "icon": "mdi:alert-circle-outline"
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": "auto"
              }
            },
            {
              "type": "entities",
              "title": "Limits & switches",
              "show_header_toggle": false,
              "state_color": true,
              "entities": [
                {
                  "entity": "binary_sensor.motion_control_core_x_limit",
                  "name": "X limit",
                  "icon": "mdi:ray-end"
                },
                {
                  "entity": "binary_sensor.motion_control_core_y1_limit",
                  "name": "Y1 limit",
                  "icon": "mdi:ray-end"
                },
                {
                  "entity": "binary_sensor.motion_control_core_y2_limit",
                  "name": "Y2 limit",
                  "icon": "mdi:ray-end"
                },
                {
                  "entity": "binary_sensor.motion_control_core_z_limit",
                  "name": "Z limit",
                  "icon": "mdi:ray-end"
                },
                {
                  "entity": "binary_sensor.motion_control_core_probe",
                  "name": "Probe"
                },
                {
                  "entity": "binary_sensor.motion_control_core_toolsetter",
                  "name": "Toolsetter"
                },
                {
                  "entity": "binary_sensor.motion_control_core_mode_button",
                  "name": "Mode button"
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": "auto"
              }
            }
          ]
        },
        {
          "type": "grid",
          "cards": [
            {
              "type": "heading",
              "heading": "Power monitor",
              "icon": "mdi:lightning-bolt",
              "heading_style": "title"
            },
            {
              "type": "gauge",
              "entity": "sensor.motion_control_core_supply_voltage",
              "name": "Supply voltage",
              "min": 0,
              "max": 32,
              "needle": true,
              "grid_options": {
                "columns": 12,
                "rows": 3
              }
            },
            {
              "type": "entities",
              "show_header_toggle": false,
              "entities": [
                {
                  "entity": "sensor.motion_control_core_supply_current",
                  "name": "Current"
                },
                {
                  "entity": "sensor.motion_control_core_supply_power",
                  "name": "Power"
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": "auto"
              }
            },
            {
              "type": "history-graph",
              "title": "Last hour",
              "hours_to_show": 1,
              "entities": [
                {
                  "entity": "sensor.motion_control_core_supply_voltage",
                  "name": "Supply voltage"
                }
              ],
              "grid_options": {
                "columns": 12,
                "rows": 3
              }
            }
          ]
        }
      ]
    }
  ]
}