WLED custom Patterns with Home Assistant | Guide

WLED custom Patterns with Home Assistant

After following this guide, you’ll be able to

1. set your custom presets from Home Assistant.
2. set the brightness via an Home Assistant slider.
3. set the effect speed via an Home Assistant slider.
4. set the effect intensity via an Home Assistant slider.
4. optionally: configure whole WLED via an iframe in HA.
5. optionally: view the temperature from a Dellas sensor with rest API (requires custom firmware on WLED Device).

Demos are available here:

Prerequisites:

1 - Connect HomeAssistant to WLED and setup entitys

I’ll assume, that you have the WLED device up and running, and that the HomeAssistant and WLED instance(s) can reach eachother.
First, give you WLED devices a name beginning with “WLED-” like shown in this example:
image

Second, connect your WLED devices to HomeAssistant. Go to Settings>Integration (or click the My HA badge below)


If there are already WLED devices to configure, you’re good to go. Just click on the configure button.
If there are no new devices discovered, you might wanna reboot your HA instance or manually add the WLED device with its IP-Address to Home Assistant. Click the button below and fill in the device IP into the host field.


1.1 - Add needed helpers into HA.

We need 4 entitys per WLED device:
_3x Number helpers
_1x Dropdown Helper

  • Go to Settings>Helpers
  • Click on the “Add Helpers” button on the “Number” option.
  • Set the name to “wled [devicename] brightness”(of course you have to replace [devicename] with your devices name), set the maximum value to “255” and click on create.

Repeat this step twice with the name “wled [devicename] effect intensity” and “wled [devicename] effect speed”(of course you have to replace [devicename] with your devices name).


1.2 - Add Dropdown helper(s)

  • Click on the “Add Helpers” button on the “Dropdown” option.

  • Set the name to “wled [devicename] presets” (again, you have to replace [devicename] with your devices name), and make sure you create an option with the same name for each of your WLED presets. If you don’t have any presets in WLED yet, now is the time to do so.

!Repeat step 1.1-1.2 for every WLED device you have!

The helper overview should look something like this:

1.3 - WLED XML API shell_command

I found out, that the best way is to send the brightness, effect speed and effect intensity values to WLED via their XML API.
To use their API we have to populate the shell_commands config. Note: This can only be done via an editor!
If there is no “shell_command:” inside your configuration.yaml it isn’t a problem. Just add this line to your configuration.yaml:

shell_command: !include shell_commands.yaml

You also have to create a new file called “shell_commands.yaml” in the /config directory and add this line:

wled_api: "curl -X POST 'http://{{ ip }}/win&{{ type }}={{ value }}' &>/dev/null &"

1.5 - Adding Flow to NodeRED

  • Open the NodeRED User-Interface by clicking on the “OPEN WEB UI” button at Supervisor>Node-RED
  • Click on the Hamburger Menu at the upper right and click on the import tab at the dropdown.
  • Paste the JSON Array below inside the red field, select import to new flow and click on “Import”
[{"id":"f123c818.383d18","type":"tab","label":"WLED","disabled":false,"info":""},{"id":"718b241f.6fd71c","type":"server-state-changed","z":"f123c818.383d18","name":"","server":"ef3a8b0f.f5fc38","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"^input_number\\.wled_[^*]+$","entityidfiltertype":"regex","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"milliseconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":450,"y":780,"wires":[["5f7b0e33.f11a"]]},{"id":"5f7b0e33.f11a","type":"switch","z":"f123c818.383d18","name":"","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"brightness","vt":"str"},{"t":"cont","v":"effect_intensity","vt":"str"},{"t":"cont","v":"effect_speed","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":730,"y":780,"wires":[["e3faa14b.0787a"],["eb9eea6a.849c18"],["8e45758d.6a3618"]]},{"id":"e3faa14b.0787a","type":"change","z":"f123c818.383d18","name":"Change","rules":[{"t":"move","p":"payload","pt":"msg","to":"brightness","tot":"msg"},{"t":"change","p":"brightness","pt":"msg","from":".0","fromt":"str","to":"","tot":"str"},{"t":"move","p":"topic","pt":"msg","to":"wled_ip","tot":"msg"},{"t":"change","p":"wled_ip","pt":"msg","from":"\\input_number.wled_zylinder.*$","fromt":"re","to":"192.168.30.178","tot":"str"},{"t":"change","p":"wled_ip","pt":"msg","from":"\\input_number.wled_moodlite.*$","fromt":"re","to":"192.168.30.47","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":740,"wires":[["2b569320.86eddc"]]},{"id":"2b569320.86eddc","type":"template","z":"f123c818.383d18","name":"Set value","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n  \"domain\": \"shell_command\",\n  \"service\": \"wled_api\",\n  \"data\": {\n    \"ip\": \"{{wled_ip}}\",\n    \"type\": \"A\",\n    \"value\": \"{{brightness}}\"\n    }\n\n}\n","output":"str","x":1060,"y":740,"wires":[["b319bb32.32a428"]]},{"id":"eb9eea6a.849c18","type":"change","z":"f123c818.383d18","name":"Change","rules":[{"t":"move","p":"payload","pt":"msg","to":"intensity","tot":"msg"},{"t":"change","p":"intensity","pt":"msg","from":".0","fromt":"str","to":"","tot":"str"},{"t":"move","p":"topic","pt":"msg","to":"wled_ip","tot":"msg"},{"t":"change","p":"wled_ip","pt":"msg","from":"\\input_number.wled_zylinder.*$","fromt":"re","to":"192.168.30.178","tot":"str"},{"t":"change","p":"wled_ip","pt":"msg","from":"\\input_number.wled_moodlite.*$","fromt":"re","to":"192.168.30.47","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":780,"wires":[["5b87b12.331a55"]]},{"id":"8e45758d.6a3618","type":"change","z":"f123c818.383d18","name":"Change","rules":[{"t":"move","p":"payload","pt":"msg","to":"speed","tot":"msg"},{"t":"change","p":"speed","pt":"msg","from":".0","fromt":"str","to":"","tot":"str"},{"t":"move","p":"topic","pt":"msg","to":"wled_ip","tot":"msg"},{"t":"change","p":"wled_ip","pt":"msg","from":"\\input_number.wled_zylinder.*$","fromt":"re","to":"192.168.30.178","tot":"str"},{"t":"change","p":"wled_ip","pt":"msg","from":"\\input_number.wled_moodlite.*$","fromt":"re","to":"192.168.30.47","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":820,"wires":[["2bf5c9d2.210196"]]},{"id":"5b87b12.331a55","type":"template","z":"f123c818.383d18","name":"Set value","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n  \"domain\": \"shell_command\",\n  \"service\": \"wled_api\",\n  \"data\": {\n    \"ip\": \"{{wled_ip}}\",\n    \"type\": \"IX\",\n    \"value\": \"{{intensity}}\"\n    }\n\n}\n","output":"str","x":1060,"y":780,"wires":[["b319bb32.32a428"]]},{"id":"2bf5c9d2.210196","type":"template","z":"f123c818.383d18","name":"Set value","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n  \"domain\": \"shell_command\",\n  \"service\": \"wled_api\",\n  \"data\": {\n    \"ip\": \"{{wled_ip}}\",\n    \"type\": \"SX\",\n    \"value\": \"{{speed}}\"\n    }\n\n}\n","output":"str","x":1060,"y":820,"wires":[["b319bb32.32a428"]]},{"id":"b319bb32.32a428","type":"api-call-service","z":"f123c818.383d18","name":"","server":"ef3a8b0f.f5fc38","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"{}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":true,"x":1230,"y":780,"wires":[[]],"inputLabels":["payload.data"]},{"id":"85ceefdc.5ae42","type":"comment","z":"f123c818.383d18","name":"WLED Input_number","info":"When changing WLED input_numbers, send values via XML API to associated WLED device.","x":380,"y":700,"wires":[]},{"id":"56228732.594688","type":"server-state-changed","z":"f123c818.383d18","name":"","server":"ef3a8b0f.f5fc38","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"^light\\.wled_[^*]+$","entityidfiltertype":"regex","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":420,"y":480,"wires":[["4d8bfdb5.1abc14"]]},{"id":"850192f0.2db7c","type":"api-call-service","z":"f123c818.383d18","name":"Brightness","server":"ef3a8b0f.f5fc38","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"{}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1050,"y":460,"wires":[[]]},{"id":"7423da9.bb41424","type":"api-call-service","z":"f123c818.383d18","name":"Intensity","server":"ef3a8b0f.f5fc38","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"","data":"{}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1040,"y":540,"wires":[[]]},{"id":"37186d6b.7feda2","type":"api-call-service","z":"f123c818.383d18","name":"Speed","server":"ef3a8b0f.f5fc38","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"{}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1030,"y":500,"wires":[[]]},{"id":"a0a7ff22.5ac78","type":"template","z":"f123c818.383d18","name":"set value","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n  \"domain\": \"input_number\",\n  \"service\": \"set_value\",\n  \"data\": {\n    \"value\": \"{{speed}}\",\n    \"entity_id\": \"input_number.{{entity}}_effect_speed\"\n    }\n\n}","output":"str","x":880,"y":500,"wires":[["37186d6b.7feda2"]]},{"id":"4d8bfdb5.1abc14","type":"change","z":"f123c818.383d18","name":"Change","rules":[{"t":"move","p":"data.new_state.attributes.speed","pt":"msg","to":"speed","tot":"msg"},{"t":"move","p":"data.new_state.attributes.intensity","pt":"msg","to":"intensity","tot":"msg"},{"t":"move","p":"data.new_state.attributes.brightness","pt":"msg","to":"brightness","tot":"msg"},{"t":"move","p":"data.new_state.attributes.preset","pt":"msg","to":"preset","tot":"msg"},{"t":"move","p":"topic","pt":"msg","to":"entity","tot":"msg"},{"t":"change","p":"entity","pt":"msg","from":"light.","fromt":"str","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":520,"wires":[["a0a7ff22.5ac78","c2b3dc5f.7c9cb","b3bc8079.560ff","a5cf99a9.dc2aa8"]]},{"id":"c2b3dc5f.7c9cb","type":"template","z":"f123c818.383d18","name":"set value","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n  \"domain\": \"input_number\",\n  \"service\": \"set_value\",\n  \"data\": {\n    \"value\": \"{{brightness}}\",\n    \"entity_id\": \"input_number.{{entity}}_brightness\"\n    }\n\n}","output":"str","x":880,"y":460,"wires":[["850192f0.2db7c"]]},{"id":"b3bc8079.560ff","type":"template","z":"f123c818.383d18","name":"set value","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n  \"domain\": \"input_number\",\n  \"service\": \"set_value\",\n  \"data\": {\n    \"value\": \"{{intensity}}\",\n    \"entity_id\": \"input_number.{{entity}}_effect_intensity\"\n    }\n\n}","output":"str","x":880,"y":540,"wires":[["7423da9.bb41424"]]},{"id":"a5cf99a9.dc2aa8","type":"function","z":"f123c818.383d18","name":"fu","func":"\nif(msg.preset == \"3\"){\n    msg.iselpreset = \"Candle\";\n} else if(msg.preset  == \"4\") {\n    msg.iselpreset = \"Chunchun\";\n} else if(msg.preset  == \"5\") {\n    msg.iselpreset = \"Colortwinkles\";\n} else if(msg.preset  == \"7\") {\n    msg.iselpreset = \"Dancing Shadows\";\n} else if(msg.preset  == \"12\") {\n    msg.iselpreset = \"Departure\";\n} else if(msg.preset  == \"20\") {\n    msg.iselpreset = \"Disolve rainbow\";\n} else if(msg.preset  == \"21\") {\n    msg.iselpreset = \"juggle cold\";\n} else if(msg.preset  == \"13\") {\n    msg.iselpreset = \"Lightning\";\n} else if(msg.preset  == \"14\") {\n    msg.iselpreset = \"Loading\";\n} else if(msg.preset  == \"15\") {\n    msg.iselpreset = \"Nois1\";\n} else if(msg.preset  == \"16\") {\n    msg.iselpreset = \"Plasma\";\n} else if(msg.preset  == \"19\") {\n    msg.iselpreset = \"Rainbow\";\n} else if(msg.preset  == \"17\") {\n    msg.iselpreset = \"Ripple fire\";\n} else if(msg.preset  == \"8\") {\n    msg.iselpreset = \"Saw\";\n} else if(msg.preset  == \"9\") {\n    msg.iselpreset = \"Scanner dual\";\n} else if(msg.preset  == \"10\") {\n    msg.iselpreset = \"Sineleon\";\n} else if(msg.preset  == \"11\") {\n    msg.iselpreset = \"Spots fade\";\n} else if(msg.preset  == \"18\") {\n    msg.iselpreset = \"Twinkleup Party\";\n\n} else {\n    msg.iselpreset = \"22\";\n}\n\n\nreturn msg;// halt flow (dont send msg to next node)\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":600,"wires":[["6f91caf4.561e94"]]},{"id":"6f91caf4.561e94","type":"template","z":"f123c818.383d18","name":"set value","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n  \"domain\": \"input_select\",\n  \"service\": \"select_option\",\n  \"data\": {\n    \"option\": \"{{iselpreset}}\",\n    \"entity_id\": \"input_select.{{entity}}_presets\"\n    }\n\n}","output":"str","x":1040,"y":600,"wires":[["ef0b18a.4e1f0e8"]]},{"id":"ef0b18a.4e1f0e8","type":"api-call-service","z":"f123c818.383d18","name":"Preset","server":"ef3a8b0f.f5fc38","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"{}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":true,"x":1210,"y":600,"wires":[[]]},{"id":"4e655a10.011914","type":"comment","z":"f123c818.383d18","name":"WLED LIGHT","info":"Adjust input_number's and input select when wled light entity updates.\n\nIn order to set the current pattern also in the input_select entity, the WLED pattern ID has to be translated into normal names.","x":350,"y":400,"wires":[]},{"id":"5c4af52d.0ad42c","type":"server-state-changed","z":"f123c818.383d18","name":"","server":"ef3a8b0f.f5fc38","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"^input_select\\.wled_[^*]+$","entityidfiltertype":"regex","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"milliseconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":440,"y":980,"wires":[["8f5960d.ab10ba"]]},{"id":"fac6fcd.e0bc1","type":"api-call-service","z":"f123c818.383d18","name":"","server":"ef3a8b0f.f5fc38","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"{}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":true,"x":1190,"y":980,"wires":[[]],"inputLabels":["payload.data"]},{"id":"f1b682d0.93aa1","type":"function","z":"f123c818.383d18","name":"fu","func":"\nif(msg.preset == \"Candle\"){\n    msg.iselpreset = \"3\";\n} else if(msg.preset  == \"Chunchun\") {\n    msg.iselpreset = \"4\";\n} else if(msg.preset  == \"Colortwinkles\") {\n    msg.iselpreset = \"5\";\n} else if(msg.preset  == \"Dancing Shadows\") {\n    msg.iselpreset = \"7\";\n} else if(msg.preset  == \"Departure\") {\n    msg.iselpreset = \"12\";\n} else if(msg.preset  == \"Disolve rainbow\") {\n    msg.iselpreset = \"20\";\n} else if(msg.preset  == \"juggle cold\") {\n    msg.iselpreset = \"21\";\n} else if(msg.preset  == \"Lightning\") {\n    msg.iselpreset = \"13\";\n} else if(msg.preset  == \"Loading\") {\n    msg.iselpreset = \"14\";\n} else if(msg.preset  == \"Noise1\") {\n    msg.iselpreset = \"15\";\n} else if(msg.preset  == \"Plasma\") {\n    msg.iselpreset = \"16\";\n} else if(msg.preset  == \"Rainbow\") {\n    msg.iselpreset = \"19\";\n} else if(msg.preset  == \"Ripple fire\") {\n    msg.iselpreset = \"17\";\n} else if(msg.preset  == \"Saw\") {\n    msg.iselpreset = \"8\";\n} else if(msg.preset  == \"Scanner dual\") {\n    msg.iselpreset = \"9\";\n} else if(msg.preset  == \"Sineleon\") {\n    msg.iselpreset = \"10\";\n} else if(msg.preset  == \"Spots fade\") {\n    msg.iselpreset = \"11\";\n} else if(msg.preset  == \"Twinkleup Party\") {\n    msg.iselpreset = \"18\";\n} else {\n    msg.iselpreset = \"22\";\n}\n\n\nreturn msg;// halt flow (dont send msg to next node)\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":980,"wires":[["2c50d7ef.08b9f8"]]},{"id":"8f5960d.ab10ba","type":"change","z":"f123c818.383d18","name":"Change","rules":[{"t":"move","p":"payload","pt":"msg","to":"preset","tot":"msg"},{"t":"move","p":"topic","pt":"msg","to":"entity","tot":"msg"},{"t":"change","p":"entity","pt":"msg","from":"input_select.","fromt":"str","to":"","tot":"str"},{"t":"change","p":"entity","pt":"msg","from":"_presets","fromt":"str","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":980,"wires":[["f1b682d0.93aa1"]]},{"id":"2c50d7ef.08b9f8","type":"template","z":"f123c818.383d18","name":"set value","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n  \"domain\": \"wled\",\n  \"service\": \"preset\",\n  \"data\": {\n    \"preset\": \"{{iselpreset}}\",\n    \"entity_id\": \"light.{{entity}}\"\n    }\n\n}","output":"str","x":1040,"y":980,"wires":[["fac6fcd.e0bc1"]]},{"id":"7d522f60.2a19","type":"comment","z":"f123c818.383d18","name":"WLED Input_select","info":"When changing WLED input_select, send values via XML API to associated WLED device.\n\nThis is done by translating the effect name into WLEDs preset id system","x":370,"y":900,"wires":[]},{"id":"ef3a8b0f.f5fc38","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false}]

1.6 - Create lovelace cards

To really get the benefits of the changes, the following cards need to be created in the Lovelace Dashboard:

  • WLED-Lamps-Card
  • Configuration View & iframe cards for each WLED device

1.7 - Create lovelace cards: WLED-Lamps-Card

In order to add a new card to the Lovelace Dashboard, you should first be in the “Edit-Dashboard-Mode”. To enter this mode, click on the three dots in the upper right corner of the dashboard and then on “Edit Dashboard”.

  • Click on “ADD CARD”(image ), scroll to the bottom of the page and click on “Manual”.
    Replace everything in the text field to:
type: entities
title: WLED-Lamps
show_header_toggle: false
entities:
  - entity: light.wled_[devicenameA]
    tap_action:
      action: call-service
      service: browser_mod.popup
      service_data:
        style:
          '--ha-card-border-radius': 0px
          border-radius: 20px
        title: [devicenameA]-Lamp Detail
        card:
          type: entities
          title: [devicenameA]-Lamp
          show_header_toggle: false
          entities:
            - sensor.wled_[devicenameA]_estimated_current
            - switch.wled_[devicenameA]_nightlight
            - switch.wled_[devicenameA]_sync_send
            - sensor.wled_[devicenameA]_temp
            - entity: light.wled_[devicenameA]
              tap_action:
                action: more-info
              hold_action:
                action: navigate
                navigation_path: wled-[devicenameA]
            - input_select.wled_[devicenameA]_presets
            - input_number.wled_[devicenameA]_brightness
            - input_number.wled_[devicenameA]_effect_speed
            - input_number.wled_[devicenameA]_effect_intensity
    hold_action:
      action: navigate
      navigation_path: wled-[devicenameA]
  - entity: light.[devicenameB]
    tap_action:
      action: call-service
      service: browser_mod.popup
      service_data:
        style:
          '--ha-card-border-radius': 0px
          border-radius: 20px
        title: [devicenameB]-Lamp Detail
        card:
          type: entities
          title: [devicenameB]-Lamp
          show_header_toggle: false
          entities:
            - sensor.wled_[devicenameB]_estimated_current
            - switch.wled_[devicenameB]_nightlight
            - switch.wled_[devicenameB]_sync_send
            - sensor.wled_[devicenameB]_temp
            - entity: light.wled_[devicenameB]
              tap_action:
                action: more-info
              hold_action:
                action: navigate
                navigation_path: wled-[devicenameB]
            - input_select.wled_[devicenameB]_presets
            - input_number.wled_[devicenameB]_brightness
            - input_number.wled_[devicenameB]_effect_speed
            - input_number.wled_[devicenameB]_effect_intensity
    hold_action:
      action: navigate
      navigation_path: wled-[devicenameB]

You also have to replace [devicename] with your device name (Example: switch.wled_[devicenameA]_sync_sendswitch.wled_zylinder_sync_send,
switch.wled_[devicenameB]_sync_sendswitch.wled_moodlite_sync_send)

1.9 - Create lovelace cards: WLED-Lamps-Card

In order to add a new view to the Lovelace Dashboard, you should first be in the “Edit-Dashboard-Mode”. To enter this mode, click on the three dots in the upper right corner of the dashboard and then on “Edit Dashboard”.

  • Click on the small pencil icon located behind the view where we just added the cards.
  • Set the URL to wled-view and click on save.
  • Click on the small plus sign(image) to the right of the last Lovelace view.
  • Set the title and URL to wled-[devicename] and hit save.
  • Enter the previously created Lovelace view and click on the plus sign(image) in the bottom right corner. Scroll to the bottom of the page and click on “Manual”.
    Replace everything in the text field to:
type: 'custom:button-card'
icon: 'mdi:arrow-left-circle'
name: Back to "WLED-View"
size: 20%
tap_action:
  action: navigate
  navigation_path: wled-view
  • Add another Lovealce Card, scroll down to the “Webpage” option, select it, replace “URL” to http://[WLEDIP] (replace WLEDIP with your WLED IP), set the “Title” to something like Configure WLED Device (only local), set the “Aspect Radio” to 160%

  • Repeat the steps starting from the separation line for each WLED device

2 - Optional: Temperature of an Dellas Sensor

If you have an LED Controller Board like the QuinLED Dig Uno, you can’t get the sensor readings into HA. At least with generic WLED binarys!

2.5 - Upload custom firmware to WLED device

To retrieve the temperature via the XML API interface of WLED, a custom wled firmware have to be installed. This can be done in the settings of WLED. This option is called “Manual OTA Update”.

DellasPin: GPIO14

Download custom WLED 0.12.1-b1 binarys here:
Github

Download custom WLED SourceCode here to self compile(if you wanna change the dellas port):
Github

2.9 - Temperature from Dellas Sensor via HA Rest Sensor

To add this sensor, you have to go into your sensors.yaml and add these lines:

- platform: rest
  name: WLED [devicename] Temp
  resource: http://[WLEDIP]/win
  json_attributes_path: "$.dt"
  unit_of_measurement: "°C"
  value_template: "{{ value_json.dt.vs }}"
- platform: rest
  name: WLED [devicename] Temp
  resource: http://[WLEDIP]/win
  json_attributes_path: "$.dt"
  unit_of_measurement: "°C"
  value_template: "{{ value_json.dt.vs }}"

Of course you have to again replace [WLEDIP] with your WLED IP and [devicename] to your WLED devicename.

image

3 - You’re done!

5 Likes

Very good manual.
Facing some issues:

Error running command: `curl -X POST 'http://{{ ip }}/win&{{ type }}={{ value }}' &>/dev/null &`, return code: 6

2:02:09 PM – (ERROR) Shell Command - message first occurred at 1:59:31 PM and shows up 8 times
1 Like