Vera lights not reporting status correctly?

my setup isn’t that large, yet…i’ve only got about 10 z-wave devices and 10 automations…none of my automations are controlled by any of the switches. i haven’t migrated everything over from openhab yet…and this isn’t just a matter of it waiting a few seconds while doing other actions. this is 15-30 seconds or sometimes more before HA updates the display to reflect the current status of the light…one time in particular i waited over two minutes before giving up and flipping the light on and back off via HA to get the status to match.

ok, here you go. this is the switch that’s the biggest offender…this is with me even turning the switch on via the vera itself, so it obviously knows about the change.

<device name="Recessed Lights" altid="4" id="43" category="3" subcategory="0" room="7" parent="1" status="0" state="-1" comment=""/>
<device name="Recessed Lights" altid="4" id="43" category="3" subcategory="0" room="7" parent="1" status="1" state="4" comment="Recessed Lights: Transmit was ok"/>

it definitely did not update immediately in HA. it took about 30-45 seconds for the status to update in HA (it actually did so just a second or two after i snapped a screenshot). at the time of this screenshot, the lights were already on and vera had already updated…but HA had not.

also, interestingly enough, it seems it’s not just vera. my garage door sensor is reported via envisalink and my dsc alarm, and that sometimes now also is taking 30-45 seconds to report correctly after i open or close the door…not all the time, but enough that i noticed it while playing with my garage door automations.

Some HA devices poll - so often take 30s to update. The vera code uses a long poll on a dedicated thread - so normally devices should update in less than a second.

If you turn the logging level up to info (at least for vera) you should get more info about what vera is doing.

this is interesting. turned up the logging as you mentioned, and here’s what i found - with pretty much all of the lights, there are multiple poll return lines in the log immediately after i flip the switch or turn it on/off via the vera UI itself. i’m running a tail -f on the log and i can see the lines come up as soon as i press the button. usually, this poll return updates the HA UI to reflect the new position of the switch…but not always.

here are the lines for the worst offending switch that i showed above…

17-04-28 22:37:45 INFO (Vera Poll Thread) [pyvera.subscribe] Poll returned
17-04-28 22:37:46 INFO (Vera Poll Thread) [pyvera.subscribe] Poll returned
17-04-28 22:37:47 INFO (Vera Poll Thread) [pyvera.subscribe] Poll returned
17-04-28 22:38:03 INFO (Vera Poll Thread) [pyvera.subscribe] Poll returned
17-04-28 22:38:17 INFO (Vera Poll Thread) [pyvera.subscribe] Poll returned

the first line (22:37:45) is where i turned the light on via the vera UI. you can see that i got three poll returns there within two seconds. the HA UI, though, did not update until the last polling line (22:38:17), more than 30 seconds later…

Vera sends lots of notifications e.g.:-

  1. I’m about to send a command
  2. I sent a command
  3. I retried a command
  4. Command was successful

All these come with a device state - which often isn’t what we want (e.g. The about to send a command event contains the ‘pre command’ state of the device) - so pyvera filters these out.

What I’d guess is happening is that the switch state change event is being filtered out, and then at a later stage an energy update event is also updating the switch state.

The events sent seem slight different for different device types - and possibly different Vera firmware.

Which Vera device / firmware are you running?

To debug I’ll need the detailed event traces - so we can see what’s happening - and try and fix. Sadly I removed the traces from pyvera - so I’ll need to add them back in - release a new library version - and update HA to use the new library. Happy to this - and then you will be able to turn detailed logging on in a new version of HA

What I’ suggest is that you raise an issue here https://github.com/pavoni/pyvera and then we can debug and follow up there.

Btw is the switch that doesn’t work a different type than the others?

TI’ve added debugging to the pyvera library. It’s now merged into the development version of HA.

If you feel like trying the dev version of HA you can try it now - or wait for the next release next weekend.

One you have it, you need to add the following to your config.yaml

logger:
  logs:
      pyvera: debug
