bob-tm / ha-openhab

🏠 openHAB custom integration for Home Assistant
MIT License
5 stars 0 forks source link

2024 Update

For DeviReg climate there is new Home Assistant Addon https://github.com/bob-tm/ha-devireg-mqtt-addon No more external servers!

openHAB custom integration for Home Assistant

GitHub Release GitHub Activity License hacs BuyMeCoffee Discord Community Forum

Component to integrate with openHAB.

This is a Work in Progress repo!

This component will set up the following platforms.

Platform Item types
climate Devireg thermostat
binary_sensor Contact
sensor String, Number, DateTime
switch Switch
cover Rollershutter
device_tracker Location

HACS Installation

  1. Go to http://homeassistant.local:8123/hacs/integrations
  2. Add https://github.com/bob-tm/ha-openhab custom integration repository
  3. Download the openHAB repository
  4. Go to http://homeassistant.local:8123/config/integrations and add new integration
  5. Choose "openHAB" from the list and follow the config flow steps
  6. Use oauth2 for Devireg (more properties and correct floor / air temperature display)

Manual Installation

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called openhab.
  4. Download all the files from the custom_components/openhab/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "openHAB"

Using your HA configuration directory (folder) as a starting point you should now also have this:

custom_components/openhab/translations/en.json
custom_components/openhab/translations/nb.json
custom_components/openhab/translations/sensor.nb.json
custom_components/openhab/__init__.py
custom_components/openhab/api.py
custom_components/openhab/binary_sensor.py
custom_components/openhab/config_flow.py
custom_components/openhab/const.py
custom_components/openhab/manifest.json
custom_components/openhab/sensor.py
custom_components/openhab/switch.py

Configuration is done in the UI

Icons

To show the icons, we are taking openHAB Items "category" field and then matching its value with predefined map (based on classic iconset and Material Design Icons). If none is returned, we proceed with checking the Item's type (Switch, String, Number, Contact and so on) - all of these have their own icon as well.

Device classes

Device class of each Entity is assigned dynamically based on Items name or label.

Changes in openHAB Items

When you add/remove Items in openHAB, simply reload the integration in Home Assistant. New entities will appear automatically after reloading the custom component.

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines