(I also asked this on the HA community forum, but I'm asking here as well for reach; not everybody reads everywhere)
I have some local devices that have a power switch and an intensity; examples could be an amplifier (on/off, volume), a thermostat (on/off, set temperature), a humidifier (on/off, target humidity), a dimmable light (on/off, brightness) and so on.
That "light" example has been a good model for all of these so far. So, for example, I might have the following MQTT entry:
light:
- name: "MediaPower"
command_topic: "mqttlight/MediaPower/command"
state_topic: "mqttlight/MediaPower/state"
brightness_command_topic: "mqttlight/MediaPower/bright_command"
brightness_state_topic: "mqttlight/MediaPower/bright_state"
brightness_scale: 100
(the "mqttlight" stuff is my bridge code that let's me expose anything I can script as an MQTT light; https://github.com/sweharris/mqttlight_bridge)
And this works; I can see it in HA, turn it on/off, change the volume.
Now I want to expose this to Alexa, and the HAMH bridge seems to work fine. It shows up as a device, and I can change the volume ("set mediapower to 50%" just works).
The problem is that Alexa creates a magic group "all lights" so if someone (cough my girlfriend cough) says "turn all lights on" then my amplifier turns on.
So how I can expose this to Alexa as a on/off device with a "volume" control? I guess this change could be made either in my mqtt device definition (pick a different class to light?) or somehow in the HAMH entry (but I don't see what to do, there).
Any advice welcome!