When you switch to hassbian, how much of configuration did you managed to preserve?
if you have z-wave device, do you have to remove all nodes in z-wave network first?
I think hass.io is, along with home assistant cloud, how home assistant making their money in the future. Nothing wrong with that per se, just that the reason why i am using home assistant is precisely because its flexibility and control over convenience. Hass.io represents the worse of both world: i no longer have all the control over the underlying platform, while the GUI and other configuration is still very painful to get it right.
All I did was copy all my config files, build a new Hassbian system and restore all the config files. I didn’t have much going on to begin with, just a few lights, switches and an alarm component, so everything came right up. Your mileage may very.
Same here, just copied over my .config file. I had a few yaml errors, just stuff that changed with newer versions of HA. Getting it up and going was a breeze especially with the addons.
For hassio, you might be able to just copy the folder for python-tuya into the same directory as your custom component for tuya-homeassistant, i.e.
- custom_components
| - switch
| - | - tuya.py
| - | - pytuya
| - | - | - __init__.py
That might be enough for the tuya component to find the pytuya library.
I was able to import a local test module I made from a custom component that way.
Edit: Worked to import pytuya as well. I was actually able to create a switch with the tuya custom component. Of course, I get an error when I try to turn it on/off because I don’t actually have a device to control, but at least it doesn’t fail trying to use the module.
Yeah, just a formatting error. The code is indented with spaces and your editor likely inserted a tab. Just replace any tabs it added with spaces and it should be good.
I thing i got it installed?! but Im getting an error:
Is this the error you got without a switch connected?
Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 201, in async_update_ha_state yield from self.async_device_update() File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 308, in async_device_update yield from self.hass.async_add_job(self.update) File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__ yield self # This tells Task to wait for completion. File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup future.result() File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result raise self._exception File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/switch/tuya.py", line 79, in update self._state = status['dps'][self._switchid] KeyError: 1
Nope that’s different. Looks like it’s not getting the data it expects. I did notice that the custom component was updated to use a newer version of the pytuya library. So maybe try pulling down the 5.0 release of pytuya, get the updated custom component, make that tweak for the import and try again?
I added a tuya/smart life plug using the resource you mentioned and didn’t need to install the python-tuya module. Only problem I’m having is that hass.io doesn’t seem to be able to retrieve (or the plug isn’t reporting) the current on/off state so the toggle in hass doesn’t work. See my recent post. I’d be happy to help you out with the process I used if you haven’t got it going yet.
Can’t help with the errors, but I will mention that I connected the device with and app called efamilyhome and pulled the device and local keys using tuya key grabber.
I haven’t gotten mine working yet but I did eliminate the KeyError. I needed to keep the “id: 1” line in the config. After that I was able to start up HassIO with no error, however, I still can’t get it to control my device. When I try to turn it on I get the following error…
2018-02-04 14:45:08 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall switch.turn_on: entity_id=[‘switch.plug_213’]>
This is followed by a bunch of other stuff that I didn’t include here.