Git Product home page Git Product logo

Comments (15)

DewGew avatar DewGew commented on June 10, 2024

Dzga fetches domoticz settings. Did you set fahrenheit in domoticz?

from domoticz-google-assistant.

j0nson avatar j0nson commented on June 10, 2024

Yes, my domoticz is set to Fahrenheit, and dzga settings reports the device status correctly:
Screenshot_20191229-201810

from domoticz-google-assistant.

DewGew avatar DewGew commented on June 10, 2024

I try to reproduce this..

from domoticz-google-assistant.

DewGew avatar DewGew commented on June 10, 2024

Try latest beta. Google uses celsius only for state query. I had to add a convert tool.

from domoticz-google-assistant.

j0nson avatar j0nson commented on June 10, 2024

I had some issues running the beta branch. I finally got it to run correctly, and got this error: "name 'units' is not defined", and google home reports the thermostat as offline.
Here's the full log, with my server url redacted:

127.0.0.1 - - [01/Jan/2020 18:12:29] "GET /settings?code=f9299e202ce3462cbc9161a411a56c5f&state=undefined HTTP/1.1" 200 -
Request: {
"inputs": [
{
"intent": "action.devices.QUERY",
"payload": {
"devices": [
{
"id": "Temp119"
}
]
}
}
],
"requestId": "8968117430731453033"
}
Starting new HTTP connection (1): [URL]
http://[URL]:[PORT] "GET /json.htm?type=devices&plan=0&filter=all&used=true HTTP/1.1" 200 4349
Starting new HTTP connection (1): [URL]
http://[URL]:[PORT] "GET /json.htm?type=settings HTTP/1.1" 200 1419
Starting new HTTP connection (1): [URL]
http://[URL]:[PORT] "GET /json.htm?type=devices&rid=119 HTTP/1.1" 200 601
Starting new HTTP connection (1): [URL]
http://[URL]:[PORT] "GET /json.htm?type=settings HTTP/1.1" 200 1419
name 'units' is not defined
Error handling message {'inputs': [{'intent': 'action.devices.QUERY', 'payload': {'devices': [{'id': 'Temp119'}]}}], 'requestId': '8968117430731453033'}: {'errorCode': 'unknownError'}
127.0.0.1 - - [01/Jan/2020 18:12:47] "POST /smarthome HTTP/1.1" 200 -
Response: {
"requestId": "8968117430731453033",
"payload": {
"errorCode": "unknownError"
}
}

Also, the error that was stopping me from running the beta fully is this, even through I have "Check for Updates = false in the config file. This error shows up, and I get an error in the gui stating that the connection to domoticz was refused, even though it works fine. I fixed the error by putting a return 0 at the beginning of "def checkupdate():" in smarthome.py

127.0.0.1 - - [01/Jan/2020 18:02:54] "GET /settings?code=67f92aa2a2274e82899742814e2f5ecf&state=undefined HTTP/1.1" 307 -
127.0.0.1 - - [01/Jan/2020 18:02:54] "GET /login?redirect_uri=/settings HTTP/1.1" 200 -
127.0.0.1 - - [01/Jan/2020 18:02:55] "POST /login HTTP/1.1" 301 -
Connection to Github refused! Check configuration.
Connection to Github refused! Check configuration.
127.0.0.1 - - [01/Jan/2020 18:02:55] "GET /settings?code=aa4471294d0f4fd087bd001ae0d54034&state=undefined HTTP/1.1" 200 -

from domoticz-google-assistant.

DewGew avatar DewGew commented on June 10, 2024

I did some more changes try v1.4.6 sync your devices first before query termostat

from domoticz-google-assistant.

DewGew avatar DewGew commented on June 10, 2024

if you update manually use:
git reset --hard
then
git pull

from domoticz-google-assistant.

j0nson avatar j0nson commented on June 10, 2024

Im still having problems running the beta branch, I got the error connecting to Domoticz, and no devices show up in the gui. I suspect it's a get / post issue, unrelated to the temperature issue. I'm using the same settings as the stable branch, so there should be no issue with connections. The log doesn't show anything interesting, even with it set to debug.

I'll test more later, maybe by pulling in the temperature conversion changes into the stable branch.

from domoticz-google-assistant.

j0nson avatar j0nson commented on June 10, 2024

