Open ajtatum opened 6 months ago
Any ideas on this? I'm running into conflicts between hubitat and home assistant if the switches are part of an automation in HA. I'd have to move all automations that are a part of this switch to Hubitat... Which would suck lol.
I'm having exactly the same problem! It would be great if there was a way to override the heuristics that this integration uses for determine what to expose in Home Assistant for a given device.
@jason0x43 do you have any ideas as to how we might work around this? If you have a direction to point me in, I'd be willing to take a stab at a PR, as well, if one is necessary.
Hmmm...a couple questions:
Thanks for responding so quickly!! So to be clear, this thing is a dimmer switch, not a light. Here's a link: https://residential.lutron.com/us/en/stand-alone-controls/smart-bulb-dimmer.
I can't speak for @ajtatum, but I wish to use the level from the dimmer switch to set the brightness level on a light/group of lights that are in Home Assistant but not in Hubitat.
The dimmer switch doesn't have a level attribute in HA; it just shows up as a simple switch. It does have a level in Hubitat.
Could you send me the device capabilities for the switch? From the screenshot I see that it has a level
attribute, so I'd expect it to have Hubitat's SwitchLevel capability, but maybe it's not reporting that (third party drivers don't always seem to be great about following Hubitat's spec).
I'm actually using the official driver! Here's the output, it does seem to have the SwitchLevel capability:
{
"id": "148",
"name": "Lutron Aurora Controller",
"label": "Second floor guest room dimmer",
"type": "Lutron Aurora Controller",
"room": "Second Floor Guest Room",
"attributes": [
{
"name": "level",
"currentValue": 1,
"dataType": "NUMBER"
},
{
"name": "pushed",
"currentValue": 1,
"dataType": "NUMBER"
},
{
"name": "battery",
"currentValue": 100,
"dataType": "NUMBER"
},
{
"name": "numberOfButtons",
"currentValue": 1,
"dataType": "NUMBER"
},
{
"name": "switch",
"currentValue": "on",
"dataType": "ENUM",
"values": [
"on",
"off"
]
}
],
"capabilities": [
"Configuration",
"Actuator",
"Battery",
{
"attributes": [
{
"name": "battery",
"dataType": null
}
]
},
"SwitchLevel",
{
"attributes": [
{
"name": "level",
"dataType": null
}
]
},
"Switch",
{
"attributes": [
{
"name": "switch",
"dataType": null
}
]
},
"PushableButton",
{
"attributes": [
{
"name": "numberOfButtons",
"dataType": null
},
{
"name": "pushed",
"dataType": null
}
]
}
],
"commands": [
"configure",
"off",
"on",
"push",
"setLevel"
]
}
Oh... huh! I just went and checked in Home Assistant, and actually there is a level entity there! It was just disabled for some reason. I enabled it, I'll see if that works for automations. Will report back!
Yeeeup, that works just fine! This at least resolves my issue; there may be another issue with the third party driver, but all that I was missing was that the level and switch entities for the device were disabled for some reason!
there is a level entity there
Interesting. What does that look like in HA? I've only ever seen level controls that are part of the light or switch.
Are you overriding the device type, by chance? I would have expected that device to be detected as a light due to the presence of the SwitchLevel attribute, in which case the switch level would have been wrapped into the light state as a "brightness" attribute which could be used in automations.
Regarding the original issue, about utilizing "level" as a trigger, currently the only device triggers the integration supports are for button pushes. Support for other triggers is doable, but until that support is added you could use a numeric state trigger on a level attribute.
Are you overriding the device type, by chance? I would have expected that device to be detected as a light due to the presence of the SwitchLevel attribute, in which case the switch level would have been wrapped into the light state as a "brightness" attribute which could be used in automations.
Yes, I am! I just added a second Aurora device to verify this: if I don't override the type to be a switch, the "light" device that is imported seems to have no level entity at all, nor does it have a level control, just an on/off toggle.
Once I enabled the level and switch entities, though, I was indeed able to use entity state triggers to accomplish what I wanted!
the "light" device that is imported seems to have no level entity at all, nor does it have a level control, just an on/off toggle.
It wouldn't have a separate level entity as a light, or generally as any other type of switch with level control (cover, fan controller, etc.). For example, as a light, the level is the brightness
attribute of the light. If a level switch is used as a fan controller, the level would map to the percentage
(fan speed) attribute.
If the Aurora controller is added as a light, it should have a switch entity:
Tapping the entity name (not toggling it) should give you a controller with an on-off button and a level slider.
If you look at the state info for the light entity in the Developer Tools, it should have a brightness
attribute (at least if the switch is on).
If, as a light, it's only showing up as a basic on/off light without a brightness attribute, something is wrong somewhere. 🙂
Sorry I missed this as I've had some health issues, but thanks @jason0x43 for looking into this. It sounds like what I and @smoores-dev want are the same, so I'll take a look at the entity in HA to see if it updated to have the level control.
@smoores-dev / @jason0x43 - I tried both the default driver and the custom one and neither of them showed the "Level" sensor. Is there something I'm missing?
Default Driver:
Custom Driver:
It looks like it's still set up as a light; I had to override the device type to be "switch" to see the disabled level entity
@smoores-dev - I actually just read your comment about that and am researching how to override the device type. I've only used the Helper before to change the device type of a switch. Would you mind sharing how you go about doing that or sharing a link with more info? I'd really appreciate!
I've taken a couple stabs borrowing code from what I could find from ZHA and other integrations, but the configuration is invalid. I've tried something like:
hubitat:
device_config:
56: # Hubitat Device ID
type: "switch"
Oh! This is built in to the Hubitat integration; when you submit the configuration in the UI, one of the confirmation panels asks you about whether any devices that it detected as lights should actually be switches
I totally forgot about that popup, thanks @smoores-dev! I now have the Level sensor!
@ajtatum When using the device as a light (without overriding the type), if you tap the switch entity on the device page (not the toggle, but the entity name)
you should get a popup with a slider
The popup for a non-dimmable switch will be a toggle
The brightness slider control is how switch level is handled for a light. Lights won’t have separate sensors for brightness (level), color, or any other light attributes. That is typically how other Home Assistant integrations handle light devices as well.
Some common ways to react to brightness changes are:
brightness
), and then use that in automations.
Describe the bug
So I recently purchased a Lutron Aurora Controller and added it to Hubitat with a custom driver. This is how it shows up in Hubitat:
When I add it to the list of devices to be made available to Home Assistant, the device shows up as a light with a button which can toggle lights on and off:
When I to automations, the only "physical action" I can make use of is when the button is pushed:
There isn't any way for me to make an automation, that I know of at least, that can make use of the outer knob where someone can dim or brighten the lights. Right now, I've built an automation in Hubitat so that the lights basically copy the attributes of the Aurora controller, and while that works, I really don't want to have remember if an automation is in Hubitat or Home Assistant.
Is there anyway to take full advantage of this device in Home Assistant?
Thank you! AJ
Environment