Skip to content

Communication app to fetch data from an inverter over serial and output to mqtt

License

Notifications You must be signed in to change notification settings

wolffshots/phocus

Repository files navigation

phocus

Worklow Status Go Reference codecov Codacy Badge

A generic set of packages and app to speak to a device via serial and relay the responses to an MQTT broker in a way that Home Assistant expects

Primarily built to communicate with Phocos branded inverters but the only thing you should need to change to use other inverters is the structure of the messages and the populating of the queue

Installation

Ubuntu/systemd

If you don't need to differ from the default setup then it should be as simple as:

Minimal dependencies

  1. Install the latest executable directly and customise the config (the script should create the config.json for you to customise if you don't do it beforehand)

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/wolffshots/phocus/HEAD/install_prebuilt.sh)"
  2. (Re)start the service

    sudo systemctl daemon-reload && sudo systemctl restart phocus

Build from source

  1. Clone the repo

    git clone https://github.com/wolffshots/phocus.git
  2. Create a config.json file from config.json.example and customise your settings (install.sh will just prompt you to do this in the next step if you don't)

  3. Run the install script (which builds the app then will ask for your password to put it in the correct place and makes a service file for it linked to phocus.service )

    cd phocus && ./install.sh
  4. (Re)start the service

    sudo systemctl daemon-reload && sudo systemctl restart phocus

Updating

From latest binary

Just run this command again:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/wolffshots/phocus/HEAD/install_prebuilt.sh)"

From source

To update you should just be able to pull/checkout the newer version, call ./install.sh and restart the app with sudo service phocus restart