JonahKr / power-distribution-card

A Lovelace Card for visualizing power distributions.
MIT License
212 stars 13 forks source link

Feature request | Buttons #136

Closed rerpires closed 10 months ago

rerpires commented 1 year ago

Hi,

You know what would be great ? To be able to see the amount of power being consumed using one entity, and be able to tap the button of another entity to turn on or off the appliance.

In my case, I am using Shelly EM to mesure the EV Charging cable, and I have a contactor to turn on or off the chargers. They are different entities. Would be great to see the power usage and if I want to turn it of just tap that button.

Also it would also be cool if the ON and OFF could change the color of the button !

Thank you for your efforts. It's awesome !

Rui

JonahKr commented 1 year ago

Hi there 👋 You can already do that, although i just noticed the required menus for that don't show up in the UI Editor, so thats something. But in yaml you can define the actions happening on a tap or double tap. this can call a service toggeling the said entity.

Does this solve this for you? Let me know and take care!

rerpires commented 1 year ago

Hi there 👋 You can already do that, although i just noticed the required menus for that don't show up in the UI Editor, so thats something. But in yaml you can define the actions happening on a tap or double tap. this can call a service toggeling the said entity.

Does this solve this for you? Let me know and take care!

Hi,

YAML is showing this:

  - decimals: '0'
    display_abs: true
    name: EV Chrg
    unit_of_display: W
    consumer: true
    icon: mdi:car-electric
    entity: sensor.shellyem_evcharging_power
    preset: car_charger
    invert_value: false
    color_threshold: '1000'
    icon_color:
      bigger: green
      smaller: gray
    arrow_color:
      bigger: green
      smaller: gray
    double_tap_action:
      undefined: {}
    tap_action:
      undefined:
        undefined:
          undefined:
            action: more-info

according to a a YAML using a button I have:

  - entity: switch.shellyem_garagem
    icon: mdi:car
    name: Carregadores dos Carros
    secondary_info: last-changed

The thing is ... how can I use the TAP to toggle another entity ?

Thank you !

Regards

Rui

JonahKr commented 10 months ago

Hi there 👋 Sorry, it took a while to have time to revisit my projects... The issue you described in the later comment is fixed with the next release. I also checked the action editors, and they seem to work fine, so your tap actions should be configurable from the ui now.

If you still experience issues, feel free to reopen!

Take care and stay safe! 👍