i8beef / HomeAutio.Mqtt.GoogleHome

MIT License
215 stars 29 forks source link

Error when creating traits - Device does not support trait type #85

Closed sognen closed 4 years ago

sognen commented 4 years ago

Hi, First, many thanks for this app - much appreciated.

When creating a trait and clicking the Create button I get an error message saying that it is not a valid trait type and device does not support trait type, e.g.,

Error The value 'action.devices.traits.ArmDisarm' is not valid for Trait. Device does not support trait type

I have tried with a few device types and traits - all giving the same error.

New Device and new trait: After creating the device I can see the definition in the googleDevice file. After loading the trait template and clicking the Create button I get the above error message.

Existing Device and new trait: Same as a above. Tried with dimmeableLight and creating trait ColorSetting

Existing Device and update existing trait: Appears to be working.

Nothing to be found in the the log (log level set to error).

What I have tried so far:

The devices and traits I created a few months back continue to work.

Best Regards, Cato

i8beef commented 4 years ago

Yes, the app now enforces the supported traits that Google has listed in their documentation. ArmDisarm is only supported on SecuriySystem device type. Is there another device type that you expect it on?

https://github.com/i8beef/HomeAutio.Mqtt.GoogleHome/blob/master/src/HomeAutio.Mqtt.GoogleHome/Models/DeviceMetadata.cs

sognen commented 4 years ago

Hi, Understood. When I mentioned that I created an ArmDisarm trait it was for a device with type SecuritySystem. Similarly when creating a device of type Scene I get the error message when trying to create a trait Scene. All is done using the webui.

i8beef commented 4 years ago

{ DeviceType.Scene, new List { TraitType.Scene } },

That should be supported. What error are you getting?

sognen commented 4 years ago

I get the same error message as with security system, albeit different trait of course.

Error The value 'action.devices.traits.Scene' is not valid for Trait. Device does not support trait type

i8beef commented 4 years ago

Hmm yeah looks to be a bug I introduced in the editor. Ill try and get a fix out tonight.

i8beef commented 4 years ago

Try the latest. Should be fixed.

sognen commented 4 years ago

Thanks - working now, much appreciated.