Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95533

Wled Random effects

$
0
0

@smith.james0 wrote:

Hi,

I have been trying to create an automation to select a random Wled effect each time it is called.

This is my current automation (non-random)

- id: '1575326339804'
  alias: CarPresence_ON
  description: ''
  trigger:
  - entity_id: binary_sensor.carpresence
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
   - data:
       effect: '[FX=44] Merry Christmas'
       entity_id: light.wled_lights
     service: light.turn_on

To generate the random number effect I used this code

sensor:
  - platform: random
    name: Random Effect
    minimum: 0
    maximum: 82

Then I updated my automation to add the random effect

- id: '1575326339804'
  alias: CarPresence_ON
  description: ''
  trigger:
  - entity_id: binary_sensor.carpresence
    from: 'off'
    platform: state
    to: 'on'
  condition: []
 action:
  - service: mqtt.publish
    data_template:
      topic: wled/all/api
      payload: FX={{ states("sensor.random_effect") }}

But it doesn’t work! From what I can work out Wled likes the effect formatted like this effect: ‘[FX=00] Solid’ instead of FX=00
I have googled but I cannot find an example of this, can anyone help?

Regards
James

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95533

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>