DewGew/Domoticz-Google-Assistant

Blind is not working on Beta 1.22.25 (docker)

ayasystems opened this issue · 7 comments

Describe the bug:
Google send an error when try to change blind position

Expected behavior:

Logs:

X-Forwarded-Scheme: https
X-Forwarded-Proto: https
X-Forwarded-For: 66.249.81.168
X-Real-IP: 66.249.81.168
Content-Length: 479
Content-Type: application/json;charset=UTF-8
Google-Assistant-API-Version: v1
Authorization: Bearer xxxxxxxxxxxxxxxxxxxxx
User-Agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
Accept-Encoding: gzip, deflate, br


2022-12-15 10:23:39 - INFO - {
  "inputs": [
    {
      "context": {
        "locale_country": "ES",
        "locale_language": "es"
      },
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "Blind223"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OpenClose",
                "params": {
                  "followUpToken": "xxxxxxxxxxxx",
                  "openPercent": 100
                }
              }
            ]
          }
        ]
      }
    }
  ],
  "requestId": "11652661381557868569"
}
2022-12-15 10:23:39 - INFO - Google Assistant requests an action.devices.EXECUTE
2022-12-15 10:23:39 - ERROR - local variable 'p' referenced before assignment
2022-12-15 10:23:39 - ERROR - Error handling message {'inputs': [{'context': {'locale_country': 'ES', 'locale_language': 'es'}, 'intent': 'action.devices.EXECUTE', 'payload': {'commands': [{'devices': [{'id': 'Blind223'}], 'execution': [{'command': 'action.devices.commands.OpenClose', 'params': {'followUpToken': 'xxxxxxxxxxx', 'openPercent': 100}}]}]}}], 'requestId': '11652661381557868569'}: {'errorCode': 'unknownError'}


Desktop (please complete the following information):

  • Domoticz version beta 2022.2 (build 14726)
  • Dzga version 1.22.25
  • Python Version 3.7.3 (your docker image)

Smartphone (please complete the following information):

  • Device: voice command fails and also android google home aplication.

Additional context, screenshot:
Blind 223 is defined as Blinds percetage without stop in domoticz

The same test with "Venetian Blinds EU" works fine! Only crash with "Blinds Percentage"

Venetian Blinds EU rise an error when you say to google stop blind.... The blind is stopped but after stopped google say that there was an error....

X-Forwarded-Scheme: https
X-Forwarded-Proto: https
X-Forwarded-For: 74.125.211.20
X-Real-IP: 74.125.211.20
Content-Length: 283
Content-Type: application/json;charset=UTF-8
Google-Assistant-API-Version: v1
Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxx
User-Agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
Accept-Encoding: gzip, deflate, br


2022-12-15 10:57:56 - INFO - {
  "inputs": [
    {
      "context": {
        "locale_country": "ES",
        "locale_language": "es"
      },
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "Blind222"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.StartStop",
                "params": {
                  "start": false
                }
              }
            ]
          }
        ]
      }
    }
  ],
  "requestId": "2748373945094363560"
}
2022-12-15 10:57:56 - INFO - Google Assistant requests an action.devices.EXECUTE
2022-12-15 10:57:56 - DEBUG - Starting new HTTP connection (1): 192.168.3.241:80
2022-12-15 10:57:56 - DEBUG - http://192.168.3.241:80 "GET /json.htm?type=command¶m=switchlight&idx=222&switchcmd=Stop HTTP/1.1" 200 47
2022-12-15 10:57:56 - DEBUG - Starting new HTTPS connection (1): homegraph.googleapis.com:443
2022-12-15 10:57:56 - DEBUG - https://homegraph.googleapis.com:443 "POST /v1/devices:reportStateAndNotification HTTP/1.1" 400 None
2022-12-15 10:57:56 - ERROR - 400 Client Error: Bad Request for url: https://homegraph.googleapis.com/v1/devices:reportStateAndNotification
2022-12-15 10:57:56 - ERROR - Error handling message {'inputs': [{'context': {'locale_country': 'ES', 'locale_language': 'es'}, 'intent': 'action.devices.EXECUTE', 'payload': {'commands': [{'devices': [{'id': 'Blind222'}], 'execution': [{'command': 'action.devices.commands.StartStop', 'params': {'start': False, 'online': True}}]}]}}], 'requestId': '2748373945094363560'}: {'errorCode': 'unknownError'}

As you can see the domoticz URL is malformed

/json.htm?type=command¶m=switchlight&idx=222&switchcmd=Stop

the correct url should be
/json.htm?type=command&param=switchlight&idx=222&switchcmd=Stop

I havent added any 'Stop' command for Blind percentage. Is it useful?

Fixed for "ERROR - local variable 'p' referenced before assignment" in Beta

Venetian Blinds EU is not percentage device, only open close stop...

Error is to report state, it works as suppost anyway, I can try to fix this

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days