Divoom Pixoo64 - Send Text (4 Lines)

What’s up smart homers! I was inspired by this project to create an automation blueprint that helps send text to the Pixoo64. The project referenced uses REST commands to control the Pixoo64, but I had to modify the “Send Text” REST command in order to make this blueprint work the way I wanted. Below is the blueprint, and following that are the all of the REST commands from the original project I referenced, but I’ve modified the “Sent Text” command and I’ve added a couple new ones. You need to add these to your rest_commands.yaml file or configuration.yaml file.

#Note: This blueprint requires rest commands to be set up in your Home Assistant instance.
blueprint:
  name: Send Text to Pixoo64
  description: Send text to the Pixoo64 - 4 lines, each can be their own color.
  source_url: https://community.home-assistant.io/t/divoom-pixoo64-send-text-4-lines/554428
  domain: automation
  input:
    text_line_1:
      name: Text Line 1
      description: Text to display on Line 1
      selector:
        text:
      default: false
    color_line_1:
      name: Color Line 1
      description: Line 1 text color (RGB value)
      selector:
        color_rgb:
      default: [255, 255, 0]
    text_line_2:
      name: Text Line 2
      description: Text to display on Line 2
      selector:
        text:
      default: false
    color_line_2:
      name: Color Line 2
      description: Line 2 text color (RGB value)
      selector:
        color_rgb:
      default: [0, 255, 255]
    text_line_3:
      name: Text Line 3
      description: Text to display on Line 3
      selector:
        text:
      default: false
    color_line_3:
      name: Color Line 3
      description: Line 3 text color (RGB value)
      selector:
        color_rgb:
      default: [255, 0, 255]
    text_line_4:
      name: Text Line 4
      description: Text to display on Line 4
      selector:
        text:
      default: false
    color_line_4:
      name: Color Line 4
      description: Line 4 text color (RGB value)
      selector:
        color_rgb:
      default: [0, 0, 255]
    text_speed:
      name: Text speed
      description: Text speed if the text is long enough where it needs to scroll
      selector:
        number:
          min: 10
          max: 100
      default: 50

mode: single
max_exceeded: silent

variables:
  text_line_1: !input 'text_line_1'
  text_line_2: !input 'text_line_2'
  text_line_3: !input 'text_line_3'
  text_line_4: !input 'text_line_4'
  color_line_1: !input 'color_line_1'
  rgbc1: >-
    {{ "#%02x%02x%02x" | format(color_line_1[0], color_line_1[1], color_line_1[2]) }}
  color_line_2: !input 'color_line_2'
  rgbc2: >-
    {{ "#%02x%02x%02x" | format(color_line_2[0], color_line_2[1], color_line_2[2]) }}
  color_line_3: !input 'color_line_3'
  rgbc3: >-
    {{ "#%02x%02x%02x" | format(color_line_3[0], color_line_3[1], color_line_3[2]) }}
  color_line_4: !input 'color_line_4'
  rgbc4: >-
    {{ "#%02x%02x%02x" | format(color_line_4[0], color_line_4[1], color_line_4[2]) }}
  text_speed: !input 'text_speed'
  

trigger: []

action:
  - service: rest_command.pixoo64_reset_gif
  - service: rest_command.pixoo64_send_gif
  - delay:
      milliseconds: 50
  - service: rest_command.pixoo64_set_text
    data:
      id: 1
      y: 2
      font: 8
      speed: "{{ text_speed }}"
      text: "{{ text_line_1 }}"
      color: "{{ rgbc1 }}"
  - delay:
      milliseconds: 50
  - service: rest_command.pixoo64_set_text
    data:
      id: 2
      y: 17
      font: 8
      speed: "{{ text_speed }}"
      text: "{{ text_line_2 }}"
      color: "{{ rgbc2 }}"
  - delay:
      milliseconds: 50
  - service: rest_command.pixoo64_set_text
    data:
      id: 3
      y: 32
      font: 8
      speed: "{{ text_speed }}"
      text: "{{ text_line_3 }}"
      color: "{{ rgbc3 }}"
  - delay:
      milliseconds: 50
  - service: rest_command.pixoo64_set_text
    data:
      id: 4
      y: 47
      font: 8
      speed: "{{ text_speed }}"
      text: "{{ text_line_4 }}"
      color: "{{ rgbc4 }}"

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

