How to Switch WordClock via HTTP and Input Text via UI or Automation

Hi everyone, I have a Word Clock with a WS2812

I would like to switch this on/off via Homeassistant, which I have already implemented via configuration.yaml

  - platform: command_line
        command_on: "/usr/bin/curl -X GET"
        command_off: "/usr/bin/curl -X GET"
        value_template: '{{ value == "1" }}'
        friendly_name: Wordclock

Now I would also like to pass texts or values to start a ticker or dim the clock, the commands are:

Ticker http ://
Brightness: Value 0- 10: http ://

Unfortunately I can’t do it, who can help me?

    - authentication: basic
      scan_interval: 60
      resource_template: "http://{{ states('input_text.sa_site_id') }}sste&action=saveticker"

Welcome to the forums.

Have a read of the post linked below, especially item 11 about formatting. YAML is indent sensitive and to assist people in helping, you should use the “formatted text” tags when posting, so they can read your yaml correctly.

Okay sorry

Not sure what this is here? Shouldn’t you configure a RESTful switch to pass your input_text to the Wordclock endpoint?

Or is there a Wordclock custom component you are using?

Yes I want to use the RESTful switch, no custom component. I don’t know how to put the input text into the REST command as a variable. I also have trouble creating an input slider for the brightness setting.

If you aren’t interested in any returned value from doing the settings maybe shell_command is the way to go. Not having a WordClock or the API - this is a guess based on your post:

  wc_set_text: "/usr/bin/curl -X GET http://{{ states('input_text.sa_site_id') }}sste&action=saveticker"
  wc_set_brightness: # insert brightness etc

These days I create helpers like input_text and input_number in the GUI - but if you want to do them in YAML the examples are in the docs.

    name: "WordClock Brightness"
    initial: 30
    min: 1
    max: 100
    step: 1

    name: "WordClock Message"
    initial: ""

Then automations to update on change of value:

    - platform: state
        - input_text.sa_site_id
      service: shell_command.wc_set_text
# etc for other helpers.

ah okay that only works via automation not directly like with a switch

I works by moving a slider in the UI. Nothing more is required apart from the helper and a short automation.

Even if you used a RESTful switch alone, that isn’t going to accept a numeric value.