Dafang PTZ preset

Does anybody use preset to their xiaomi dafang camera? is there some mqtt should be called?
Meanwhile I figured out by using shell_command an their web like "

...action.cgi?cmd=motor_PTZ&x_axis=100&y_axis=2500

but maybe there’s a better way?

There are mqtt commands for left/right/up/down. I am not sure about absolute positioning.

Yes, i have it, it doesn’t help.

You can use the Cover position.
If your Xiaomi Dafang is intergrated with mqtt. That means that you have the 2 entities
cover.dafang_move_up_down
cover.dafang_move_right_left
For example :

alias: DaFang_RestPosition
   sequence:
  - data:
      position: 0
    entity_id: cover.dafang_move_left_right
    service: cover.set_cover_position
  - data:
      position: 0
    entity_id: cover.dafang_move_up_down
    service: cover.set_cover_position

and for the Record Position

  alias: DaFang_RecordPosition
  sequence:
  - data:
      position: 50
    entity_id: cover.dafang_move_left_right
    service: cover.set_cover_position
  - data:
      position: 50
    entity_id: cover.dafang_move_up_down
    service: cover.set_cover_position
1 Like