DewGew/Domoticz-Google-Assistant

Issues with controlling blinds

rbrouwer opened this issue · 4 comments

Describe the bug:
I have an issue controlling my blinds using DZGA. When I ask Google assistant to open my blinds, they stay closed. When I ask Google assistant to close my blinds, they stay opened.

Expected behavior:
When I ask Google assistant to open my blinds, they should be opened. When I ask Google assistant to close my blinds, they should be closed.

Logs:

2022-11-10 21:27:01 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=devices&rid=235 HTTP/1.1" 200 706
2022-11-10 21:27:01 - DEBUG - Starting new HTTP connection (1): x.x.x.x:x
2022-11-10 21:27:01 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=plans&order=name&used=true HTTP/1.1" 200 282
2022-11-10 21:27:01 - DEBUG - {
  "Binds 235": {
    "idx": 235,
    "type": "Blind",
    "state": "Closed",
    "lastupdate": "2022-11-10 21:27:01",
    "willReportState": true
  }
}
2022-11-10 21:27:01 - DEBUG - Starting new HTTP connection (1): x.x.x.x:x
2022-11-10 21:27:01 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=devices&rid=237 HTTP/1.1" 200 706
2022-11-10 21:27:01 - DEBUG - Starting new HTTP connection (1): x.x.x.x:x
2022-11-10 21:27:01 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=plans&order=name&used=true HTTP/1.1" 200 282
2022-11-10 21:27:01 - DEBUG - {
  "Binds 237": {
    "idx": 237,
    "type": "Blind",
    "state": "Closed",
    "lastupdate": "2022-11-10 21:27:01",
    "willReportState": true
  }
}


*Asks Google assistant to close blinds 235 and 237*


2022-11-10 21:27:35 - INFO - Request {
  "inputs": [
    {
      "context": {
        "locale_country": "NL",
        "locale_language": "nl"
      },
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "Blind235"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OpenClose",
                "params": {
                  "followUpToken": "token",
                  "openPercent": 0
                }
              }
            ]
          },
          {
            "devices": [
              {
                "id": "Blind237"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OpenClose",
                "params": {
                  "followUpToken": "token",
                  "openPercent": 0
                }
              }
            ]
          }
        ]
      }
    }
  ],
  "requestId": "12838654118125862707"
}
2022-11-10 21:27:35 - ERROR - Unable to execute action.devices.commands.OpenClose for Blind235. Already in state
2022-11-10 21:27:35 - ERROR - Unable to execute action.devices.commands.OpenClose for Blind237. Already in state


*Asks Google assistant to open blinds 235 and 237*


2022-11-10 21:29:30 - INFO - Request {
  "inputs": [
    {
      "context": {
        "locale_country": "NL",
        "locale_language": "nl"
      },
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "Blind235"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OpenClose",
                "params": {
                  "followUpToken": "token",
                  "openPercent": 100
                }
              }
            ]
          },
          {
            "devices": [
              {
                "id": "Blind237"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OpenClose",
                "params": {
                  "followUpToken": "token",
                  "openPercent": 100
                }
              }
            ]
          }
        ]
      }
    }
  ],
  "requestId": "10015324715755094277"
}
2022-11-10 21:29:30 - DEBUG - Starting new HTTP connection (1): x.x.x.x:x
2022-11-10 21:29:30 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=command&param=switchlight&idx=235&switchcmd=Off HTTP/1.1" 200 47
2022-11-10 21:29:30 - DEBUG - Starting new HTTP connection (1): x.x.x.x:x
2022-11-10 21:29:30 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=command&param=switchlight&idx=237&switchcmd=Off HTTP/1.1" 200 47
2022-11-10 21:29:30 - DEBUG - Starting new HTTP connection (1): x.x.x.x:x
2022-11-10 21:29:30 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=devices&rid=235 HTTP/1.1" 200 707
2022-11-10 21:29:30 - DEBUG - Starting new HTTP connection (1): x.x.x.x:x
2022-11-10 21:29:30 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=plans&order=name&used=true HTTP/1.1" 200 282
2022-11-10 21:29:30 - DEBUG - {
  "Binds 235": {
    "idx": 235,
    "type": "Blind",
    "state": "Closed",
    "lastupdate": "2022-11-10 21:29:30",
    "willReportState": true
  }
}
2022-11-10 21:29:30 - DEBUG - Starting new HTTP connection (1): x.x.x.x:x
2022-11-10 21:29:30 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=devices&rid=237 HTTP/1.1" 200 708
2022-11-10 21:29:30 - DEBUG - Starting new HTTP connection (1): x.x.x.x:x
2022-11-10 21:29:30 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=plans&order=name&used=true HTTP/1.1" 200 282
2022-11-10 21:29:30 - DEBUG - {
  "Binds 237": {
    "idx": 237,
    "type": "Blind",
    "state": "Closed",
    "lastupdate": "2022-11-10 21:29:30",
    "willReportState": true
  }
}


* Opened Blind235 using Domoticz *


2022-11-10 21:43:06 - INFO - Response {
  "devices": {
    "Blind235": {
      "descriptiveCapacityRemaining": "FULL",
      "isRunning": true,
      "online": true,
      "openPercent": 100
    },
    "Blind237": {
      "descriptiveCapacityRemaining": "FULL",
      "isRunning": true,
      "online": true,
      "openPercent": 0
    }
  }
}
2022-11-10 21:43:06 - DEBUG - Starting new HTTPS connection (1): homegraph.googleapis.com:443
2022-11-10 21:43:06 - DEBUG - https://homegraph.googleapis.com:443 "POST /v1/devices:reportStateAndNotification HTTP/1.1" 200 None
2022-11-10 21:43:06 - DEBUG - Device state reported {
  "agentUserId": "1234",
  "payload": {
    "devices": {
      "states": {
        "Blind235": {
          "descriptiveCapacityRemaining": "FULL",
          "isRunning": true,
          "online": true,
          "openPercent": 100
        },
        "Blind237": {
          "descriptiveCapacityRemaining": "FULL",
          "isRunning": true,
          "online": true,
          "openPercent": 0
        }
      }
    }
  },
  "requestId": "10771216958444856203"
}


*Asks Google assistant again to close blinds 235 and 237*


2022-11-10 21:44:47 - INFO - Request {
  "inputs": [
    {
      "context": {
        "locale_country": "NL",
        "locale_language": "nl"
      },
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "Blind235"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OpenClose",
                "params": {
                  "followUpToken": "token",
                  "openPercent": 0
                }
              }
            ]
          },
          {
            "devices": [
              {
                "id": "Blind237"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OpenClose",
                "params": {
                  "followUpToken": "token",
                  "openPercent": 0
                }
              }
            ]
          }
        ]
      }
    }
  ],
  "requestId": "4760118533585825676"
}
2022-11-10 21:44:47 - DEBUG - Starting new HTTP connection (1): x.x.x.x:x
2022-11-10 21:44:47 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=command&param=switchlight&idx=235&switchcmd=On HTTP/1.1" 200 47
2022-11-10 21:44:47 - ERROR - Unable to execute action.devices.commands.OpenClose for Blind237. Already in state
2022-11-10 21:44:47 - DEBUG - Starting new HTTP connection (1): x.x.x.x:x
2022-11-10 21:44:47 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=devices&rid=235 HTTP/1.1" 200 704
2022-11-10 21:44:47 - DEBUG - Starting new HTTP connection (1): x.x.x.x:x
2022-11-10 21:44:47 - DEBUG - http://x.x.x.x:x "GET /json.htm?type=plans&order=name&used=true HTTP/1.1" 200 282
2022-11-10 21:44:47 - DEBUG - {
  "Blind235": {
    "idx": 235,
    "type": "Blind",
    "state": "Open",
    "lastupdate": "2022-11-10 21:44:47",
    "willReportState": true
  }
}

Desktop (please complete the following information):

  • Domoticz version 2022.2 (build 14716)
  • Dzga version 1.10.9
  • Python Version 3.7.3 (running Dzga as docker)

Smartphone (please complete the following information):

  • Device: Windows 10 -> using Melvin-Abraham/Google-Assistant-Unofficial-Desktop-Client , but also a Samsung Galaxy S8, Samsung Galaxy S9, Samsung Galaxy A52

Additional context, screenshot:
I believe somehow DZGA reverses that commands it should be sending. Sending "On" when it should send "Off" and reversed as well.

Changing

url += 'Off'
and
url += 'Off'
to 'On'

Changing

and to 'Off'

Resolves the issue for me. Could Domoticz new blinds behaviour be causing this?
https://www.domoticz.com/wiki/Blinds

My devices are "Reverse Open/Close State" Off and "Reverse Position" Off, so "Standard Blind".

Domoticz have change some for blinds I look into this when I get time :) thanks for reporting

Changing

url += 'Off'

and

url += 'Off'

to 'On'

Changing


and


to 'Off'

Resolves the issue for me. Could Domoticz new blinds behaviour be causing this? https://www.domoticz.com/wiki/Blinds

My devices are "Reverse Open/Close State" Off and "Reverse Position" Off, so "Standard Blind".

My Blinds are percentage type, so I had to modify also :

response['openPercent'] = 0

to '100' ;

response['openPercent'] = 100

to '0' ;

response['openPercent'] = 100

to '0' ;

response['openPercent'] = 0

to '100' ;

Fixed in latest beta, works only with Domoticz version above 2022.2