Home Assistant is a popular open-source platform for smart home automation. Pixelix supports displaying sensor data from Home Assistant using both the REST API and the MQTT API. Especially the MQTT automatic discovery support is fast and seamless.
Every Pixelix device provides a REST API and some may provide the MQTT API. To see whether MQTT is supported by your Pixelix device, open the Settings web page and search for MQTT broker URL. If its there, MQTT is supported.
With the RESTful Command integration PIXELIX can be controlled by REST API and with the RESTful integration sensor entities can be created.
Setup corresponding entities in the Home Assistant configuration.yaml and use them via the automation wizard or manually in the automations.yaml.
A simple REST command example looks like:
rest_command:
pixelix_notify:
url: 'http://<IP-ADDRESS>/rest/api/v1/display/uid/{{ uid }}/iconText?text={{ text | urlencode() }}'
method: POSTThe REST API is desribed in detail on the SwaggerHub.
Extend the automations.yaml manually for using the Pixelix MQTT device, e.g.
- id: garage_door_state_on_pixelix
alias: Garage door state on Pixelix
description: ''
triggers:
- trigger: state
entity_id:
- cover.garage_door
conditions: []
actions:
- service: rest_command.pixelix_notify
data:
uid: 42798
text: "{{ states('cover.garage_door') }}"
mode: singleHome Assistant automation blueprints are a game changer in sense of simple integration, without the necessity to battle in low level yaml and jinja2 programming. See Automation Blueprint chapter how to import it for Pixelix.
Using the MQTT API requires that a MQTT broker is available in network and Pixelix as well as Home Assistant have access to it.
If not already installed, you will need first to install the MQTT integration to your Home Assistant instance.
Then configure Pixelix in the Settings web page like:
- Enter the MQTT broker URL to MQTT broker URL.
- If necessary, update the Home Assistant Discovery Prefix.
- Activate the checkbox Enable Home Assistant MQTT Discovery.
- Restart PIXELIX.
The Home Assistant MQTT discovery is supported by several plugins and features, here are some examples:
- Display on/off
- Device restart
- Sensor information
- IconTextPlugin
- IconTextLampPlugin
- MultiIconPlugin
Pixelix will be shown as device with its entities. Every installed plugin will be shown as at least one entity.
More technical details about MQTT
Extend the automations.yaml manually for using the Pixelix MQTT device, e.g.
- id: garage_door_state_on_pixelix
alias: Garage door state on Pixelix
description: ''
triggers:
- trigger: state
entity_id:
- cover.garage_door
conditions: []
actions:
- action: mqtt.publish
metadata: {}
data:
evaluate_payload: false
qos: '0'
topic: pixelix-6F1AD6B8/display/uid/42798/iconText/set
payload: '{ "text": "{{ states(''cover.garage_door'') }}" }'
mode: singleHome Assistant automation blueprints are a game changer in sense of simple integration, without the necessity to battle in low level yaml and jinja2 programming. See Automation Blueprint chapter how to import it for Pixelix.
Home Assistant Automation Blueprints are reusable templates that simplify the creation of automations by providing a guided, fill-in-the-blanks interface. They help users quickly set up complex automations without needing to write YAML code from scratch, making smart home customization more accessible and efficient.
Pixelix provides with the following link such an automation blueprint to your Home Assistant installation. It supports to communicate with a Pixelix device by REST API and via MQTT API.
As an alternative copy the pixelix_send_sensor_data.yaml file to /config/blueprints/automation/homeassistant/.
Only for communicate via REST API with Pixelix, the following REST command needs to be added to the configuration.yaml:
rest_command:
pixelix_plugin_command:
url: "http://{{ hostname }}{{ endpoint }}?{{ url_parameter }}"
method: POSTIf you have further ideas or you found some bugs, great! Create a issue or if you are able and willing to fix it by yourself, clone the repository and create a pull request.
The whole source code is published under the MIT license. Consider the different licenses of the used third party libraries too!
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.