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

Name and states for binary sensors #835

Open
javierpose opened this issue Dec 30, 2024 · 0 comments
Open

Name and states for binary sensors #835

javierpose opened this issue Dec 30, 2024 · 0 comments
Labels
feature-request New feature or request

Comments

@javierpose
Copy link

I want to use a chart for show states of binary sensors, but I don't see a way to display a custom status, in this case open or close, instead of 0 and N/A, neither in the legends nor in the header states :

type: custom:apexcharts-card
header:
    title: Entrada
    show: true
    show_states: true
    colorize_states: true

graph_span: 6h
all_series_config:
  stroke_width: 2
  curve: stepline
  transform: "return x === 'on' ? 1 : 0;"
  show:
    legend_value: true
apex_config:
  chart:
    height: 200px
  tooltip:
    y:
      formatter: >
        function(val) {
          return val === 1 ? 'Abierto' : 'Cerrado';
        }
yaxis:
  - min: 0
    max: 1
    decimals: 0
    apex_config:
      tickAmount: 0
      labels:
        formatter: >
          EVAL:function(val) {
            return val === 1 ? 'Abierto' : 'Cerrado';
          }
series:
  - entity: binary_sensor.entrada_contact
    name: Puerta
  - entity: binary_sensor.nuki_casa_kato_kale_locked
    name: Cerradura

Captura de pantalla 2024-12-30 a las 14 21 05

@javierpose javierpose added the feature-request New feature or request label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant