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¶m=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¶m=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¶m=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
Domoticz-Google-Assistant/trait.py
Line 385 in 21209b7
Domoticz-Google-Assistant/trait.py
Line 396 in 21209b7
Changing
Domoticz-Google-Assistant/trait.py
Line 388 in 21209b7
Domoticz-Google-Assistant/trait.py
Line 399 in 21209b7
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
Domoticz-Google-Assistant/trait.py
Line 385 in 21209b7
andDomoticz-Google-Assistant/trait.py
Line 396 in 21209b7
to 'On'Changing
Domoticz-Google-Assistant/trait.py
Line 388 in 21209b7
andDomoticz-Google-Assistant/trait.py
Line 399 in 21209b7
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 :
Domoticz-Google-Assistant/trait.py
Line 349 in 21209b7
to '100' ;
Domoticz-Google-Assistant/trait.py
Line 351 in 21209b7
to '0' ;
Domoticz-Google-Assistant/trait.py
Line 354 in 21209b7
to '0' ;
Domoticz-Google-Assistant/trait.py
Line 356 in 21209b7
to '100' ;
Fixed in latest beta, works only with Domoticz version above 2022.2