Lovelace: Check Button Card

Relly nice lovelace card! Great work!
I’m publishing the current time to the mqtt topic through an AppDaemon app and it works but anytime I do this, I get “Entity config outdated. Update?” in the frontend and I have to click it. Is this expected behaviour?

Yes it is expected behaviour, however this shouldn’t be happening. At some point I introduced a version check in the MQTT payload to help people upgrade from an older version. I don’t think this is needed anymore so I’ve removed it from the latest version 0.1.2.

This card is now also on HACS to make it easier to upgrade.

Works perfect now! Thanks a lot!

Is there a way to keep and show info who pressed the button ?
Great way to organize household activities, also keep track who does what and how often :slight_smile:

Is this still working I’m not getting any success but probably on my end.

Here is the payload I’m getting back

11/24/2019, 10:50:01 PMnode: c561b706.2bc688
msg.payload : string[147]
"{"timestamp":1574664601,"visibility_timeout":"none","visible":true,"unit_of_measurement":"timestamp","version":"0.1.0","friendly_name":"feed_time"}"

image

Currently not possible as far as I know. The underlying architecture is not ready for this yet.

Did you update the check-button card to the latest version? The “version” is not required anymore in the payload. For me it works with AppDaemon. What kind of error do you get?

The payload seems correct, however it appears you are publishing to the wrong topic. Try homeassistant/sensor/feed_time instead.

The version will probably still be in the payload if you’ve set up the button before I removed it in the latest version. It just doesn’t check for a version match anymore.

1 Like

Ok I changed the topic still no errors but no update to the actual button. any thoughts why?

Ok got it figured needed to add state to end of topic
homeassistant/sensor/feed_time/state
Also did a Pull Request on github for the Readme :slight_smile:

1 Like

I would love to control this with Alexa (we use it mainly for tracking nappies and baby feeding, and handsfree control is preferable) . How can I create a button out of the sensor that’s generated by the extension?

Here’s how I did it

  1. Define a new virtual device that can be used with Alexa. If you’re only running HA, then emulated hue is a good solution. i’m using Nodered with a special node in order to do so :
    image
  2. Create a routine that triggers the virtual device. If you’re using a light as the device, you can adjust the brightness in order to ‘filter’ options : if bri=3% then run script_1, if bri=4% then run script_2 and so on.
  3. From then it’s fairly easy, you just publish an mqtt message with the topic & value required, and your sensor (hence the card) will be updated.

It works great ! I’m at the office so I can’t record anything now but basically, I have a list of chores to do, for example clean furnitures :
image

And when I’m done I just say “Alexa, I’ve cleaned the furnitures” and the sensor adjusts itself:
image

5 Likes

Awesome tool so thank you very much!
Has anyone been able to get the check-button-cards to display within a single card and if so how?
I have a vertical stack of 5 buttons but would like all to show under and single “Chores” card and so far i have been unable to achieve this.

You can either use vertical-stack-in-card or just define a list of entities.

      - align: split
        animation: 'off'
        entities:
          - entity: sensor.glances_cpu_used
            title: CPU
          - entity: sensor.glances_disk_used_percent
            title: Disk
          - entity: sensor.glances_ram_used_percent
            title: RAM
        icon_position: inside
        indicator: 'off'
        padding: 2px
        severity:
          - color: var(--bar-green)
            value: 33
          - color: var(--bar-yellow)
            value: 66
          - color: var(--bar-red)
            value: 100
        type: 'custom:bar-card'

thank you,
it currently is a vertical-stack but displays as seperate cards;

- type: vertical-stack
        title: Chores
        cards:
          - type: custom:check-button-card
            title: Hoovering
            entity: sensor.hoovering
            severity:
            - value: 3 days
              hue: '140'
            - value: 5 days
              hue: '55'
            - value: 7 days
              hue: '345'  
          - type: custom:check-button-card
            title: Dusting
            entity: sensor.dusting
            severity:
            - value: 3 days
              hue: '140'
            - value: 5 days
              hue: '55'
            - value: 7 days
              hue: '345'                
          - type: custom:check-button-card
            title: Clean Desk
            entity: sensor.desk
            severity:
            - value: 3 days
              hue: '140'
            - value: 5 days
              hue: '55'
            - value: 7 days
              hue: '345'     
          - type: custom:check-button-card
            title: Bathrooms
            entity: sensor.bathrooms
            severity:
            - value: 3 days
              hue: '140'
            - value: 5 days
              hue: '55'
            - value: 7 days
              hue: '345'   
          - type: custom:check-button-card
            title: Windows
            entity: sensor.windows
            severity:
            - value: 3 months
              hue: '140'
            - value: 6 months
              hue: '55'
            - value: 9 months
              hue: '345'

Capture

https://github.com/custom-cards/vertical-stack-in-card you can also find it on HACS. I use it for loads of things.

1 Like

nice work!

any ideas how to do some automations when the button is pressed?

for example I want to create an event in my google calender to have a history :wink:

It should just work like any other sensor based automation, since every button is defined as a sensor.

The card updates correctly on a click without issue, I created a script for some automations and when this is run the card updates. However on HASS restart the update from script is forgotten but the update from click stored.

Any ideas?

update_windows:
  sequence:
  - data_template:
      payload_template: '{"timestamp": {{ as_timestamp (now()) | int }},"visible":true,"unit_of_measurement":"timestamp"}'
      topic: homeassistant/sensor/windows/state
    service: mqtt.publish
  alias: Update Windows