Lovelace Push Button

Dear All,

is there a way to have push button in a card in lovelace?

Thx!

You might find some useful things here:

I have several buttons using this that act like push buttons. Mine are toggles (on/off), but you could do momentary as well by adding an automation or script.

thank you! i’ll take a look on it.

did not work with me.

i created the file ui-lovelace-card.yaml, under www, the file button-card.js,

#cat ui-lovelace-card.yaml 
title: PjWHeim

resources:
  - url: /local/button-card.js
    type: module

views:
  - path: default_view
    title: Home
    badges:
#     - entity: binary_sensor.updater
#     - entity: binary_sensor.nextcloud_system_enable_avatars
#     - entity: binary_sensor.nextcloud_system_enable_previews
#     - entity: binary_sensor.nextcloud_system_filelocking_enabled
#     - entity: binary_sensor.nextcloud_system_debug
#     - entity: binary_sensor.tc91100
      - entity: binary_sensor.door_window_sns_x4_1_1
      - entity: binary_sensor.door_window_sns_x4_1_2
      - entity: binary_sensor.door_window_sns_x4_1_3
      - entity: binary_sensor.door_window_sns_x4_1_4
      - entity: person.paulo_wollny
#     - entity: sensor.nextcloud_system_version
#     - entity: sensor.nextcloud_system_theme
#     - entity: sensor.nextcloud_system_memcache_local
#     - entity: sensor.nextcloud_system_memcache_distributed
#     - entity: sensor.nextcloud_system_memcache_locking
#     - entity: sensor.nextcloud_system_freespace
#     - entity: sensor.nextcloud_system_cpuload
#     - entity: sensor.nextcloud_system_mem_total
#     - entity: sensor.nextcloud_system_mem_free
#     - entity: sensor.nextcloud_system_swap_total
#     - entity: sensor.nextcloud_system_swap_free
#     - entity: sensor.nextcloud_system_apps_num_installed
#     - entity: sensor.nextcloud_system_apps_num_updates_available
#     - entity: sensor.nextcloud_storage_num_users
#     - entity: sensor.nextcloud_storage_num_files
#     - entity: sensor.nextcloud_storage_num_storages
#     - entity: sensor.nextcloud_storage_num_storages_local
#     - entity: sensor.nextcloud_storage_num_storages_home
#     - entity: sensor.nextcloud_storage_num_storages_other
#     - entity: sensor.nextcloud_shares_num_shares
#     - entity: sensor.nextcloud_shares_num_shares_user
#     - entity: sensor.nextcloud_shares_num_shares_groups
#     - entity: sensor.nextcloud_shares_num_shares_link
#     - entity: sensor.nextcloud_shares_num_shares_mail
#     - entity: sensor.nextcloud_shares_num_shares_room
#     - entity: sensor.nextcloud_shares_num_shares_link_no_password
#     - entity: sensor.nextcloud_shares_num_fed_shares_sent
#     - entity: sensor.nextcloud_shares_num_fed_shares_received
#     - entity: sensor.nextcloud_server_webserver
#     - entity: sensor.nextcloud_server_php_version
#     - entity: sensor.nextcloud_server_php_memory_limit
#     - entity: sensor.nextcloud_server_php_max_execution_time
#     - entity: sensor.nextcloud_server_php_upload_max_filesize
#     - entity: sensor.nextcloud_database_type
#     - entity: sensor.nextcloud_database_version
#     - entity: sensor.nextcloud_activeusers_last5minutes
#     - entity: sensor.nextcloud_activeusers_last1hour
#     - entity: sensor.nextcloud_activeusers_last24hours
     - entity: sensor.speedtest_ping
     - entity: sensor.speedtest_download
     - entity: sensor.speedtest_upload
#     - entity: sensor.nextcloud_shares_permissions_3_1
#     - entity: sensor.nextcloud_system_apps_app_updates_calendar
#     - entity: sensor.nextcloud_system_apps_app_updates_contacts
      - entity: sun.sun
    cards:
      - type: entities
        entities:
          - sensor.upnp_igd_b_sent
          - sensor.upnp_igd_packets_received
          - sensor.upnp_igd_packets_sent
          - sensor.upnp_igd_kib_s_received
          - sensor.upnp_igd_kib_s_sent
          - sensor.upnp_igd_packets_s_received
          - sensor.upnp_igd_packets_s_sent
          - sensor.upnp_igd_b_received
        title: NIC
      - type: entities
        entities:
          - sensor.hp_laserjet_1010_cups_gutenprint_v5_2_13
        title: Office
      - type: entities
        entities:
          - input_select.themes
        title: Input select
      - type: media-control
        entity: media_player.receiver
      - type: entities
        entities:
          - switch.tasmota
          - switch.tasmota2
          - switch.rl1ch00dc45
          - switch.cups_2_4
          - switch.cups_5_8
          - switch.off
        title: Switch
      - type: weather-forecast
        entity: weather.pjwheim
        show_forecast: false
      - type: map
        geo_location_sources:
          - all

any hint?

Hello
I´m a noob at Home Assistant which currently runs on my rasp pi 3b.
I already got KNX integration running and I´m able to interact with the bus.
Now I´d like to have the momentary switch behaviour for my KNX switches (light, sunshade etc)
Why would I like to have this?! Well, my KNX components are communicating with a WAGO SPS and therefor the KNX sensors all act like push buttons. It is just the way I implemented it and I feel quit comfortable with this.
So the KNX group adresse (i. e. 0/0/1) will have the state ON (1) for a rising edge an OFF (0) for the falling edge - when the button is released.
I would like to have the same behaviour for my visu and hopefully the momentary thing will do the trick.

/config/Packages/knx.yaml:

######################
# KNX_IP_ITF
######################
knx:
  tunneling:
    host: "192.168.0.254"
######################
# Lights
######################
  switch:
    name: "Test Light"
    address: "0/0/1"
    state_address: "0/0/2" //optional

I need some kind of template that will work for all my knx switches (push buttons). How do I do this. The next step would be to add state_address to the KNX switch so that the final button card will send On/OFF and also be able to show the state of the output.
Any hints
Regards

What purpose do these momentary buttons serve? Only Dimming?
I’m having a hard time imagining how this is implemented in your installation.

Remember you can’t change behavior of the HA-configured switch, cover, etc entities if that was what you are looking for. You’d need to use templates and services for this… that would be quite complicated imho.
Also dimming and shutter position in HA always works with absolute positions - so a %-value is requested. There is no HA-native relative dimming/moving in the default entities.

PS: comments in yaml are marked by # not by // - your state_address will probably raise an error.

Thx for the reply. Maybe my discription with the shutter was not that good. I just need a possibility to send an ‘on’ and ‘off’ command with one button (push button behavior). First I just want to turn of a simple light. So the knx group address should send ‘on’ while pushing the button an ‘off’ while releasing. If that’s to complicated than a momentary behavior is also good. For me that means that after a button is pressed a ‘off’ signal (or ‘on’ signal if it supposed to be switch with a NC behavior) is send after a short delay.
I am more familiar with c-language… so that was just a quick change I made for this comment, the *. yaml is OK. Thx :wink:

This can be done with the knx.send service but I don’t know about Lovelace and where to use it in a card or button.

I found this but do not get it working. My skills are to weak.

As I read here it should work with custom button card too, but I also did not found any reference or example for my problem…

Hello… Please check my message below, maybe you can give me a hint for my problem?
Thank you very much