Since I cannot get the beta branch to run correctly, I tested with master, but with the traits.py from the beta branch, and in helpers.py, I added the tempConvert function from the beta. I believe these were the only relevant changes. Everything runs correctly, but Google Home still shows incorrect temps.

I got it to work by changing this function to always return "F", and added in some debugging output:

def _google_temp_unit(units):
"""Return Google temperature unit."""
print("Google Temp Unit")
print(units)
if units == True:
return "F"
print("Google Temp Unit F")
#return "C"
return "F"

The output when checking a temperature device is:

http://[URL]:[PORT] "GET /json.htm?type=settings HTTP/1.1" 200 1419
Google Temp Unit
None
Google Temp Unit
None
127.0.0.1 - - [02/Jan/2020 21:17:09] "POST /smarthome HTTP/1.1" 200 -
Response: {
"requestId": "17737534401830420235",
"payload": {
"devices": {
"Thermostat120": {
"online": true,
"thermostatMode": "heat",
"thermostatTemperatureAmbient": 15.6,
"thermostatTemperatureSetpoint": 15.6
}
}
}
}

If I check the device again, the debug output changes to:

Google Temp Unit
1
Google Temp Unit
1

Also, the same changes you made to "domain == tempDOMAIN" should be made in "domain == climateDOMAIN" (in traits.py), to get it to work with thermostats. Unrelated, it would be great to link two devices to give proper ambient temperatures along with a setpoint temp, but I suppose this is a limitation in domoticz.

from domoticz-google-assistant.

DewGew avatar DewGew commented on June 10, 2024

Can you print the device json from domticz here. I only have virtual dummy thermostat those dont have a Temp in json so its not needed to convert to celcius.

from domoticz-google-assistant.

j0nson avatar j0nson commented on June 10, 2024

Here's one:

{
"ActTime" : 1578014594,
"AstrTwilightEnd" : "18:31",
"AstrTwilightStart" : "05:51",
"CivTwilightEnd" : "17:24",
"CivTwilightStart" : "06:57",
"DayLength" : "09:28",
"NautTwilightEnd" : "17:58",
"NautTwilightStart" : "06:23",
"ServerTime" : "2020-01-02 20:23:14",
"SunAtSouth" : "12:11",
"Sunrise" : "07:27",
"Sunset" : "16:54",
"app_version" : "4.10717",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 0,
"Data" : "68.0 F",
"Description" : "",
"Favorite" : 1,
"HardwareID" : 22,
"HardwareName" : "Dummy Sensors",
"HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
"HardwareTypeVal" : 15,
"HaveTimeout" : false,
"ID" : "140C7",
"LastUpdate" : "2020-01-02 20:00:16",
"Name" : "Kitchen Floor Temperature",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "LaCrosse TX3",
"Temp" : 68.0,
"Timers" : "false",
"Type" : "Temp",
"TypeImg" : "temperature",
"Unit" : 1,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "119",
"trend" : 0
}
],
"status" : "OK",
"title" : "Devices"
}

from domoticz-google-assistant.

DewGew avatar DewGew commented on June 10, 2024

I cant reproduce your issues. sorry. Send me your config.yaml and log file by email , you can change your personal credetials to something random.

from domoticz-google-assistant.

DewGew avatar DewGew commented on June 10, 2024

Thermostat should work as suppost? I added some more logging in latest beta.
Back up your config.yaml and then delete Domoticz-Google-Assistant folder the run install script
bash <(curl -s https://raw.githubusercontent.com/DewGew/dzga-installer/master/install.sh)
choose development branch
After install is finished you should be able to reach dzga ui.

from domoticz-google-assistant.

j0nson avatar j0nson commented on June 10, 2024

The latest beta runs without error for me, and the temperatures are reading correctly for temperature sensors.
My domoticz thermostat setpoint device was not reading correct, until I made this change in the code in trait.py:

if domain == climateDOMAIN:
response['thermostatMode'] = 'heat'
current_temp = float(self.state.state)
if current_temp is not None:
response['thermostatTemperatureAmbient'] = round(tempConvert(current_temp, _google_temp_unit(units)), 1)
setpoint = float(self.state.setpoint)
if setpoint is not None:
response['thermostatTemperatureSetpoint'] = round(tempConvert(setpoint , _google_temp_unit(units)), 1)

from domoticz-google-assistant.

DewGew avatar DewGew commented on June 10, 2024

Added in latest beta

from domoticz-google-assistant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.