Git Product home page Git Product logo

pixoo-homeassistant's Introduction

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 for switching the display on and off or changing the brightness. Last but not least, you can create automations with which you can use certain triggers to display the pages that are available to you as a push.

Installation

  1. Install this integration with HACS (adding repository required), or copy the contents of this repository into the custom_components/divoom_pixoo 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

IP address of the device: discovered or manually entered IP

Scan interval (in seconds): #default 15 seconds (this is the time a page is displayed )

List of pages in JSON * :

- page_type: PV
  enabled: "{{ states.input_boolean.YOURS.state }}"  #is only displayed if the state = 'true', 'yes', 'on' or '1'
  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') }}"
- page_type: components
  enabled: "{{ states.input_boolean.YOURS.state }}"  #is only displayed if the state = 'true', 'yes', 'on' or '1'
  components:
  - type: text
    position: [0, 10]
    content: "2 github/gickowtf"
    font: PICO_8
    color: [255, 0, 0] # or write "red"
  - type: image
    image_path: "/config/img/haus.png" #max 64 x 64 Pixel
    position: [10, 30]
- page_type: clock #in this case 'enabled' is omitted and is set to true by default
  id: 182


- page_type

Keywords Values
- page_type: required the name of the page_type

for example:

- page_type: components


enabled:

Keywords Values
enabled: optional (default true) {{ template }} #is only displayed if the state = 'true', 'yes', 'on' or '1'
- page_type: PAGE_TYPE
  enabled: "{{ states.input_boolean.YOURS.state }}"


components

- page_type: components

Keywords Values
- page_type: components to use this page_type
components: - type: text or - type: image required
Keywords Values
- type: text
position required The text position on a XY axis at 64x64 pixel
content required {{ templates }} and Newline Support in text
font default PICO_8 Fonts
color default white [R, G, B] or Colors
Keywords Values
- type: image
one of following image_xxx is required
image_path image path like /config/img/haus.png
image_url image url like template {{ entity image }} or https://raw.githubusercontent.com/gickowtf/pixoo-homeassistant/main/images/pixoo.gif
image_data image data in base64 convert images here
position required The image position on a XY axis at 64x64 pixel
height optional If none is selected, the image will be at it's original size. If one is selected, it will become the longest side. Proportional
width optional If none is selected, the image will be at it's original size. If one is selected, it will become the longest side. Proportional
resample_mode optional default = box
nearest, bilinear, hamming, bicubic, lanczos
Keywords Values
- type: rectangle
position required rectangle start position on a XY axis at 64x64 pixel
size required start position + size start
color required Colors
filled optional boolean
- page_type: components
  enabled: "{{ states.input_boolean.YOURS.state }}" #optional
  components:
    - type: text
      position: [10, 0]
      content: 2 github/gickowtf #
      font: PICO_8
      color: [255, 0, 0]
    - type: image
      image_path: /config/img/haus.png
      position: [30, 30]
    - type: image
      position: [0, 0]
      image_url: >-
        https://raw.githubusercontent.com/gickowtf/pixoo-homeassistant/main/images/pixoo.gif
      resample_mode: box #optional
      height: 30 #optional
    - type: image
      position: [30, 0]
      image_data: >-
        iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPBAMAAADJ+Ih5AAAAGFBMVEX//8z//5n//2b//zP//wDMzAAAAADAwMB5Mg5mAAAACHRSTlP/////////AN6DvVkAAAABYktHRAcWYYjrAAAAaklEQVR42kXNsQ2AIBBA0Wsc4ExcAKMLGAcwogModzUaOVoqWF8wJHav+h9SEhGfAqQIqMYCm9H7ABEIqd8D2EYWMZv9cSGiWgs6bNWZcfOhBlcxfyBHbMhCnFjcxrn8aK3Jl5cm4vKq9xdiSyWVldcCmgAAAHB0RVh0Y29tbWVudABpY29uNy5naWYgZm9yIHVzZSBpbiBVQkINCg0KKEMpIDE5OTkgUGhpbGlwcCBFc3NlbGJhY2ggKHBsZUBnbXgubmV0KQ0KaHR0cDovL3d3dy5udGdhbWVwYWxhY2UuaXNjb29sLm5ldBIZgm0AAAAASUVORK5CYII=
      resample_mode: nearest #optional
      height: 8 #optional
    - type: rectangle
      position: [20, 20]
      size: [10, 10]
      color: yellow
      filled: "{{ states.input_boolean.YOURS.state }}" #optional

Positioning

Newline

Newline Support in content: example:

  content: |-
    text 1
    {{ states.*.state }}

There is no limit to the maximum newlines except for 64 pixels ;)



PV

