royto / logbook-card

Logbook card for Home Assistant UI Lovelace
GNU General Public License v3.0
204 stars 9 forks source link

t.split is not a function error #49

Closed ctcoder5 closed 2 years ago

ctcoder5 commented 2 years ago

I must be doing some incorrect setup on this card for hiddenState. It does not appear to be recognizing my yaml array below. I get the same error when I uncomment out the state_map below. If I change the - on to something like - true, it does not give an error but also does not hide the entity state. What seems to be the problem? I am trying to show only the 'on' states of a hue motion detector. config:

title: Home
views:
  - path: default_view
    title: Home
    cards:
      - type: 'custom:logbook-card'
        desc: true
        entity: binary_sensor.hue_outdoor_motion_sensor_1_motion
        hiddenState:
          - on
        title: Garage Door Motion Sensor
        # state_map:
        #  - label: Motion
        #    value: on
        history: 1
        show:
          separator: true

error text:

t.split is not a function
type: custom:logbook-card
desc: true
entity: binary_sensor.hue_outdoor_motion_sensor_1_motion
hiddenState:
  - true
title: Garage Door Motion Sensor
history: 1
show:
  separator: true
royto commented 2 years ago

I tried with this configuration and i got no error :

type: custom:logbook-card
desc: true
entity: binary_sensor.detecteur_mouvement_escalier_occupancy
hiddenState:
  - 'on'
state_map:
  - label: 'No motion detected'
    value: 'off'
title:  Garage Door Motion Sensor
history: 1
show:
  separator: true

The Map state should not include value that are hidden because ... they are hidden

royto commented 2 years ago

I got an t.split error with true also. It is intepreted as bool and not string. Bool has no split method ...

ctcoder5 commented 2 years ago

Thanks @royto , that solved my issue. I appreciate your time to solve this for me.