I’ve added the rest of the necessary information in a comment because it won’t let me import the blueprint when it’s all in the original post.

3 Likes

Below are the 3 REST commands needed for this blueprint, the REST commands from the original project referenced, and a couple extra ones that I added.

  #DIVOOM Commands
  # http://doc.divoom-gz.com/web/#/12?page_id=196
  pixoo64_set_brightness:
    url: !secret pixoo_post_address
    method: POST
    payload: '{"Command":"Channel/SetBrightness", "Brightness":{{ brightness }}}'
    content_type:  'application/json; charset=utf-8'
  pixoo64_switch_off:
    url: !secret pixoo_post_address
    method: POST
    payload: '{"Command":"Channel/OnOffScreen", "OnOff":0}'
    content_type:  'application/json; charset=utf-8'
  pixoo64_switch_on:
    url: !secret pixoo_post_address
    method: POST
    payload: '{"Command":"Channel/OnOffScreen", "OnOff":1}'
    content_type:  'application/json; charset=utf-8'
  pixoo64_set_channel:
    url: !secret pixoo_post_address
    method: POST
    payload: '{"Command":"Channel/SetIndex", "SelectIndex":{{ effect }}}'
    content_type:  'application/json; charset=utf-8'    
  pixoo64_set_text:
    url: !secret pixoo_post_address
    method: POST
    payload: '{"Command":"Draw/SendHttpText", "TextId":{{ id }}, "x":0, "y":{{ y }}, "dir":0, "font":{{ font }}, "TextWidth":64, "speed":{{ speed }}, "TextString":"{{ text }}", "color":"{{ color }}", "align":2}'
    content_type:  'application/json; charset=utf-8'
  pixoo64_reset_gif:
    url: !secret pixoo_post_address
    method: POST
    payload: '{"Command":"Draw/ResetHttpGifId"}'
    content_type:  'application/json; charset=utf-8'  
  pixoo64_send_gif:
    url: !secret pixoo_post_address
    method: POST
    payload: '{"Command":"Draw/SendHttpGif", "PicNum":1, "PicWidth":64, "PicOffset":0, "PicID":0, "PicSpeed":100, "PicData":"{{ gif }}"}'
    content_type:  'application/json; charset=utf-8'
  pixoo64_play_buzzer:
    url: !secret pixoo_post_address
    method: POST
    payload: '{"Command":"Device/PlayBuzzer", "ActiveTimeInCycle":500, "OffTimeInCycle":500, "PlayTotalTime":500}'
    content_type:  'application/json; charset=utf-8'
  pixoo64_rotate_screen:
    url: !secret pixoo_post_address
    method: POST
    payload: '{"Command":"Device/SetScreenRotationAngle", "Mode":{{ mode }}}'
    content_type:  'application/json; charset=utf-8'

Don’t forget to added the IP address of your Pixoo64 to your secrets.yaml file! Here’s mine:

pixoo_post_address: http://192.168.86.71:80/post

Anyway, I hope this helps. I actually make YouTube videos, and am working on one covering this project if you’d rather have a video guide.

1 Like

Thank you for this! I need to try it out. My Divoom Pixoo64 has become less useful lately, perhaps this will fix that problem.

1 Like

Hopefully it helps!!

Real nice Job,thanks a lot.

But how can i Send a i.e.Value to The Pixoo64, i would like to Display the actual Power of my solarsystem Or the actual Price of the Electricity.

Thanks in advance!