Photovoltaic - PV is a pre-designed page. 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
- page_type: PV to use this page_type
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") }}
- page_type: PV
  enabled: "{{ states.input_boolean.test2.state }}"
  power: "{{ states.sensor.enpal_solar_production_power.state }}"
  storage: "{{ states.sensor.enpal_battery_percent.state }}"
  discharge: "{{ states.sensor.enpal_battery_power.state }}"
  powerhousetotal: "{{ states.sensor.enpal_power_house_total.state }}"
  vomNetz: "{{ states.sensor.enpal_power_external_total.state }}"
  time: "{{ now().strftime('%H:%M') }}"


Fuel

Special Page for Gas Station Pricing. Helper entities may have to be used here


Keywords Values
- page_type: Fuel to use this page_type
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]" or Colors RGB Color #default white
bg_color -optional use "[R, G, B]" or Colors RGB Color #default yellow (255, 230, 0)
price_color -optional use "[R, G, B]" or Colors RGB Color #default white
title_color -optional use "[R, G, B]" or Colors RGB Color #default black
stripe_color -optional use "[R, G, B]" or Colors RGB Color #default font_color
title_offset -optional use integers to center the text #default 2

Example of the image:

- page_type: Fuel
  enabled: "{{ states.input_boolean.YOURS.state }}"
  title: Classic
  name1: Diesel
  price1: "{{ states.sensor.diesel.state }}"
  name2: Super
  price2: "{{ states.sensor.super.state }}"
  name3: E10
  price3: "{{ states.sensor.e10.state }}"
  status: >-
    {% if is_state('binary_sensor.status', 'on') %} Offen {%
    else %} Geschlossen {% endif %}
  title_offset: "10"
  font_color: "[255, 255, 255]"


Progress Bar

Special page with a progress bar for, for example, the status of the dishwasher or charging status of the car

Keywords Values
- page_type: P to use this page_type
header -required use {{ template }} e.g. Dishwasher
progress -required use {{ template }} integer required
footer -required use {{ template }} any footer e.g. Date
bg_color -optional use "[R, G, B]" or Colors RGB Color #default blue
header_offset -optional use int integer required #default 2
header_font_color -optional use "[R, G, B]" or Colors RGB Color #default white
progress_bar_color -optional use "[R, G, B]" or Colors RGB Color #default red
progress_text_color -optional use "[R, G, B]" or Colors RGB Color #default white
time_color -optional use "[R, G, B]" or Colors RGB Color #default grey
footer_offset -optional use int integer required #default 2
footer_font_color -optional use "[R, G, B]" or Colors RGB Color #default white

Example of the image:

- page_type: progress_bar
  enabled: >-
    {% if is_state('sensor.DISHWASCHER_STATE', 'Run') %} true {%
    else %} false {% endif %}
  header: DISHWASHER
  progress: "{{ states.sensor.DISHWASHER_PROGRESS.state }}"
  footer: ANY FOOTER
  header_font_color: "[255, 255, 255]"


channel

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

Keywords Values
- page_type: channel to use this page_type
id 0 = channel 1, 1 = channel 2, 2 = channel 3
- page_type: channel
  id: 0 #shows custom channel 1


clock

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

Keywords Values
- page_type: clock to use this page_type
id int
- page_type: clock
  id: 182

Here is a list of all ClockFaces

or

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.


visualizer

This adds the visualizer page to the integration. The id starts at zero and it represents the clocks from top left to bottom right as can be seen in the app.

- page_type: visualizer
  id: 2


Services

Service Send a page to Divoom Pixoo (show_message) Push Notification

You can use it for Push Notifications. Trigger with anything! Call it with the Service "Divoom Pixoo 64: Send a page to Divoom Pixoo".

You can input in the Page Data field the data of one page in the normal JSON format. It can be anything! (Please note that the 'enabled' tag doesn't work and that it's normal.)

Some examples of Page Data:

page_type: clock
id: 182

or

page_type: components
components:
  - type: text
    position: [10, 0]
    content: 2 github/gickowtf
    font: PICO_8
    color: [255, 0, 0]
  - type: image
    image_path: /config/img/haus.png
    position: [30, 30]


Service Play a Buzzer

Play the buzzer on the Divoom Pixoo. Beware that this maybe could damage the device. Use at your own risk.

Buzzing Time per cycle. in milliseconds default: 500 milliseconds
The working time of the buzzer per cycle. The buzzer will not buzz continuously; it will go on and off in cycles (duration in-between not controllable).

Idle Time per cycle in milliseconds default: 500 milliseconds
Idle time of the buzzer per cycle.

Total Time in milliseconds default: 3000 milliseconds
The total time the buzzer will be working.



Service Restart the Divoom Pixoo

Restart the Divoom Pixoo device. (It has a little bit of delay. Be patient.)



Fonts

FONT IMAGE
GICKO
FIVE_PIX
PICO_8


Colors



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



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 and many many more

pixoo-homeassistant's People

Contributors

gickowtf avatar mrredstone5230 avatar ireneybean avatar koendierckx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.