Skip to content

Racailloux/home-assistant-pijuice

Repository files navigation

Home Assistant PiJuice Integration

hacs_badge version

Here is an integration to retrieve PiJuice values in Home Assistant sensors.

Sensors supported

Here is the list of sensors available to be added from this integration. For more details, please refers to the DOCUMENTATION.

  • Battery status
  • Power input status
  • Power input I/O status
  • Charge in %
  • Temperature (native format)
  • Battery voltage
  • Battery current
  • I/O voltage
  • I/O current

Prerequisite

To make the Pi Juice Hat accessible and the integration working, this is required that I2C is enabled in th host system.

HACS installation (Easy mode)

Use HACS. This will also inform you when there are new releases and you can update easily. If installed this way, you can proceed to configuration either using the Integrations Page or Configuration.yaml (legacy).
If you are not familiar with HACS, please check the usage.

Manual installation

  1. Using the tool of your choice (SSH, Samba, ...), open the directory of ther HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory, create it.
  3. Inside the custom_components directory, create a new folder called pijuice.
  4. Download all the files from the custom_components/pijuice/ repository to this directory custom_components\pijuice.

Example configuration.yaml

Whatever the installation of this integration used, you need to activate the integration to your configuration file (using share folder or addon to access to it).
Here is a complete configuration with all entities activated :

sensor:
  - platform: pijuice
    monitored_conditions:
      - battery_status
      - power_input_status
      - power_input_io_status
      - charge
      - temperature
      - battery_voltage
      - battery_current
      - io_voltage
      - io_current

If no "monitored_conditions" is setup, all sensors will be added to Home Assistant as Entities.

Credits

PiJuice : PiJuice Pi supply hardware/software platform to support Raspberry Pi, Arduino, ...
Home Assistant : Home Assistant open-source powerful domotic plateform.
HACS : Home Assistant Community Store gives you a powerful UI to handle downloads of all your custom needs.
smbus2 library : PyPI library for I2C access