I can't change the thermostat mode
zoilomora opened this issue · 2 comments
Describe the bug:
When I try to change the thermostat mode, an eventual inconsistency is generated.
Expected behavior:
When I change the thermostat mode, the request is received from Google to perform the action. DZGA sends the request to Domoticz and it persists the changes. When Google asks DZGA for device status, DZGA responds with the status before the changes. Whenever Google requests the device status from DZGA, it will continue to send the first status obtained from Domoticz. After restarting DZGA again, the correct status of Domoticz is obtained, but the inconsistency is generated in the next change.
Logs:
Host: dzga.example.com
User-Agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
Content-Length: 127
Accept-Encoding: gzip, deflate, br
Authorization: Bearer ****
Content-Type: application/json;charset=UTF-8
Google-Assistant-Api-Version: v1
{
"inputs": [
{
"intent": "action.devices.QUERY",
"payload": {
"devices": [
{
"id": "Thermostat17"
}
]
}
}
],
"requestId": "11932038082225026343"
}
Google Assistant requests an action.devices.QUERY
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getdevices&rid=17 HTTP/1.1" 200 648
<voicecontrol> tags found for idx 17 in domoticz description.
Device_Config for idx 17 will be ignored in config.yaml!
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getplans&order=name&used=true HTTP/1.1" 200 426
{
"Casa": {
"idx": 17,
"type": "Thermostat",
"state": "20.8",
"lastupdate": "2023-11-08 23:18:56",
"modes_idx": "21",
"actual_temp_idx": "16",
"willReportState": true
}
}
{
"devices": {
"Thermostat17": {
"online": true,
"status": "SUCCESS",
"thermostatMode": "off",
"thermostatTemperatureAmbient": 20.8,
"thermostatTemperatureSetpoint": 14.2
}
}
}
10.10.1.4 - - [08/Nov/2023 23:33:24] "POST /smarthome HTTP/1.1" 200 -
Host: dzga.example.com
User-Agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
Content-Length: 305
Accept-Encoding: gzip, deflate, br
Authorization: Bearer ****
Content-Type: application/json;charset=UTF-8
Google-Assistant-Api-Version: v1
{
"inputs": [
{
"context": {
"locale_country": "US",
"locale_language": "en"
},
"intent": "action.devices.EXECUTE",
"payload": {
"commands": [
{
"devices": [
{
"id": "Thermostat17"
}
],
"execution": [
{
"command": "action.devices.commands.ThermostatSetMode",
"params": {
"thermostatMode": "eco"
}
}
]
}
]
}
}
],
"requestId": "11932038082225025167"
}
Google Assistant requests an action.devices.EXECUTE
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getdevices&rid=17 HTTP/1.1" 200 648
<voicecontrol> tags found for idx 17 in domoticz description.
Device_Config for idx 17 will be ignored in config.yaml!
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getplans&order=name&used=true HTTP/1.1" 200 426
{
"Casa": {
"idx": 17,
"type": "Thermostat",
"state": "20.8",
"lastupdate": "2023-11-08 23:18:56",
"modes_idx": "21",
"actual_temp_idx": "16",
"willReportState": true
}
}
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=switchlight&idx=21&switchcmd=Set%20Level&level=40 HTTP/1.1" 200 47
Starting new HTTPS connection (1): accounts.google.com:443
https://accounts.google.com:443 "POST /o/oauth2/token HTTP/1.1" 200 None
Starting new HTTPS connection (1): homegraph.googleapis.com:443
https://homegraph.googleapis.com:443 "POST /v1/devices:reportStateAndNotification HTTP/1.1" 200 None
Device state reported {
"agentUserId": "1234",
"payload": {
"devices": {
"states": {
"Thermostat17": {
"online": true,
"thermostatMode": "eco"
}
}
}
},
"requestId": "11932038082225025167"
}
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getdevices&rid=17 HTTP/1.1" 200 647
<voicecontrol> tags found for idx 17 in domoticz description.
Device_Config for idx 17 will be ignored in config.yaml!
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getplans&order=name&used=true HTTP/1.1" 200 426
{
"Casa": {
"idx": 17,
"type": "Thermostat",
"state": "20.8",
"lastupdate": "2023-11-08 23:18:56",
"modes_idx": "21",
"actual_temp_idx": "16",
"willReportState": true
}
}
10.10.1.4 - - [08/Nov/2023 23:33:25] "POST /smarthome HTTP/1.1" 200 -
Host: dzga.example.com
User-Agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
Content-Length: 125
Accept-Encoding: gzip, deflate, br
Authorization: Bearer ****
Content-Type: application/json;charset=UTF-8
Google-Assistant-Api-Version: v1
{
"inputs": [
{
"intent": "action.devices.QUERY",
"payload": {
"devices": [
{
"id": "Thermostat17"
}
]
}
}
],
"requestId": "665621081047029915"
}
Google Assistant requests an action.devices.QUERY
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getdevices&rid=17 HTTP/1.1" 200 646
<voicecontrol> tags found for idx 17 in domoticz description.
Device_Config for idx 17 will be ignored in config.yaml!
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getplans&order=name&used=true HTTP/1.1" 200 426
{
"Casa": {
"idx": 17,
"type": "Thermostat",
"state": "20.8",
"lastupdate": "2023-11-08 23:18:56",
"modes_idx": "21",
"actual_temp_idx": "16",
"willReportState": true
}
}
{
"devices": {
"Thermostat17": {
"online": true,
"status": "SUCCESS",
"thermostatMode": "off",
"thermostatTemperatureAmbient": 20.8,
"thermostatTemperatureSetpoint": 14.2
}
}
}
10.10.1.4 - - [08/Nov/2023 23:33:29] "POST /smarthome HTTP/1.1" 200 -
Host: dzga.example.com
User-Agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
Content-Length: 127
Accept-Encoding: gzip, deflate, br
Authorization: Bearer ****
Content-Type: application/json;charset=UTF-8
Google-Assistant-Api-Version: v1
{
"inputs": [
{
"intent": "action.devices.QUERY",
"payload": {
"devices": [
{
"id": "Thermostat17"
}
]
}
}
],
"requestId": "16471964566755492708"
}
Google Assistant requests an action.devices.QUERY
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getdevices&rid=17 HTTP/1.1" 200 647
<voicecontrol> tags found for idx 17 in domoticz description.
Device_Config for idx 17 will be ignored in config.yaml!
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getplans&order=name&used=true HTTP/1.1" 200 426
{
"Casa": {
"idx": 17,
"type": "Thermostat",
"state": "20.8",
"lastupdate": "2023-11-08 23:18:56",
"modes_idx": "21",
"actual_temp_idx": "16",
"willReportState": true
}
}
{
"devices": {
"Thermostat17": {
"online": true,
"status": "SUCCESS",
"thermostatMode": "off",
"thermostatTemperatureAmbient": 20.8,
"thermostatTemperatureSetpoint": 14.2
}
}
}
10.10.1.4 - - [08/Nov/2023 23:33:32] "POST /smarthome HTTP/1.1" 200 -
Host: dzga.example.com
User-Agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
Content-Length: 127
Accept-Encoding: gzip, deflate, br
Authorization: Bearer ****
Content-Type: application/json;charset=UTF-8
Google-Assistant-Api-Version: v1
{
"inputs": [
{
"intent": "action.devices.QUERY",
"payload": {
"devices": [
{
"id": "Thermostat17"
}
]
}
}
],
"requestId": "10240769264635608337"
}
Google Assistant requests an action.devices.QUERY
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getdevices&rid=17 HTTP/1.1" 200 647
<voicecontrol> tags found for idx 17 in domoticz description.
Device_Config for idx 17 will be ignored in config.yaml!
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getplans&order=name&used=true HTTP/1.1" 200 426
{
"Casa": {
"idx": 17,
"type": "Thermostat",
"state": "20.8",
"lastupdate": "2023-11-08 23:18:56",
"modes_idx": "21",
"actual_temp_idx": "16",
"willReportState": true
}
}
{
"devices": {
"Thermostat17": {
"online": true,
"status": "SUCCESS",
"thermostatMode": "off",
"thermostatTemperatureAmbient": 20.8,
"thermostatTemperatureSetpoint": 14.2
}
}
}
10.10.1.4 - - [08/Nov/2023 23:33:36] "POST /smarthome HTTP/1.1" 200 -
Desktop:
- Domoticz version: 2023.2 (build 15457)
- Dzga version: 1.23.11
- Python Version: 3.12.0
Smartphone:
- Device: iPhone 14 Pro
Additional context, screenshot:
https://www.youtube.com/shorts/QCtQ83rJex4
@DewGew I have tested the changes up to commit 0d48f0a and the result is still the same:
Host: dzga.example.com
User-Agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
Content-Length: 126
Accept-Encoding: gzip, deflate, br
Authorization: Bearer ****
Content-Type: application/json;charset=UTF-8
Google-Assistant-Api-Version: v1
{
"inputs": [
{
"intent": "action.devices.QUERY",
"payload": {
"devices": [
{
"id": "Thermostat17"
}
]
}
}
],
"requestId": "1105428422471362107"
}
Google Assistant requests an action.devices.QUERY
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getdevices&rid=17 HTTP/1.1" 200 643
<voicecontrol> tags found for idx 17 in domoticz description.
Device_Config for idx 17 will be ignored in config.yaml!
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getplans&order=name&used=true HTTP/1.1" 200 426
{
"Casa": {
"idx": 17,
"type": "Thermostat",
"state": "20.5",
"lastupdate": "2023-11-09 08:15:14",
"modes_idx": "21",
"actual_temp_idx": "16",
"willReportState": true
}
}
{
"devices": {
"Thermostat17": {
"online": true,
"status": "SUCCESS",
"thermostatMode": "heat",
"thermostatTemperatureAmbient": 20.5,
"thermostatTemperatureSetpoint": 0.2
}
}
}
10.10.1.4 - - [09/Nov/2023 08:18:50] "POST /smarthome HTTP/1.1" 200 -
Host: dzga.example.com
User-Agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
Content-Length: 304
Accept-Encoding: gzip, deflate, br
Authorization: Bearer ****
Content-Type: application/json;charset=UTF-8
Google-Assistant-Api-Version: v1
{
"inputs": [
{
"context": {
"locale_country": "US",
"locale_language": "en"
},
"intent": "action.devices.EXECUTE",
"payload": {
"commands": [
{
"devices": [
{
"id": "Thermostat17"
}
],
"execution": [
{
"command": "action.devices.commands.ThermostatSetMode",
"params": {
"thermostatMode": "off"
}
}
]
}
]
}
}
],
"requestId": "1105428422471360691"
}
Google Assistant requests an action.devices.EXECUTE
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getdevices&rid=17 HTTP/1.1" 200 643
<voicecontrol> tags found for idx 17 in domoticz description.
Device_Config for idx 17 will be ignored in config.yaml!
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getplans&order=name&used=true HTTP/1.1" 200 426
{
"Casa": {
"idx": 17,
"type": "Thermostat",
"state": "20.5",
"lastupdate": "2023-11-09 08:15:14",
"modes_idx": "21",
"actual_temp_idx": "16",
"willReportState": true
}
}
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=switchlight&idx=21&switchcmd=Set%20Level&level=0 HTTP/1.1" 200 47
Starting new HTTPS connection (1): accounts.google.com:443
https://accounts.google.com:443 "POST /o/oauth2/token HTTP/1.1" 200 None
Starting new HTTPS connection (1): homegraph.googleapis.com:443
https://homegraph.googleapis.com:443 "POST /v1/devices:reportStateAndNotification HTTP/1.1" 200 None
Device state reported {
"agentUserId": "1234",
"payload": {
"devices": {
"states": {
"Thermostat17": {
"online": true,
"thermostatMode": "off"
}
}
}
},
"requestId": "1105428422471360691"
}
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getdevices&rid=17 HTTP/1.1" 200 642
<voicecontrol> tags found for idx 17 in domoticz description.
Device_Config for idx 17 will be ignored in config.yaml!
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getplans&order=name&used=true HTTP/1.1" 200 426
{
"Casa": {
"idx": 17,
"type": "Thermostat",
"state": "20.5",
"lastupdate": "2023-11-09 08:15:14",
"modes_idx": "21",
"actual_temp_idx": "16",
"willReportState": true
}
}
10.10.1.4 - - [09/Nov/2023 08:18:51] "POST /smarthome HTTP/1.1" 200 -
Host: dzga.example.com
User-Agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
Content-Length: 127
Accept-Encoding: gzip, deflate, br
Authorization: Bearer ****
Content-Type: application/json;charset=UTF-8
Google-Assistant-Api-Version: v1
{
"inputs": [
{
"intent": "action.devices.QUERY",
"payload": {
"devices": [
{
"id": "Thermostat17"
}
]
}
}
],
"requestId": "15369854307583534532"
}
Google Assistant requests an action.devices.QUERY
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getdevices&rid=17 HTTP/1.1" 200 643
<voicecontrol> tags found for idx 17 in domoticz description.
Device_Config for idx 17 will be ignored in config.yaml!
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getplans&order=name&used=true HTTP/1.1" 200 426
{
"Casa": {
"idx": 17,
"type": "Thermostat",
"state": "20.5",
"lastupdate": "2023-11-09 08:15:14",
"modes_idx": "21",
"actual_temp_idx": "16",
"willReportState": true
}
}
{
"devices": {
"Thermostat17": {
"online": true,
"status": "SUCCESS",
"thermostatMode": "heat",
"thermostatTemperatureAmbient": 20.5,
"thermostatTemperatureSetpoint": 0.2
}
}
}
10.10.1.4 - - [09/Nov/2023 08:18:55] "POST /smarthome HTTP/1.1" 200 -
Host: dzga.example.com
User-Agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
Content-Length: 126
Accept-Encoding: gzip, deflate, br
Authorization: Bearer ****
Content-Type: application/json;charset=UTF-8
Google-Assistant-Api-Version: v1
{
"inputs": [
{
"intent": "action.devices.QUERY",
"payload": {
"devices": [
{
"id": "Thermostat17"
}
]
}
}
],
"requestId": "3770799891909292963"
}
Google Assistant requests an action.devices.QUERY
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getdevices&rid=17 HTTP/1.1" 200 642
<voicecontrol> tags found for idx 17 in domoticz description.
Device_Config for idx 17 will be ignored in config.yaml!
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getplans&order=name&used=true HTTP/1.1" 200 426
{
"Casa": {
"idx": 17,
"type": "Thermostat",
"state": "20.5",
"lastupdate": "2023-11-09 08:15:14",
"modes_idx": "21",
"actual_temp_idx": "16",
"willReportState": true
}
}
{
"devices": {
"Thermostat17": {
"online": true,
"status": "SUCCESS",
"thermostatMode": "heat",
"thermostatTemperatureAmbient": 20.5,
"thermostatTemperatureSetpoint": 0.2
}
}
}
10.10.1.4 - - [09/Nov/2023 08:18:58] "POST /smarthome HTTP/1.1" 200 -
Host: dzga.example.com
User-Agent: Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)
Content-Length: 127
Accept-Encoding: gzip, deflate, br
Authorization: Bearer ****
Content-Type: application/json;charset=UTF-8
Google-Assistant-Api-Version: v1
{
"inputs": [
{
"intent": "action.devices.QUERY",
"payload": {
"devices": [
{
"id": "Thermostat17"
}
]
}
}
],
"requestId": "17181436277622800921"
}
Google Assistant requests an action.devices.QUERY
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getdevices&rid=17 HTTP/1.1" 200 644
<voicecontrol> tags found for idx 17 in domoticz description.
Device_Config for idx 17 will be ignored in config.yaml!
Starting new HTTPS connection (1): domoticz.example.com:443
https://domoticz.example.com:443 "GET /json.htm?type=command¶m=getplans&order=name&used=true HTTP/1.1" 200 426
{
"Casa": {
"idx": 17,
"type": "Thermostat",
"state": "20.5",
"lastupdate": "2023-11-09 08:15:14",
"modes_idx": "21",
"actual_temp_idx": "16",
"willReportState": true
}
}
{
"devices": {
"Thermostat17": {
"online": true,
"status": "SUCCESS",
"thermostatMode": "heat",
"thermostatTemperatureAmbient": 20.5,
"thermostatTemperatureSetpoint": 0.2
}
}
}
10.10.1.4 - - [09/Nov/2023 08:19:02] "POST /smarthome HTTP/1.1" 200 -