I’m working on controlling my Anova cooker using this wrapper: https://github.com/bmedicke/anova.py and a custom py script. When the cooker is not running I have a manageable chunk of JSON:
{
"status": {
"cooker_id": "anova xxxxxxxxxxxxxxxx",
"current_temp": 72.4,
"firmware_version": "ver 6.1.1",
"is_running": false,
"is_timer_running": false,
"speaker_mode": true,
"target_temp": 72,
"temp_unit": "f",
"timer_length": 240
}
}
However when the cooker IS running I quickly overflow the max 255 characters:
{
"status": {
"cooker_id": "anova xxxxxxxxxxxxxxxx",
"current_job": {
"is_running": true,
"job_id": "fee68923-6cf2-46fa-9202-8f452e25a082",
"job_info": {
"display_item_identifier": "",
"duration": 300,
"source": "user_defined",
"source_identifier": "",
"temperature": 72,
"temperature_unit": "Fahrenheit"
},
"job_stage": "cooking",
"job_start_time": "2019-02-19T00:22:47.846004Z",
"job_type": "manual_cook",
"job_update_time": "2019-02-19T00:22:48.846006Z",
"max_circulation_interval": 300,
"target_temp": 72,
"temp_unit": "f",
"threshold_temp": 40,
"timer_length": 300
},
"current_job_id": "fee68923-6cf2-46fa-9202-8f452e25a082",
"current_temp": 72.2,
"firmware_version": "ver 6.1.1",
"is_running": true,
"is_timer_running": true,
"speaker_mode": true,
"target_temp": 72,
"temp_unit": "f",
"timer_length": 300
}
}
My current config is this which I intended to parse out:
- platform: command_line
command: python3 /scripts/anova_control.py -m status
name: Anova RAW Status
value_template: '{{value_json}}'
scan_interval: 60
However that obviously doesn’t work given the length. So my question is, how can I parse out that data without making a bunch of different calls? Each run of that script is an API hit to their (Anova’s) site and given the undocumented nature of the API I would prefer not to be hitting it 20+ times a minute.
I saw some stuff around a rest sensor but that doesn’t help me here. Any help would be greatly appreciated!