Moved more to packages

This commit is contained in:
2022-10-12 11:20:47 +13:00
parent 728b9eee62
commit fd69d971f5
17 changed files with 127 additions and 125 deletions

42
packages/grocy_api.yaml Normal file
View File

@@ -0,0 +1,42 @@
rest_command:
chores1_request:
url: !secret grocy_api_uri_chore6
method: PUT
headers:
accept: "*/*"
GROCY-API-KEY: !secret grocy_api_key
content_type: "application/json"
payload: '{
"name" : "{{ name }}" ,
"next_execution_assigned_to_user_id" : "{{ assigned_to }}"
}'
# payload: '{"name" : "{{ name }}" , "next_estimated_execution_time" : "{{ next_time }}", "next_execution_assigned_to_user_id" : "{{ assigned_to }}" }'
verify_ssl: false
sensor:
- platform: rest
name: Dog Motel Cleaning
resource: !secret grocy_api_uri_chore3
method: GET
value_template: "{{ (((as_timestamp(value_json.next_estimated_execution_time))-as_timestamp(now())) | int /60/1440) | round(0) }}"
json_attributes:
- last_tracked
- estimated_execution_time
headers:
Accept: application/json
Content-Type: application/json
GROCY-API-KEY: !secret grocy_api_key
unit_of_measurement: "Days"
- platform: rest
name: Red Bin Out
resource: !secret grocy_api_uri_chore2
method: GET
value_template: "{{ (((as_timestamp(value_json.next_estimated_execution_time))-as_timestamp(now())) | int /60/1440) | round(0) }}"
json_attributes:
- last_tracked
- estimated_execution_time
headers:
Accept: application/json
Content-Type: application/json
GROCY-API-KEY: !secret grocy_api_key
unit_of_measurement: "Days"