Checked my logs and it gives the exact same error I previously posted.
Ahhhh okay, Iāll keep looking. What I changed was a typo so glad I found that, but there must be something else still.
@rpitera might want to delete that last post it has your subscription key in it.
@TeNpoLe21 @rpitera Okay so it looks like I was calling the base WinkDevice init method two different ways in different components. I am assuming that was somehow causing an issue? That is what I am hoping at least.
I updated the file at the above link again using the same init call everywhere so I am hoping that will correct the issue. If not this may have to wait for the big python-wink 1.0.0 update to get fixed.
I am looking into multiple ebay listing for a relay at the moment so I may end up getting one and messing with this some more if this doesnāt work.
Sorry, doesnāt appear to have fixed it. Still getting the error. Just to be clear you updated the wink.py file that goes in custom_components/binary_sensor folder, correct?
Well crap, thanks for testing. The work on python-wink 1.0.0 is almost done and it should fix this so it looks like we will need to wait on that.
What is the correct path for a non dev branch?
I was originally putting this in /home/hass/custom_components/
Doing that, I get this error:
17-01-19 15:01:30 homeassistant.loader: Circular dependency detected: wink -> wink
You need to add another sub directory binary_sensor/wink.py
I just did that and am restarting. So I havenāt been testing this correctly to begin with then? I am so sorry.
Still there for me too.
OK, I have things working, though a bit ugly. Credit to @happydutch from this post: https://community.home-assistant.io/t/wink-pubnub-v4-seems-to-have-broken-something/8883/3?u=tenpole21
I had to update the wink.py file found in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/ for this temporary fix to work. Modifying the wink.py file in custom_components did not do anything. Why is that?
Not sure why that is happening could be why the other fixes I suggested arenāt working too?
What @happydutch suggested is a temporary work around for sure. The reason None is passed into the pubnub update is because the response from pubnub was bad. This forces an API poll to get the correct state.
I think I am going to pick up a relay in the next couple days and see what I can figure out.
@happydutch just so you know, if you have the lutron connected bulb remote support should be coming soon to allow you to use it in HA. It will also correct the error you are seeing.
I just wanted to add that it seems like itās the physical Relay itself and in my case, only the one button that is actually connected to a load.
In addition I can turn on/off that load button from the Wink App OR from HA without generating an error. But if I use the physical button, it immediately generates the error.
Iāll hold off on using the fix that @TeNpoLe21 mentioned unless you suggest otherwise.
Thatās great news @w1ll1am23. I am happy to hear that I was able to locate the bug. I havenāt been developing in HA yet, so donāt quite know how to debug this kind of situation. Next thing on my to-do list
The Lutron remote support is very welcome. The Wink built in support is a bit rigid. Love to be able to fully customize it. The Lutron switches are wonderful. Small, reliable an cheap (and look good).
Oh and thanks for building the Wink support!
This makes sense. When you push the physical button both the button and the switch in the api are trigger. Wink then determines which one to do something with. When you trigger in the app, only the active one is triggered.
Can you provide me with your exact configuration on the relay? I want to set one up the same as you. Meaning which button do you have connected to what.
Top button is connected to single gang light switch in hallway.
Bottom button is connected to a Wink shortcut for āSleep Modeā (Turn off all lights, lock door, turn on Hue lightstrip in bedroom).
Hello w1ll1am23.
I believe I have applied your latest fixes, but my Wink devices are still not updating. I presume I have done something wrong. Would you please post the procedure for getting your latest code installed properly.
Thanks again for all your contributions.
@rpitera @kevince52 @jaalperin @happydutch @TeNpoLe21 @scadaguru
python-wink 1.0.0 has been published! I am still working on the Home-Assistant code, but it is in a state that is testable. (Mostly missing new features)
Here are the steps to test. They are going to be a little complicated but I will do my best to explain. These instructions will only working in Linuxā¦ as far as I know.
**NOTE The below steps will NOT effect your current installation because everything is going on inside of a virtualenv
- Open a terminal windows and navigate to your home directory
cd ~/
- Create a new virtualenv to test in.
virtualenv -p python3 hasstest
- Move into the new directory
cd hasstest
- Activate the virtaulenv
source bin/activate
- Notice that your prompt changes to (hasstest) this indicates your are in the virtualenv
- Clone my repo
git clone https://github.com/w1ll1am23/home-assistant.git
- Move into the home-assistant directory
cd home-assistant
- Checkout the branch to test
git checkout wink_update
- Install that branch to the virtaulenv
python3 setup.py install
- Move back up a directory
cd ..
- Make a new config directory
mkdir config
- Move into the config directory
cd config
- Copy your current config into this new config directory
cp ~/.homeassistant/config/*.yaml .
- Note: Your config may be somewhere else
- Stop your currently running home-assistant instance.
sudo systemctl stop WHATEVER.service
- Note: your service could be called anything probably something like homeassistant.service
- from inside the new config directory start hass.
hass -c .
- This is going to run in the foreground it is really complicated to explain how to make this run as a service
You should now be running the new python-wink and the new home-assistant code. Below are the changes you should be made aware of.
- Door/windows sensors names have changed to include what is called their capability so what was once
binary_sensor.front_door
will now be calledbinary_sensor.front_door_opened
- Wink Relays will now report three more sensors.
- the gangās connection status, will most likely be called gang and probably doesnāt have much of a purpose.
- The top button as a binary sensor indicating if the button was pressed.
- The bottom button as a binary sensor indicating if the button was pressed.
- Only switches that are connect to a load will show up
- You no longer need to set your user-agent in the home-assistant config to get access to the Wink Relay sensors.
- Lutron connected bulb remotes will show up as a binary_sensor. The status of that sensor will be true if any button on the remote is pressed. The sensor has attributes for each button so new sensors can be made with a template sensor or automations can be made with template triggers. (Pico remotes arenāt supported)
- Quirky powerstrips now report three devices
- Outlet 1
- Outlet 2
- The main power strip. Toggling the powerstrip device will turn on/off both outlets at once.
- Canary cameras are support as an alarm control panel. With the following state translations.
- Disarm = Home
- Armed = Away
- Armed Home = Night
- There is currently no support for setting privacy mode in Home-Assistant (Havenāt figured it out yet)
- Nest smoke protectors now report two more sensors
- Smoke severity (I think in a percentage)
- CO severity also in a percentage I think.
- Sprinklers are now support should show up as a binary switch
- Door bells are supported as binary sensors
- Motion
- Button pressed
- There is a new method of authentication. If you donāt have a client_id and client_secret you can add just your email and password to the config and your access token will be pulled from the home-assistant.io site automatically during startup.
As you can see there is a ton going on here so the more testing that can be done the better. I have tested most of these changes, and I just installed my Relay and havenāt been able to recreate any of the NoneType errors running this code.
In the middle of another project but once I get done Iāll give this a shot. Going to look over the instructions again after lunch.
This looks like a monumental update to Wink support and Iām looking forward to testing it! Thanks for all your hard work on this project!!!