Rest command api ? optimalisation

hello ,

i control my wled brightness directly via tha wled api

i use this , but i suppose this code is not optimal when i use much bigger API’s

can this code be optimalised or is tis 100% the way to go ?

thanks for your reply :slight_smile:

config.yaml :

rest_command:
  restwled_felheid:
    url: "http://192.168.1.172/win&A={{states('input_number.wled_felheid') }}"
    method: get
    content_type: "application/json"
  
    

automatisation :

alias: rest
description: ""
trigger:
  - platform: state
    entity_id:
      - input_number.wled_felheid
condition: []
action:
  - action: rest_command.restwled_felheid
    metadata: {}
    data: {}
mode: single

Is there a reason you’re not just using the WLED integration in core?

2 reasons : first the wled-api is for me a testcase to learn programming restcommands

secondly : wled has no direct setting so change the brightness easyly , ( the ha core uses wled on and brightness as attribute )

ontopic , is my code/approch a go or nogo ?

kind regards ,