Binary sensor to display coffee machine state

I’ve integrated my smarter coffee machine (hurray!) and it has a sensor to tell me the water level. The script to run on the coffee machine checks if there is a enough water. However it doesn’t/can’t check if there’s any fresh coffee in there. I was thinking of creating a manual entity, which I’d use an NFC tag on the machine to toggle to ‘fresh’ when I put coffee in there and the script to make the coffee could toggle to ‘used’ at the end of its run.

Is a binary sensor the correct way to do this ? I have this in sensors.yaml :

binary_sensor:
  - platform: template
    sensors:
      smarter_coffee_grounds_sensor:
        friendly_name: "Coffee Grounds"
        device_class: occupancy
        value_template: "{{ is_state('binary_sensor.0x00158d00044b72dd_occupancy', 'empty') }}"

(The last part taken from the docs - do I need an ‘is not’ state too ?)

Since I’m using the occupancy sensor (closest I could find) can I over ride ‘occupied/clear’ with ‘fresh/used’ ?

Is there a better way to do this ?

Many Thanks

offtopic: what is brand of the machine :smiley:

@poudenes Smarter coffee 1st gen - see Smarter Coffee / iKettle

Have a look at an input_boolean.
It may be what you are after.

You could toggle it on with your NFC tag to idictate fresh fresh coffee, then toggle it off after a brew to indicate used

Thanks - I’ve set that up and can see I can toggle it in the UI, I’m waiting for some NFS tags to arrive to auto setting it.

do you have any hotel keys or used transit cards lying around?

maybe a year ago :slight_smile: I’ve not been anywhere recently. I bought a pack of NFS tags from Amazon, I’m going to have to think of some other uses too now