A Python CLI wrapper for the pyanova-api module to interface with the Anova private API used by the Anova Precision Cooker Pro. Particularly intended for integrating an Anova Precision Cooker Pro with Home Assistant.
This may work with other Anova cookers but has only been tested with the Anova Precision Cooker Pro.
This wouldn't have been possible without:
danodemano's anova_control.py script which works with older Anova cooker models and provided a starting point plus a lot of the inspiration for this CLI wrapper
ammarzuberi's pyanova-api Python module which this wrapper relies on to operate.
pyanova-api must be installed for this script to work:
From the command line, run
pip install pyanova-api
- Clone the GitHub repository:
git clone https://github.com/ammarzuberi/pyanova-api.git
- Enter the newly created
pyanova-api
directory and run:pip install .
If running Home Assistant within a Docker container, the above installation methods will see the pyanova-api module removed on each reboot or upgrade of the container.
To ensure the installation persists:
- First, add the hassio addons development repo to your HA installation
- Install the 'Custom deps deployment' add-on
- In the add-on configuration, add '- pyanova-api' under the 'pypi' heading
pypi:
- pyanova-api
- Save the configuration
- Start the add-on
- Ensure the add-on is set to start on boot.
You can find your cooker's device ID from the Anova mobile phone app:
Profile > Settings cog > Cooker Details
The pyanova-api can not authenticate using Google, Facebook or Apple authentication tokens, you must sign up to anovaculincary.io by e-mail and connect the Anova Cooker to this account for this script to function as expected.
Once all pre-requisites are met, clone this repository or copy anova_control.py to the machine that has pyanova-api installed.
If using Home Assistant, cloning this repo into the \config\scripts folder is recommended or copy anova_control.py to \config\scripts\anova_control\anova_control.py.
anova_control.py requires the following arguments to run:
-o/--output [r/j/raw/json/c/cook] Set whether the output is a raw text string or JSON output of the cookers current state, or new cook settings applied to your Anova cooker! JSON output is recommended for Home Assistant sensor integration
-i/--id/--cooker_id [Anova Device ID]
-u/--username/-e/--email [email address used to login to anovaculinary.io account]
-p/--password [password used to login to anovaculinary.io account]
--time [(only required if o = c/cook) cook time in minutes]
--temp [(only required if o = c/cook) cook temp in C]
This will either output the full suite of information available from pyanova-api in the format requested, plain text or JSON, or start/update a cook on your Anova cooker.
Create a Home Assistant command line sensor to pull the JSON output into Home Assistant as the entity 'sensor.anova_status':
platform: command_line
command: 'python ./scripts/anova_control/anova_control.py -o j -i <cooker ID> -u <username> -p <password>'
name: Anova Status
json_attributes:
- job_status
- job_time_remaining
- heater_duty_cycle
- motor_duty_cycle
- wifi_connected
- wifi_ssid
- water_leak
- water_level_low
- water_level_critical
- heater_temp
- triac_temp
- water_temp
value_template: '{{value_json.current_temp}}'
scan_interval: 1
While the Anova cooker is not powered on, the status will be reported as 'unknown' in Home Assistant and only the 'friendly_name: Anova Status' attribute will be reported. Once the device is powered on, all attributes should be visible.
The following template sensors pull the individual values from the command line sensor to read each value as a specific entity:
platform: template
sensors:
anova_job_status:
friendly_name: 'Anova job status'
value_template:
'{{ states.sensor.anova_status.attributes.job_status }}'
anova_job_time_remaining:
friendly_name: 'Anova job time remaining'
unit_of_measurement: 'min'
value_template:
'{{ states.sensor.anova_status.attributes.job_time_remaining/60 | round(0) }}'
anova_heater_duty_cycle:
friendly_name: 'Anova heater duty cycle'
unit_of_measurement: '°C'
value_template:
'{{ states.sensor.anova_status.attributes.heater_duty_cycle }}'
anova_motor_duty_cycle:
friendly_name: 'Anova motor duty cycle'
unit_of_measurement: '°C'
value_template:
'{{ states.sensor.anova_status.attributes.motor_duty_cycle }}'
anova_wifi_connected:
friendly_name: 'Anova wifi connected'
value_template:
'{{ states.sensor.anova_status.attributes.wifi_connected }}'
anova_wifi_ssid:
friendly_name: 'Anova wifi ssid'
value_template:
'{{ states.sensor.anova_status.attributes.wifi_ssid }}'
anova_water_leak:
friendly_name: 'Anova water leak'
value_template:
'{{ states.sensor.anova_status.attributes.water_leak }}'
anova_water_level_low:
friendly_name: 'Anova water level low'
value_template:
'{{ states.sensor.anova_status.attributes.water_level_low }}'
anova_water_level_critical:
friendly_name: 'Anova water level critical'
value_template:
'{{ states.sensor.anova_status.attributes.water_level_critical }}'
anova_heater_temp:
friendly_name: 'Anova heater_temp'
unit_of_measurement: '°C'
value_template:
'{{ states.sensor.anova_status.attributes.heater_temp }}'
anova_triac_temp:
friendly_name: 'Anova triac temp'
unit_of_measurement: '°C'
value_template:
'{{ states.sensor.anova_status.attributes.triac_temp }}'
anova_water_temp:
friendly_name: 'Anova water temp'
unit_of_measurement: '°C'
value_template:
'{{ states.sensor.anova_status.attributes.water_temp }}'
Document other potential sensors to allow better integration into HA.