I can make a light widget for this just fine, but it does not show up as a device, which seems to prohibit me from using it in scenes and automations. How do I deal with this?
I also have tried using YAML for mqtt light/switch to get HA to derive a “device”, but no luck. The documentation says that the device config portion only works with discovery, so that would explain why YAML can’t be used to create a “device”.
However there is a work around that you can read about here where a script is use to publish an MQTT topic/data that emulates discovery:
I have played with this some using the developer’s tool->Services using mqtt.publish instead of a script mentioned in that thread.
That’s an overstatement. It only prohibits you from creating Device Automations via the UI. Other than that, all entities can be used in scenes and automations.
The concept of “Device” serves as a way to organize entities (to group them by common purpose). For example, my printer is rendered as a Device with many entities such as Toner Remaining, Drum Remaining, Page Count, etc. It also offers the ability to create a Device Automation for any its “child entities”. However, with or without a “parent” Device, entities can be referenced by scripts, scenes, and automations.
If you like the organizational benefit of a the Device concept, and the ability to create Device Automations, then you cannot define an MQTT Light via YAML. This part you added here is invalid:
You must define the MQTT Light using MQTT Discovery because it supports the definition of Devices. For an example, follow the link wmaker posted above.
Ok, thanks. I have found the possibility for entries by now. I didn’t find them particularly intuitive. For dimming, I was successful with “Call service” -> “light.turn_on” and specify brightness in the data section.
You can use entities in a scene, not devices (not via the Scene Editor or in YAML). A device’s entities have states and scenes control an entity’s state.
You’re conflating what the Scene Editor presents in the UI to represent what it actually uses within a scene. It may present Devices as a choice but it will only use the entities associated with the device. I suggest you examine the YAML code of a scene created by the Scene Editor. You won’t find references to the device, only to its associated entities.
The only place you will find a reference to a device is when you create a Device Automation (i.e. an automation with a Device Trigger).
I’m running the same version on two instances of Home Assistant (one is Home Assistant OS and the other is Home Assistant Supervised) and the Scene Editor in both shows Entity selection.
Found it, thanks. That’s confusing.
Now I could add the entity.
Next task: Find out how to assign an actual status. But I guess I’ll read up on that before I bother you guys