Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tap Action to switch between daily and hourly forecasts #490

Open
Zerosignal84 opened this issue Dec 3, 2024 · 7 comments
Open

Tap Action to switch between daily and hourly forecasts #490

Zerosignal84 opened this issue Dec 3, 2024 · 7 comments

Comments

@Zerosignal84
Copy link

It would be great to be able to tap the card and switch between the daily and hourly forecast data, I tried to implement a tap action on the card to trigger a sensor but the tap action was not overriding the default.

Perhaps it could be possible to build in to the core of the card the ability to receive the hourly and daily data feeds with as tap on the card allowing you to switch from daily to hourly forecast data.

@LGH531
Copy link

LGH531 commented Dec 6, 2024

You can do this by creating 2 cards (Daily, Hourly) both with a tap action to toggle an input_boolean, and then use the visibility conditions to control each card.

@Markoslager
Copy link

I have been trying to assign a tap action to this card myself, but i can't make it work.
Does this card support tap_action?

@LGH531
Copy link

LGH531 commented Dec 9, 2024

I have been trying to assign a tap action to this card myself, but i can't make it work. Does this card support tap_action?

I got tap action to work for me.

@Zerosignal84
Copy link
Author

It didn’t work for me when trying that is why I was here asking for a solution as I had the same idea you had.

If you don’t mind sharing, what is the yaml that you used for the card to get it working?

@Zerosignal84
Copy link
Author

Ok so I got this to work with the following YAML and an input_boolean - thanks for the suggestion LGH.

type: custom:clock-weather-card
entity: weather.
sun_entity: sun.sun
title: 
forecast_rows: 5
time_format: 12
weather_icon_type: fill
show_humidity: true
show_decimal: true
tap_action:
  action: call-service
  service: input_boolean.toggle
  service_data:
    entity_id: input_boolean.clock_weather_card_switch
visibility:
  - condition: state
    entity: input_boolean.clock_weather_card_switch
    state: "off"

@LGH531
Copy link

LGH531 commented Dec 9, 2024

Ok so I got this to work with the following YAML and an input_boolean - thanks for the suggestion LGH.

type: custom:clock-weather-card
entity: weather.
sun_entity: sun.sun
title: 
forecast_rows: 5
time_format: 12
weather_icon_type: fill
show_humidity: true
show_decimal: true
tap_action:
  action: call-service
  service: input_boolean.toggle
  service_data:
    entity_id: input_boolean.clock_weather_card_switch
visibility:
  - condition: state
    entity: input_boolean.clock_weather_card_switch
    state: "off"

Glad you got it working.... I thought I had attached some sample code for you, but obviously I didn't.... apologies

@Markoslager
Copy link

thanks for the example, i now see where i went wrong.
Will try this tonight!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants