Enable sending "learn" command to Tellstick

For Tellstick selflearning devices you will need to issue a Learn command from the tellstick to sync the device with the parameters set up.

The tellstick.py component in Home Assistant does not have support for TELLSTICK_LEARN that is available in tellcore-py.

  • Normally the user need to go to command-line and enter tdtool --learn [device-id] to perform this action. Adding this feature in Home Assistant would render the integration more user friendly.

  • With the upcoming Tellstick and Tellstick Duo i Hass.io there will be no way for users to perform this action since they do not have direct access to the cli that hosts the daemon. --edit-- this is now made possible via service calls from home assistant to the hassio addon.

I could settle with the possibility to issue the learn command from the Home Assistant service caller. Just drill down and input the corresponding device id entered in the tellstick configuration.

Optionally or version 2 might be more user friendly by incorporating a Learn button in the web ui if a device is of self learning type:

Mockup:
learnbutton_mockup

Alternative solution…
Use the following to mitigate the problem - adding card with some tellstick features to your lovelace.

bild

configuration.yaml

input_number:
  tellstick_selflearn:
    name: TellStick Selflearn
    initial: 0
    min: 0
    max: 99999
    mode: box
    unit_of_measurement: ID
    icon: mdi:teach

automations.yaml

- alias: 'TellStick Selflearning'
  trigger:
    platform: state
    entity_id: input_number.tellstick_selflearn
  action:
    - service: hassio.addon_stdin
      data_template:
        addon: "core_tellstick"
        input:
          function: "learn"
          device: "{{trigger.to_state.state | int}}"

ui-lovelace.yaml

- title: Settings
  id: settings
  icon: mdi:settings-box
  panel: false
  cards:
    - type: entities
      title: TellStick
      show_header_toggle: false
      entities:
        - entity: input_number.tellstick_selflearn
          name: Learn Device
        - type: call-service
          icon: mdi:format-list-bulleted
          name: List devices (see log for results)
          action_name: List
          service: hassio.addon_stdin
          service_data:
            addon: "core_tellstick"
            input:
              function: "list"
        - type: weblink
          name: Addon page / Log
          url: /hassio/addon/core_tellstick
          icon: mdi:page-next
2 Likes

This is brilliant!

HI @endor,

I think that configuration is somehow changed as I cannot get this working anymore?

My panel looks like this when I added those configurations:

image

Maybe I did some mistake, so maybe somebody can help how to fix it?

I just answered to myself, so I get it fixed and it was my own mistake and then case is closed. :slight_smile: