i8beef / HomeAutio.Mqtt.GoogleHome

MIT License
215 stars 29 forks source link

Trait Timer and Cook did not appear controler UI on google home app #145

Closed NomNom1992 closed 1 week ago

NomNom1992 commented 1 week ago

Hi sir, Im trying to add more device with other traits. For the outlet device, in addition to the mandatory OnOff trait, I want to add the Timer trait for the scheduling function. The Timer trait configuration when I fill in the add trait interface is as follows: Attributes: { "maxTimerLimitSec": 14400, "commandOnlyTimer": false } Commands: { "action.devices.commands.TimerStart": { "timerTimeSec": "google/home/outlet/AGF65T/setTimer" } } State: { "timerRemainingSec": { "topic": "google/home/outlet/AGF65T/setTimer", "valueMap": null } } However, when syncing with the Google Home app, the Timer doesn't display any control interface. I tried again with an Microwave device example from Google Cloud with 3 traits: StartStop, Cook, and Timer. I can only control the state of the StartStop trait, and only this trait shows a UI. Thanks for read

i8beef commented 1 week ago

I have not used the timer trait before, and Google's developer portal is down so I can't check the JSON to see if its correct. Can you actually use voice commands to set times with it?

That said, reminder that Google is very hit or miss on supporting a usable UI for most traits, and if I remember right device type comes into play too (ie, while there ARE controls for Media stuff, I believe they only show up when the device type is specifically certain selections...). In essence, if you are expecting the Google Home interface to be an exhaustive control interface for your devices, I'm afraid it doesn't do that.

Google doesn't seem to think its worth the investment. 🤷

Edit: one other tip, its usually a good idea to separate state and command topics. Don't know how much you know about your target device, but "google/home/outlet/AGF65T/setTimer" being used for BOTH will likely get you into trouble as the "status" publishes will trigger the state to change again, and you get yourself into a loop.

NomNom1992 commented 1 week ago

Thank for your tip, i try to set timer with voice command and value of timer has change. So exactly google does not support UI for it. have a good day sir