From 5fef5fa5d348dbec81eb9ff3d38a84795dd6ee1a Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 30 Jan 2020 23:21:27 +0100 Subject: [PATCH] adding command line sensor --- sensors/sensors.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sensors/sensors.yaml b/sensors/sensors.yaml index b5e67c0..33c5918 100644 --- a/sensors/sensors.yaml +++ b/sensors/sensors.yaml @@ -17,3 +17,12 @@ - platform: command_line name: Python Version command: "python3 --version" + +- platform: command_line + command: 'curl -s -m 20 -H "Content-Type: application/json" -X GET cypher/matemeter/api.php' + name: remaining_bottles + json_attributes: + - remaining_bottles + value_template: "{{ value_json.remaining_bottles |int }}" + scan_interval: 20 + command_timeout: 30