/pixoo-homeassistant

Home Assistant Integration for Divoom Pixoo 64

Primary LanguagePythonMIT LicenseMIT

Divoom Pixoo 64 Home Assistant Integration

hacs_badge Donate python badge last commit

Custom component for easy use of a Pixoo64 within Home Assistant. With this integration you have the possibility to display different designs and personalize them with information from the Home Assistant. For example, you can use this integration to display several texts {{ templates }} and images on one page. You can also use this integration to determine how long you want to see a page, e.g. you can set the page to change every 15 seconds. In addition, you also have a light entity with which you can switch the display on and off time-controlled. Last but not least, you can create automations with which you can display text and images as a push using certain triggers.

Installation

  1. Install this integration with HACS (adding repository required), or copy the contents of this repository into the custom_components/pixoo-homeassistant directory.
  2. Restart Home Assistant.
  3. Go to Settings / Integrations and add integration "Divoom Pixoo 64"
  4. Please select a discovered Pixoo 64 device from the list or select 'Manual IP' to manually enter the device's IP.

configuration List of pages in JSON *:

Just a small example with the HA logo and the current time!

- page: 1
  PV:
    - power: "{{ states.sensor.YOUR_SENSOR.state }}"
      storage: "{{ states.sensor.YOUR_SENSOR.state }}"
      discharge: "{{ states.sensor.YOUR_SENSOR.state }}"
      powerhousetotal: "{{ states.sensor.YOUR_SENSOR.state }}"
      vomNetz: "{{ states.sensor.YOUR_SENSOR.state }}"
      time: "{{ now().strftime('%H:%M') }}"  #Format HH:MM
- page: 2
  texts:
    - text: "github/gickowtf"
      position: [0, 10]
      font: FONT_PICO_8
      font_color: [255, 0, 0]  # red
    - text: "Thx 4 Support"
      position: [0, 30]
      font: FONT_PICO_8
      font_color: [255, 0, 0]  # red
  images:
    - image: "/config/img/anyPicture.png" #max 64 x 64 Pixel
      position: [30, 10]
- page: 3
  channel:
    - number: 2
- page: 4
  clockId:
    - number: 39

all options for configuration

Basic settings required

Keywords Values
page required numbered by integers



Page setting, here you can be creative and insert as much text and images as you like.

Keywords Values
texts required
text using templates or string - \n newline support
position The text position on a XY axis at 64x64 pixel
font at this time there are two different Fonts FONT_GICKO and FONT_PICO_8
font_color RGB colors
images not required
image Path to the image including file name .png preferred
position The text position on a XY axis at 64x64 pixel

Position on XY axis

Newline Support

Newline Support in text with {{\n}} There is no limit to the maximum newlines except for 64 pixels ;)

Example: text: Gicko{{\n}}Github or another Example: text: {{ states.*.state }}{{\n}}{{ states.*.state }}




Photovoltaic setting a self-designed design. The icon changes depending on the battery capacity and the font color changes from red to green

Helper entities may have to be used here

Keywords Values
PV own designed PV stats
power -required use {{ template }} Current power from the photovoltaic system
storage -required use {{ template }} Battery storage in percent
discharge -required use {{ template }} Current charging/discharging power
powerhousetotal -required use {{ template }} Current power consumption of the house
vomNetz -required use {{ template }} Current consumption from grid or feed-in
time -required use {{ template }} Current time example: {{ now().strftime("%H:%M") }}



Gas Station

Special Page. Helper entities may have to be used here


Keywords Values
Fuel own designed price board for Gas Stations
title -required use {{ template }} Title e.g. Gas Station Name
name1 -required use {{ template }} e.g. fuel type
price1 -required use {{ template }} fuel price
name2 -required use {{ template }} e.g. fuel type
price2 -required use {{ template }} fuel price
name3 -required use {{ template }} e.g. fuel type
price3 -required use {{ template }} fuel price
status -required use {{ template }} Any extra field in my case an opening status
font_color -optional use [R, G, B] RGB Color #default white
bg_color -optional use [R, G, B] RGB Color #default yellow (255, 230, 0)
price_color -optional use [R, G, B] RGB Color #default white
title_color -optional use [R, G, B] RGB Color #default black
stripe_color -optional use [R, G, B] RGB Color #default font_color
title_offset -optional use an int to center the text #default 2

Example of the image:

- page: 1
  Fuel:
    - title: Classic
      name1: Diesel
      price1: "{{ states.sensor.classic_diesel.state }}"
      name2: Super
      price2: "{{ states.sensor.classic_super.state }}"
      name3: E10
      price3: "{{ states.sensor.classic_e10.state }}"
      status: >-
        {% if is_state('binary_sensor.status', 'on') %}
        Open {% else %} Closed {% endif %}
      title_offset: 10



Custom Channel - In Divoom app you can set three different custom channels which you can select here.

Keywords Values
channel Custom Channel in APP
number 0 = channel 1, 1 = channel 2, 2 = channel 3



ClockId Channel - In Divoom app you can set three different custom channels which you can select here.

Keywords Values
clockId Clock Faces in APP
number int

If you have any further questions, I will be happy to help.

To find out the number of the ClockFace, you can proceed as follows.

  1. First go to the settings and activate debug logging in the Divoom Pixoo 64 integration.
  2. Now open the Divoom app on your smartphone and select your preferred ClockFace.
  3. As soon as this is displayed on your Pixoo64, you will find "Device Data" in the log and then "CurClockId".
  4. The CurClockId is the number you were looking for.



Automation Example

You can use it for Push Notifications. Trigger with anything!

Action with the Service "Divoom Pixoo 64: Use for push notifications".

IMPORTANT

Display a message on the Divoom Pixoo. Please select the "... Current Page" entity of the device.

In the following dialog you can define your push notification as usual in JSON format.

Messages The messages to display. Example: ["Hello World!", "How are you?"]

Positions The positions of the components. Example: [[1,1], [1,20]]

Colors List of RGB values for the texts. Example: [[255,0,0], [0,255,0]]

Fonts List of the font for each text. Example: ["FONT_GICKO", "FONT_PICO_8"]

Images The path to the images to display. Example: [ "/config/custom_components/divoom_pixoo/img/sunpower.png", "/config/custom_components/divoom_pixoo/img/haus.png" ]

Image positions The positions of the images. Example: [[1,30], [20,30]]




Font

FONT IMAGE
FONT_GICKO
FIVE_PIX Image available soon
FONT_PICO_8 Image available soon



Issues

Sometimes the display crashes, especially with animated images. I have often read on the Internet that this is due to the power supply being too weak or the brightness being too high. I now have the display permanently set to 90% and it no longer crashes.




Discussions

I would be happy if you present your configuration.yaml in the Discussions area
https://github.com/gickowtf/pixoo-homeassistant/discussions




Contributing

Please confirm that unit tests are passing (and add any missing coverage for the changes in your PR). To run the unit tests locally:

pip3 install -r requirements-test.txt

and then

python -m unittest discover tests  

Disclaimer

This is not official software from Divoom. It is a custom integration created by me (gickowtf) and therefore Divoom is not responsible for any damages/problems caused by this integration, nor does Divoom provide any end-user support for the integration. Use this integration at your own risk.




❤️ Many thanks to

@Mrredstone5230 - Thanks for the conversion to config flow