Newbie configuration question

Hi All,

I’ve started using HA this week, after I using my own custom system for a long time.
The configuration really came up nicely, and the system looks cool.

There are a couple of things I’m having trouble with, probably due to lack of understanding how to work with HA, I would appreciate you helping me configuring them correctly.

  1. IR Device:
    I have a couple of Broadlink IR adapters that are used to control IR devices.
    One of them is a ceiling fan.
    I was able, using the remote.learn_command and remote.send_command creating buttons on the dashboard to control the fan.
    However, the fan is not a “device” in the HA system, and I couldn’t figure out how to create it.
    I wanted to use the “climate-fan-modes” card (as shown here), but for that I need the fan to be a device in the system, right?
    What am I missing?

  2. Custom Card:
    I wanted to create a custom blank card, to be used in a grid (I have a 4 column grid, and in 2 of the rows I only want 3 buttons).
    I followed the instructions here.
    I created the js file in a www folder (I also created the www folder in the config folder), restarted the system, created a resource on the dashboard and restarted the system again (just to be sure).
    When adding the card to the grid, I’m getting an error:

Custom element doesn't exist: content-card-blank. 
name: Blank
type: custom:content-card-blank

How can I debug it, and find out what the issue is?

Thank you for your help.

Hi welcome. Seems you are doing great for a newbie!

  1. You indeed need a fan entity (not per se a device) could try to build a template fan, but the problem is that for a fan template to work properly, you’d want to know the state of the fan, which you don’t. You could try to solve that part with a power metering smart olug (just for the meter, not the switch). I kind of went overboard with that trying to guess the fan speed and oscilation by looking at power consumption. It looks like this, placed in fans.yaml:
- platform: template
  fans:
    dakkapel:
      friendly_name: "Ventilator dakkapel"
      unique_id: fan.dakkapel
      value_template: "{{ is_state('switch.fan_dakkapel', 'on') and states('sensor.fan_dakkapel_power') | float(0) > 5 }}"
      direction_template: "{{ iif(this.attributes.direction == 'reverse','reverse','forward','forward') }}"
      percentage_template: >-
        {% set p = states('sensor.fan_dakkapel_power') | float(0) %}
        {% if p <= 5 %}0
        {% elif p <= 19 %}40
        {% elif p <= 21 %}20
        {% elif p <= 22.2 %}40
        {% elif p <= 23.5 %}20
        {% elif p <= 25.1 %}60
        {% elif p <= 25.6 %}80
        {% elif p <= 26.5 %}100
        {% elif p <= 27.5 %}60
        {% elif p <= 27.6 %}80
        {% else %}100
        {% endif %}
      oscillating_template: >-
        {% set p = states('sensor.fan_dakkapel_power') | float(0) %}
        {{ p > 22.2 and p <= 23.5 or p >= 26.5 }}
      turn_on:
        action: remote.send_command
        data:
          num_repeats: 1
          command: power
          device: Fan dakkapel
        target:
          entity_id: remote.remote_dakkapel
      turn_off:
        action: remote.send_command
        data:
          num_repeats: 1
          delay_secs: 0.4
          command: power
          device: Fan dakkapel
        target:
          entity_id: remote.remote_dakkapel
      set_percentage:
        action: remote.send_command
        data:
          num_repeats: >-
            {% set n = (100 + percentage - (this.attributes.percentage | int(0))) / 20 % 5 %}
            {{ iif(n < 1, 1, n, 1) }}
          delay_secs: 0.4
          command: speed
          device: Fan dakkapel
        target:
          entity_id: remote.remote_dakkapel
      set_oscillating:
        action: remote.send_command
        data:
          num_repeats: 0
          delay_secs: 0.4
          command: rotate
          device: Fan dakkapel
        target:
          entity_id: remote.remote_dakkapel
      set_direction:
        action: remote.send_command
        data:
          num_repeats: 1
          delay_secs: 0.4
          command: rotate
          device: Fan dakkapel
        target:
          entity_id: remote.remote_dakkapel
      speed_count: 5
  1. What do you need the card for? There are many custom cards on offer to get you started. Starting from scratch is possible, but may not be needed.

For blank cards I just use a picture card with a transparent png.

Hi @Edwin_D @tom_l,
Thank you for the detailed reply.

About the fan, I’m not interested in its state or power consumption, I just want to use the climate card, and not have 4 buttons like I have today.
I’ll try to implement the fan as an entity, there is no new entity button, so I have to do it via the configuration.yaml file, right?

About the card, I don’t really need a card, just a spacer.
I will implement @tom_l’s idea (transparent png), it’s simple and easy.

Cheers.

Template fans are yaml only. But I’m not sure the fan template will work without a state.

Climate is a different beast, you’ll to fully template that you probably need something like:

If it is just on/off you are after based on temperature, this will work:

I have a follow-up question about the fan.

I was able to create a custom entity for the fan, and now I can select it as an entity on a dashboard.
I’m working now on the script, that the entity configuration is triggering.
I tried to use the same “Remote: Send Command” action, that I have used on the dashboard button, but there is something wrong.

This is the sequence of the script:

When trying to run it (from the 3 dots on the top right corner), the command actually sent to the fan, but then it shows an unknown error:
Err

When trying to run the whole script it also sends the command, and then shows a different error message:
“Failed to perform the action script/lv_fan_off. Enum RemoteKeyCode has no value defined for name ‘KEYCODE_fan_off’”

When running the action from the button on the dashboard, there is no error.

I would really like to understand what the error is, and where is it coming from, so I could fix it and avoid it in the future.

What am I doing wrong?