input_number: keurig_on: name: Keurig On min: 0 max: 2000 step: 0.1 mode: box keurig_warming_water: name: Keurig Warming Water min: 0 max: 2000 step: 0.1 mode: box keurig_brewing: name: Keurig Brewing min: 0 max: 2000 step: 0.1 mode: box keurig_pouring: name: Keurig Pouring min: 0 max: 2000 step: 0.1 mode: box keurig_carafe: name: Keurig Carafe min: 0 max: 2000 step: 0.1 mode: box binary_sensor: - platform: template sensors: keurig_on: friendly_name: 'Keurig On' value_template: "{{ states('sensor.shelly_keurig_w') | float(default=0) < states('input_number.keurig_on') | float(default=0) }}" keurig_warming_water: friendly_name: 'Keurig Warming Water' value_template: "{{ states('sensor.shelly_keurig_w') | float(default=0) > states('input_number.keurig_warming_water') | float(default=0) }}" delay_off: "00:00:20" keurig_brewing: friendly_name: 'Keurig Brewing' value_template: "{{ states('sensor.shelly_keurig_w') | float(default=0) > states('input_number.keurig_brewing') | float(default=0) }}" keurig_pouring: friendly_name: 'Keurig Pouring' value_template: "{{ states('sensor.shelly_keurig_w') | float(default=0) > states('input_number.keurig_pouring') | float(default=0) }}" keurig: #This still needs to watch the Shelly sensor, rather than the circuit, so devices plugged into other outlets don't interfere with this sensor. unique_id: templatebinarysensor.keurig friendly_name: Keurig value_template: "{{ states('sensor.shelly_keurig_w') | float(default=0) > states('input_number.keurig_brewing') | float(default=0) }}" delay_on: seconds: 50 # If you press a button the keurig will wake up, but not actually brew. delay_off: seconds: 30 icon_template: mdi:coffee-maker attribute_templates: model_number: 'K-Duo Essentials' serial_number: '5000 3100 08558 19' power: "{{ states('sensor.shelly_keurig_w') | float(default=0)}}" target: "{{ states('input_number.keurig_brewing') | float(default=0)}}" keurig_carafe: unique_id: templatebinarysensor.keurig_carafe friendly_name: Keurig Carafe value_template: "{{ states('sensor.shelly_keurig_w') | float(default=0) > states('input_number.keurig_carafe') | float(default=0) }}" # The largest cup takes just under 3 minutes to brew. If the keurig is on for over 3 minutes # someone is brewing a pot of coffee, rather than using a k-cup delay_on: minutes: 4 # If this sensor is still on when binary_sensor.keurig turns off, a K-Cup was brewed and should # be considered consumed. delay_off: seconds: 40 icon_template: mdi:coffee-maker attribute_templates: model_number: 'K-Duo Essentials' serial_number: '5000 3100 08558 19' power: "{{ states('sensor.shelly_keurig_w') | float(default=0)}}" target: "{{ states('input_number.keurig_carafe') | float(default=0)}}"