Read Device Configuration and Create Effects List

I need some guidence. I would like to generate a list, in this case lighting "effect"s by reading the MQTT discovery data. The device I am utilizing for this effort is a Govee Curtain Light.

The homeassistant/light/gv2mqtt-698FC58884592A52/config payload contains an “effect_list:”. I have currently copied the list into the configuration.yaml as an input_select. But if there are updates to the “effect_list:” it will have to manually be changed. Ideally code would read the device config payload and generate the updated list that could be used in automations.

Here is the MQTT-Explorer json for the previously noted topic

{
  "availability_topic": "gv2mqtt/availability",
  "name": null,
  "origin": {
    "name": "gv2mqtt",
    "sw_version": "2024.01.24-ea3cd430",
    "url": "https://github.com/wez/govee2mqtt"
  },
  "device": {
    "name": "Smart Curtain Lights",
    "manufacturer": "Govee",
    "model": "H70B1",
    "via_device": "gv2mqtt",
    "identifiers": [
      "gv2mqtt-698FC58884592A52"
    ]
  },
  "unique_id": "gv2mqtt-698FC58884592A52",
  "schema": "json",
  "command_topic": "gv2mqtt/light/698FC58884592A52/command",
  "state_topic": "gv2mqtt/light/698FC58884592A52/state",
  "optimistic": false,
  "supported_color_modes": [
    "rgb",
    "color_temp"
  ],
  "color_mode": true,
  "brightness": true,
  "brightness_scale": 100,
  "icon": "mdi:light-bulb",
  "effect": true,
  "effect_list": [
    "",
    "A Fishing Cat",
    "Aircraft Battle",
    "Alternate",
    "Artist Palette",
    "Astronaut",
    "Atlantis",
    "ATREIDES-FREMEN",
    "Autumn Leaves",
    "Ballet Girl",
    "Bat",
    "Big Ben",
    "Big Bus",
    "Big Panda",
    "Big Pendulum",
    "Birds Flying",
    "Birthday Cake",
    "Bonsai",
    "Bouncing Ball",
    "Bubble",
    "Burj Khalifa",
    "Butterfly",
    "Cable Car",
    "Cactus",
    "Camping",
    "Candy Cane",
    "Candy Crush",
    "Cannibal Flower",
    "Carousel",
    "Cherry blossoms",
    "Christmas Bell",
    "Christmas Gift",
    "Christmas Gift Box",
    "Christmas Stocking",
    "Christmas Tree",
    "Christmas Wreath",
    "Circus",
    "Clown",
    "Clownfish",
    "Coachella Poster",
    "Code",
    "Countdown",
    "Crab",
    "Crossing",
    "Cupid's Arrow",
    "Demon Power",
    "Dinosaur",
    "Dodging",
    "Dot Eater",
    "Dove",
    "Dr. Duck",
    "Drift Bottle",
    "Drinks",
    "Duck Bathing",
    "DUNE",
    "Easter Egg",
    "Egyptian Fresco",
    "Eiffel Tower",
    "Elk",
    "Falling Petals",
    "Ferris Wheel",
    "Finger Heart",
    "Fire",
    "Fireplace",
    "Flamingo Couple",
    "Forest",
    "Forest Fireflies",
    "Fox",
    "Game Controller",
    "Ghost",
    "Gingerbread House",
    "Gingerbread Man",
    "Golden Gate Bridge",
    "Gopher",
    "Gourmet",
    "Gradient Movement",
    "Graffiti",
    "Greedy Snake",
    "Groovy",
    "HARKONNEN",
    "Hatch",
    "Heart Scale",
    "Heartbeat",
    "Horse Head",
    "Hot Air Balloon",
    "Ice-cream Cone",
    "Jellyfish",
    "Jumping Chicken",
    "Lighthouse",
    "Lion",
    "Little Whale",
    "Lollipop",
    "Lottery Machine",
    "Lotus Pond",
    "Love",
    "Love Heart",
    "Magic Hat",
    "Maiden",
    "Maze",
    "Meteor",
    "Mondrian",
    "Moon",
    "Moonlight",
    "Mount Fuji",
    "Mountain Forest",
    "Mountaintop",
    "Mushroom",
    "Music Note",
    "Music: Crossing",
    "Music: DreamColor",
    "Music: FallingSand",
    "Music: FloatingMist",
    "Music: MeteorShower",
    "Music: Spectrum",
    "Orbital Rail",
    "Owl",
    "Panda",
    "Parabola",
    "Peach Checkers",
    "Peacock",
    "Piggy Bank",
    "Pineapple House",
    "Pizza Monster",
    "Planet",
    "Poker",
    "Pumpkin",
    "Rabbit",
    "Rabbit Running",
    "Racing",
    "Rainbow",
    "Rainbow Swirl",
    "Reverse",
    "Rhomb",
    "Ring Toss",
    "Ripple",
    "Rocket",
    "Saint Patrick's Day",
    "Sakura",
    "Santa Claus",
    "Sea Horse",
    "Sea Island",
    "Sea Turtle",
    "Seesaw",
    "Shiny Rainbow",
    "Shoot Hoops",
    "Siren",
    "Skateboard",
    "Sled",
    "Smudge",
    "Snowman",
    "Soccer",
    "Soccer Juggling",
    "Soothing",
    "Space",
    "Space Walk",
    "Spider",
    "Spin",
    "Stack",
    "Star",
    "Starfish",
    "Starry Night",
    "Strike",
    "Sunflowers",
    "Sunrise",
    "Sunset",
    "Surfing",
    "Telephone",
    "The Pyramids",
    "The Scream",
    "The Son of Man",
    "The Taj Mahal",
    "Tic-Tac-Toe",
    "UFO",
    "Umbrella",
    "Undersea King",
    "Valentine's Day",
    "Water Drop",
    "Waterfall",
    "Wave",
    "Weightlifting",
    "Whale",
    "White Swan",
    "Windmill",
    "Windmill Kingdom",
    "wine glass",
    "Yoga",
    "Zombie Hand"
  ],
  "min_mireds": 111,
  "max_mireds": 500,
  "payload_available": "online"
}

Would it be possible for you to reformat that so we can read it better?
How to help us help you - or How to ask a good question.

1 Like

Troubleshooting MQTT? MQTT-Explorer can help you be successful!

If you have Addons available, try adding this Addon repository to your Addon list. GitHub - GollumDom/addon-repository.

Also editing your first post would help as stated above /\ …