```

This will then trace the event data from vera. In my case this shows the following when I turn a switch on.

2017-04-29 16:48:34 DEBUG (Vera Poll Thread) [pyvera.subscribe] Poll returned
2017-04-29 16:48:34 DEBUG (Vera Poll Thread) [pyvera.subscribe] Event: Alcoves, state -1, {“altid”: “e2”, “id”: “17”, “subcategory”: “0”, “room”: “1”, “parent”: “15”, “commFailure”: “0”, “state”: “-1”, “comment”: “”, “status”: “1”}


state: -1 means NO_JOB - and status:1 means 'on'

If you can capture the traces we can see what's happening.
1 Like

they’re all the same switch, but the one that is having issues is a little older than the others. i’m hesitant to say it “doesn’t work” because it is working, just not as expected…and it is working every time, instantly, in vera itself.

switch that is having issues:
Version 6,3,40,3,25
Manufacturer GE/Jasco

switch that works most of the time:
Version 6,3,67,3,29
Manufacturer GE/Jasco

https://www.amazon.com/GE-Wireless-Lighting-Control-12722/dp/B0035YRCR2/ref=sr_1_2?ie=UTF8&qid=1493504758&sr=8-2&keywords=GE+z-wave+switch

i also have several appliance modules (both indoor and outdoor) that seem to work all the time, or at least most of the time. it’s just that one switch that seems to be consistently wonky.

i’d rather not mess around with the dev version of HA at this point, not til i get a little more experience working with it…but i have no problem waiting til next weekend. should i still create the issue on github now or wait til then?

I’ve raised it for you https://github.com/pavoni/pyvera/issues/51

Please update the issue when you have more data.

It’s easier for me to track issues in github than here (github sends me alerts)

Just to remind you that the trace code is now in the live version if you’re still having trouble.

i’ll try to spend some time this weekend playing around with it and get you a log. thanks!

1 Like

Im new to HA and I am trying to get Vera setup. I get an error saying that vera can’t be setup. I included the log, but I am not that savvy with scripts. I think it’s a problem with Vera API.

Please help

2017-09-12 01:58:45 ERROR (Thread-12) [homeassistant.components.vera] Error communicating with Vera API
Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connection.py”, line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File “/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/util/connection.py”, line 83, in create_connection
raise err
File “/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/util/connection.py”, line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py”, line 600, in urlopen
chunked=chunked)
File “/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py”, line 356, in _make_request
conn.request(method, url, **httplib_request_kw)
File “/usr/lib/python3.5/http/client.py”, line 1106, in request
self._send_request(method, url, body, headers)
File “/usr/lib/python3.5/http/client.py”, line 1151, in _send_request
self.endheaders(body)
File “/usr/lib/python3.5/http/client.py”, line 1102, in endheaders
self._send_output(message_body)
File “/usr/lib/python3.5/http/client.py”, line 934, in _send_output
self.send(msg)
File “/usr/lib/python3.5/http/client.py”, line 877, in send
self.connect()
File “/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connection.py”, line 166, in connect
conn = self._new_conn()
File “/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connection.py”, line 150, in _new_conn
self, “Failed to establish a new connection: %s” % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7fb35d8c5e10>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/requests/adapters.py”, line 438, in send
timeout=timeout
File “/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py”, line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File “/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/util/retry.py”, line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=‘192.168.1.3’, port=3480): Max retries exceeded with url: //data_request?id=sdata (Caused by NewConnectionError(’<requests.packages.urllib3.connection.HTTPConnection object at 0x7fb35d8c5e10>: Failed to establish a new connection: [Errno 111] Connection refused’,))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/homeassistant/components/vera.py”, line 80, in setup
all_devices = VERA_CONTROLLER.get_devices()
File “/home/yusef/.homeassistant/deps/lib/python3.5/site-packages/pyvera/init.py”, line 103, in get_devices
self.get_simple_devices_info()
File “/home/yusef/.homeassistant/deps/lib/python3.5/site-packages/pyvera/init.py”, line 76, in get_simple_devices_info
j = self.data_request({‘id’: ‘sdata’}).json()
File “/home/yusef/.homeassistant/deps/lib/python3.5/site-packages/pyvera/init.py”, line 72, in data_request
return requests.get(request_url, timeout=timeout, params=payload)
File “/usr/local/lib/python3.5/dist-packages/requests/api.py”, line 72, in get
return request(‘get’, url, params=params, **kwargs)
File “/usr/local/lib/python3.5/dist-packages/requests/api.py”, line 58, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.5/dist-packages/requests/sessions.py”, line 518, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.5/dist-packages/requests/sessions.py”, line 639, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.5/dist-packages/requests/adapters.py”, line 502, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=‘192.168.1.3’, port=3480): Max retries exceeded with url: //data_request?id=sdata (Caused by NewConnectionError(’<requests.packages.urllib3.connection.HTTPConnection object at 0x7fb35d8c5e10>: Failed to establish a new connection: [Errno 111] Connection refused’,))
2017-09-12 01:58:45 ERROR (MainThread) [homeassistant.setup] Setup failed for vera: Component failed to initialize.

You’re getting a connection refused trying to talk from the HA installation to vera.

if you put in the following in a browser does it return a json response?
http://192.168.1.3:3480/data_request?id=sdata

i know it’s been a few months, but i’m going to try to get you a log at some point this weekend if i get a chance. it has gotten worse, not better…i turned the lights in my living room off at the switch about 10 minutes ago and HA still reports that they’re turned on. they just now turned off, according to HA. i’m wondering if it has something to do with only updating once i load the web interface, because they seem to have updated pretty quickly after i opened that up…

I’m having similar challenges… vera 3, ui v5.
lights and in particular several motion detectors end up in locked status until has restart.

I’ve noticed a couple of motion detectors locked on once or twice, but never had the chance to dig into what’s causing it, whether it be the z-wave device, vera, pyvera, or HA itself (it’s always when I’m away from home that I spot this). I’ll try and debug it next time it happens a bit more!

at least weekly event for me… my suspicion is output format, and dodgy vera.
I gave up troubleshooting, and hope to move alarm sensors onto HA directly and hope that a simplified vera config will eliminate the problem for the zwave lights.

I have a garage door sensor that reports correctly in Vera but somehow gets out of sync in HA. Shows open in HA, closed in Vera. It’s a Zigbee sensor but since Vera shows it correctly, HA should as well. Any suggestions???

did you try first taking a look at the vera sdata response, finding your garage door and confirming in there that it shows the right status. It should, as this is what is used on the vera ui.

In my case, the Vera has the correct data. I’m chalking it up to the instability of the Vera itself. Working on moving everything to HA where at least I know development is moving forward. Vera has stagnated…