node.jsdevicegoogle-homegoogle-smart-homesmart-device

Smart home google action not responding and device is always offline


I created a smart home action using action-on-google and nodeJs, and it works fine. When you say turn on switch off, it sends MQTT request to my server, means that onExecute function works fine but the problem is that google doesn't respond to my command by OK it says "sorry it looks like your device not available right now", I observed also that my device is always offline in Google home app. Is it required to work with firebase and get device state from there?


Solution

  • Firebase is one of web services allowed to store a device's states. You can feel free to use other web services.

    If your device is offline, it may be because your Google Home App hasn't received your device's states. Here are two paths for Google Home App receiving your device's data:

    1. Google Server will send a action.devices.QUERY intent and callback your function (e.g. onQuery) to get the data of your device through your fulfillment, see action.devices.QUERY. Thus, please print logs in the onQuery function and make sure that your function works fine.

    2. Your smart home action must use the API of reportStateAndNotification to update your device's data in the Home Graph, see Method: devices.reportStateAndNotification.

    If Google Assistant gives you "Sorry, device is not available right now", it probably is because the Google server hasn't received correct information from your fulfillment. Please follow the suggestions above and try it again.

    If you're still having issues, check your logs to identify the particular issue for that device.