{"action":"created","issue":{"url":"https://api.github.com/repos/pavoni/pyvera/issues/102","repository_url":"https://api.github.com/repos/pavoni/pyvera","labels_url":"https://api.github.com/repos/pavoni/pyvera/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/pavoni/pyvera/issues/102/comments","events_url":"https://api.github.com/repos/pavoni/pyvera/issues/102/events","html_url":"https://github.com/pavoni/pyvera/issues/102","id":383966324,"node_id":"MDU6SXNzdWUzODM5NjYzMjQ=","number":102,"title":"Vera Thermostat not reporting correct heat setpoint state in DeviceInfo area","user":{"login":"htcheng","id":42881720,"node_id":"MDQ6VXNlcjQyODgxNzIw","avatar_url":"https://avatars1.githubusercontent.com/u/42881720?v=4","gravatar_id":"","url":"https://api.github.com/users/htcheng","html_url":"https://github.com/htcheng","followers_url":"https://api.github.com/users/htcheng/followers","following_url":"https://api.github.com/users/htcheng/following{/other_user}","gists_url":"https://api.github.com/users/htcheng/gists{/gist_id}","starred_url":"https://api.github.com/users/htcheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htcheng/subscriptions","organizations_url":"https://api.github.com/users/htcheng/orgs","repos_url":"https://api.github.com/users/htcheng/repos","events_url":"https://api.github.com/users/htcheng/events{/privacy}","received_events_url":"https://api.github.com/users/htcheng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-24T07:14:16Z","updated_at":"2018-11-24T09:45:13Z","closed_at":null,"author_association":"NONE","body":"I have two different model zwave thermostats (Trane and Honeywell) connected to Vera and pyvera is incorrectly reporting the \"heat\" setpoint for both of these devices when the thermostats run their internal schedulers. Vera is showing the correct information for both thermostats, but when pyvera parses the state information, it is not correctly parsing the returned values. I suspect this is because \"CurrentSetpoint\" is used as the variable name for 3 different state variables internally (see XML below).\r\n\r\n[veraxml.pdf](https://github.com/pavoni/pyvera/files/2612073/veraxml.pdf)\r\n\r\nMy python is pretty rudimentary but I've traced back the source of the problem to how the subscription registry updates the state information. Using pyvera's function \r\n\r\nget_complex_value(\"CurrentSetpoint\") directly from the controller returns the correct values for both thermostats' heat setpoint, but querying the state info from the subscription registry yields incorrect values:\r\n\r\n>>> devices\r\n[VeraThermostat (id=37 category=Thermostat name=Upstairs Temp), VeraArmableDevice (id=37 category=Thermostat name=Upstairs Temp), VeraThermostat (id=55 category=Thermostat name=Downstairs Temp)]\r\n>>> devices[0].get_complex_value(\"CurrentSetpoint\")\r\n'66.00'\r\n>>> devices[2].get_complex_value(\"CurrentSetpoint\")\r\n'69.00'\r\n>>> devices[0].get_all_values()\r\n{'name': 'Upstairs Temp', 'altid': '19', 'id': 37, 'category': 5, 'subcategory': 1, 'room': 0, 'parent': 1, 'fanmode': 'Auto', 'hvacstate': 'Idle', 'mode': 'HeatOn', **'setpoint': '78.00', 'heat': '78.00'**, 'cool': '78.00', 'status': '0', 'commFailure': '0', 'lasttrip': '1527243354', 'tripped': '0', 'armed': '0', 'armedtripped': '0', 'temperature': '70.00', 'state': -1, 'comment': '', 'categoryName': 'Thermostat'}\r\n>>> devices[2].get_all_values()\r\n{'name': 'Downstairs Temp', 'altid': '35', 'id': 55, 'category': 5, 'subcategory': 1, 'room': 0, 'parent': 1, 'fanmode': 'Auto', 'hvacstate': 'Idle', 'mode': 'HeatOn', 'temperature': '69.00', **'setpoint': '78.00', 'heat': '78.00'**, 'cool': '78.00', 'status': '0', 'light': '0.2', 'state': -1, 'comment': '', 'categoryName': 'Thermostat'}\r\n\r\nLooking at the information above, I believe that the subscription registry should be using the variable \"AllSetpoints\" from Vera and parse the first two numbers (heat, cool) to set the correct state information for Vera thermostats rather than using \"CurrentSetpoint\" which will set the 'setpoint' and 'heat' states to the 'cool' state since they all use the same variable name 'CurrentSetpoint' (how stupid is that?).\r\n\r\nI'd make this change, but I'm still brushing up my python... if I can figure out a solution, I'll update it here, but any help would be appreciated...\r\n"},"comment":{"url":"https://api.github.com/repos/pavoni/pyvera/issues/comments/441355650","html_url":"https://github.com/pavoni/pyvera/issues/102#issuecomment-441355650","issue_url":"https://api.github.com/repos/pavoni/pyvera/issues/102","id":441355650,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTM1NTY1MA==","user":{"login":"pavoni","id":4487313,"node_id":"MDQ6VXNlcjQ0ODczMTM=","avatar_url":"https://avatars2.githubusercontent.com/u/4487313?v=4","gravatar_id":"","url":"https://api.github.com/users/pavoni","html_url":"https://github.com/pavoni","followers_url":"https://api.github.com/users/pavoni/followers","following_url":"https://api.github.com/users/pavoni/following{/other_user}","gists_url":"https://api.github.com/users/pavoni/gists{/gist_id}","starred_url":"https://api.github.com/users/pavoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavoni/subscriptions","organizations_url":"https://api.github.com/users/pavoni/orgs","repos_url":"https://api.github.com/users/pavoni/repos","events_url":"https://api.github.com/users/pavoni/events{/privacy}","received_events_url":"https://api.github.com/users/pavoni/received_events","type":"User","site_admin":false},"created_at":"2018-11-24T09:45:13Z","updated_at":"2018-11-24T09:45:13Z","author_association":"OWNER","body":"Sorry to hear about the issue. I don't have a thermostat - so I need to be very careful about changes there. \r\n\r\nMostly the vera code tries to get state info via subscription, that means that it doesn't need to call vera every time a variable value is requested - and that HA states update in real time.\r\n\r\n`get_complex_value` bypasses this mechanism - so should only be used, with care, where there isn't an alternative. So the ideal would be to find a way to get the info you need via the state mechanism.\r\n\r\nThere were also some complexities about how heat only and heat cool thermostats work - which caused us problems previously.\r\n\r\n@alanfischer is the expert here - so may be able to help."}}
{"actor":{"display_login":"pavoni"}}