EP-0118 to Home Assistant integration
Closed this issue · 1 comments
19leva89 commented
Tell me, is it possible to integrate the readings from the board into the smart home system Home Asssistant?
Something like this:
readvol.py
# IMPORT THE LIBERARY.
from ina219 import INA219
from ina219 import DeviceRangeError
SHUNT_OHMS = 0.05
def read():
"""Define method to read information from coulometer."""
ina = INA219(SHUNT_OHMS)
ina.configure()
print("%.3f" % ina.voltage())
if __name__ == "__main__":
read()
configuration.yaml in Home Asssistant
# Raspberry UPS HAT Battery
- platform: command_line
name: UPS_HAT_Battery
command: "python3 /home/homeassistant/.homeassistant/python_scripts/readvol.py"
unit_of_measurement: "V"
value_template: "{{ value | round(2) }}"
scan_interval: 60
Or is there a ready-made integration through HACS?
yoyojacky commented
yes, just create a mqtt client, and gather the information from UPS and send it to your mqtt broker server ,and then adding MQTT integration on Home assistant, adding card on overview and select the right card to display it.