This is a quick sensor script that can be used by HomeAssistant (sorta).
SunPower does not provide a consumer accessible API.
They do provide a website you can use to monitor your panels, so a bit of hackery is required.
I'd recommend installing this using python virtualenv
. If you're not familiar with the
python installation incantation, it's:
$ virtualenv -p python3 venv
$ venv/bin/python setup.py install
You can run the program either as
$ venv/python sunpower
or
$ venv/reading
In HASS, I've set up the following custom sensor:
sensor:
- platform: command_line
scan_interval: 300
name: Solar Production
command: reading
unit_of_measurement: "kW"
NOTE: You'll have to specify the directory you installed in the command line.
(e.g. if you installed on /home/bob/sunpower_hass/
you'd use
...
command: /home/bob/sunpower_hass/venv/reading
)
##TODO:
- Make this a proper HASS module.