-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Light brightness trait not exposed to Google #413
Comments
Hi, @yschen5812 I tested my configuration and didn't notice any issue. Regards |
I can reproduce this. The "Bettlampe" is connected using SmartNora and has the brigthness controls. The "Testlampe" is connected using node-red-contrib-google-smarthome and it does not have any brigthness controls. {
"type": "action.devices.types.LIGHT",
"traits": [
"action.devices.traits.Brightness",
"action.devices.traits.OnOff"
],
"name": {
"defaultNames": [
"Node-RED Light"
],
"name": "Testlampe",
"nicknames": []
},
"roomHint": "Wohnzimmer",
"willReportState": true,
"notificationSupportedByAgent": false,
"attributes": {
"commandOnlyBrightness": false,
"commandOnlyOnOff": false,
"queryOnlyOnOff": false
},
"deviceInfo": {
"manufacturer": "Node-RED",
"model": "nr-device-light-v1",
"swVersion": "1.0",
"hwVersion": "1.0"
},
"otherDeviceIds": [
{
"deviceId": "1bbb378b69bd4748"
}
],
"customData": {},
"id": "1bbb378b69bd4748"
} This seems to happen when the device has not received any brightness values yet. After I injected a I see if I can automatically inject default values on restart. In the meantime, you can try an inject node to automatically inject values. The second value is |
@FireWizard52 For my case I'm only using this node as a subscriber that syncs whatever dimmer value in Google Home to my node-red flow so I was not sending any command to the node. @Caprico85's simple workaround solves my problem. Thanks both of you for taking your time looking into this issue. I'm good with closing this issue without a fix to make the injection happen on restart, but I'll leave it to you. |
I'll leave it open until I (or somebody else) has implemented a fix to automatically inject default values at boot. Might also fix some other problems where devices behave "strange" after a restart. |
Hello @Caprico85 and @yschen5812, I now really understand, what your issue was.
I would not be happy if @Caprico85 creates a fix in such a way that by default always an On/Off value and a brightness of 0 is injected and that that overrides my Inject of the actual status. My "default at boot" is always the actual status! Thanks for your work on this application. Regards |
I think I agree with @FireWizard52 to avoid injecting fixed default values on every restart. It seems like the only goal is to make Google Home to notice the "brightness" attribute of the device so it would be better to leave the values along if possible. If the only way to flag the attribute to Google Home is via setting values then maybe better to serve with values from previous state. |
Hi All, |
On a second thought, I have to agree. Setting new default values on every restart is not good. Especially since every deployment in Node-RED means the service is restarted so you're constantly losing your states. A better solution would probably be to query the HomeGraph for the current values and set only the states that are not already set. This would also provide an easier way to restore the current values on startup. |
I noticed that the light device I created with 'brightness' does not show the dimmer trait in Google Home app. All I can do there is toggling the light. The color trait does work though if I check it in the device node. I can see the color temperature value being passed to node-red if I make any changes in the app. Can anyone take a look at the dimmer trait, thanks!
The text was updated successfully, but these errors were encountered: