Detailed descriptions and examples
HA custom_component
-
Installation (HACS)
Open HACS in Home Assistant, select “Search and download repositories”. Search for “homey” and install the integration.
-
Installation (manually)
→ Download the files from Github: custom_component/homey and copy them to a new folder “homey” in your HA configuration: /config/custom_components/homey
→ Then restart HA to load this component.
- YAML configuration
→ If you want to include the YAML definition into your configuration.yaml, then take example.yaml as example for the structure. Copy the content into your configuration.yaml and edit the compound definition
→ If you would like to use an include file (the preferred variant), the insert this line into your configuration.yaml:
homey: !include homey.yaml
This way, you can add all compounds to a file names homey.yaml
Use example_include.yaml as example for the structure.
Compound definition
The compoud groups a set of entities into a Homey device. As target you have to use an existing Homey capability. The capability defines, how the value is shown (as alarm, measurement or switch).
The Structure is:
compound_name:
name: The name that is used as device name
capabilities:
capability1: entity1
capability2: entity2
capabilitiesTitles: (this is optional if you would like to set another capability description)
capability1: title of capability 1
capability2: title of capability 2
If you need more than one capability of the same type, you can use subcapabilities (add .subname)
Example:
temperature:
name: Temperature
capabilities:
measure_temperature.south: sensor.south_temperature
measure_temperature.nord: sensor.nord_temperature
capabilitiesTitles:
measure_temperature.south: "Temp. South"
measure_temperature.nord: "Temp. Nord"
This way you can combine a switch and its measurement capabilities to a measurement plug
Example: This are the needed entities of a SP120 plug used for a fan:
Combined as compound it could look like:
fan:
name: Fan
capabilities:
onoff: switch.ventilator_eingeschaltet
meter_power: sensor.ventilator_energie
measure_power: sensor.ventilator_leistung
Add this code to your YAML (using your entities :-)).
Then restart HA to take effect.
In Homey, add a compound device:
Select the “Fan”:

Now you have a device showing the two power values and a switch to toggle the plug.
As you can see, the capability description were taken from the HA entities. If you like to get other titles, you can add them to the YAML. And don’t forget to restart HA after YAML changes. If there are syntax error, HA will prevent you to restart.
fan:
name: Fan
capabilities:
onoff: switch.ventilator_eingeschaltet
meter_power: sensor.ventilator_energie
measure_power: sensor.ventilator_leistung
capabilitiesTitles:
onoff: Fan switch
meter_power: Power meter
measure_power: Power current
Removed from Homey and added again it looks like this:
A further example for air quality data (air purifier) you can find in post #130: