Off topic, but currently the Broadlink switch can not continuously listen for incoming signal. But I think that should be possible.
You can try to always have the the Broadlink device in learn mode, and as soon as you have receive a signal you set it back to learn mode.
that would be cool
Good to know
Something weird is happening… I had a motion sensor go “on” at 2pm, and a magnet sensor go “on” at 2:56pm, but there was no motion nor the door opened. Both are still locked in the “on” state. On the Mi Home app there are no records of that (the last activity logged in the app was way before that for both, which is correct).
I updated to 0.36 yesterday.
I was having the same issue today… Looks like this is happening since my 0.36 upadate…
0.36 is broken. There are a lot of issues and breaking changes in the api. I heard 0.36.1 fixes some of the issues
So we should wait for the 0.36.1 version and then start debugging for issues?
There’s a new xiaomi router script on 0.36.x with the same name as the gateway. I just renamed the gateway from xiaomi to xiaomigateway and it’s working fine.
0.36.1 is already out.
Very rarely the component fails to setup when restarting HA 0.36.1 on Raspbian, log below. Simply restarting again fixes the problem.
17-01-18 23:36:38 custom_components.xiaomi: Cannot connect to Gateway
17-01-18 23:36:38 homeassistant.bootstrap: Error during setup of component xiaomi
Traceback (most recent call last):
File "/srv/hass/lib/python3.4/site-packages/homeassistant/bootstrap.py", line 151, in _async_setup_component
None, component.setup, hass, config)
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/hass/.homeassistant/custom_components/xiaomi.py", line 53, in setup
comp.discoverGateways()
File "/home/hass/.homeassistant/custom_components/xiaomi.py", line 128, in discoverGateways
gateway = XiaomiGateway(resp["ip"], resp["port"], resp["sid"], gatewayKey, self._socket)
File "/home/hass/.homeassistant/custom_components/xiaomi.py", line 225, in __init__
self._discover_devices()
File "/home/hass/.homeassistant/custom_components/xiaomi.py", line 245, in _discover_devices
model = resp["model"]
Temperature automation seems unreliable, I have an automation that is meant to turn on a xiaomi smart switch at 24°C and turn it off when it goes below it but sometimes it just does not notice that temperature is above the upper limit and does not turn the switch on
What’s the config of the trigger that you are using?
alias: Temp Crobox High
trigger:
- platform: numeric_state
entity_id: sensor.temperature_158d00010b7886
above: 24
action:
service: homeassistant.turn_on
entity_id:
- switch.plug_158d00010ad6f1
alias: Temp Crobox Low
trigger:
- platform: numeric_state
entity_id: sensor.temperature_158d00010b7886
below: 24
action:
service: homeassistant.turn_off
entity_id:
- switch.plug_158d00010ad6f1
Hi Thank for integrating the xiaomi components in Home Assistant.
Although i am using HA for some time now and i am in continual learning of new things i have no idea on how to insert the component in the configuration folder.
From what i remember i installed HA on my pi direct not trough the image or all in one installer and i am not in virtual environment…
I cannot find anywhere the component folder I am using WinSCP and scanned for it and nothing was found.
My HA config is on /var/opt/homeassistant and only folder other than configuration yaml files is a folder called deps.
I installed pycrypto-2.6.1 and it says in putty that is installed in /root/.cache/pip/wheels/80/1f/94/f76e9746864f198eb0e304aeec319159fa41b082f61281ffce
I cannot find any error in HA and no new component was added in to my sensors.
Any help is much appreciated since i have no idea how to make it work.
Thanks for all the hard work to make this work.
Hi adifoto,
you just need to create a new folder called custom_components under your homeassistant directory (assuming /var/opt/homeassistant). After that you just need to copy the files from component folder from git to your new folder.
Hey guys, i’m having some random errors in the log file
Jan 19 11:25:39 raspi1 hass[9060]: ERROR:custom_components.xiaomi:Cannot connect to Gateway
Jan 19 11:25:39 raspi1 hass[9060]: ERROR:homeassistant.core:Error doing job: Task exception was never retrieved
Jan 19 11:25:39 raspi1 hass[9060]: Traceback (most recent call last):
Jan 19 11:25:39 raspi1 hass[9060]: File “/usr/lib/python3.4/asyncio/tasks.py”, line 233, in _step
Jan 19 11:25:39 raspi1 hass[9060]: result = coro.throw(exc)
Jan 19 11:25:39 raspi1 hass[9060]: File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py”, line 387, in _update_entity_states
Jan 19 11:25:39 raspi1 hass[9060]: yield from update_coro
Jan 19 11:25:39 raspi1 hass[9060]: File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py”, line 216, in async_update_ha_state
Jan 19 11:25:39 raspi1 hass[9060]: yield from self.hass.loop.run_in_executor(None, self.update)
Jan 19 11:25:39 raspi1 hass[9060]: File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
Jan 19 11:25:39 raspi1 hass[9060]: yield self # This tells Task to wait for completion.
Jan 19 11:25:39 raspi1 hass[9060]: File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
Jan 19 11:25:39 raspi1 hass[9060]: value = future.result()
Jan 19 11:25:39 raspi1 hass[9060]: File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
Jan 19 11:25:39 raspi1 hass[9060]: raise self._exception
Jan 19 11:25:39 raspi1 hass[9060]: File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
Jan 19 11:25:39 raspi1 hass[9060]: result = self.fn(*self.args, **self.kwargs)
Jan 19 11:25:39 raspi1 hass[9060]: File “/home/homeassistant/.homeassistant/custom_components/binary_sensor/xiaomi.py”, line 123, in update
Jan 19 11:25:39 raspi1 hass[9060]: data = self.xiaomi_hub.get_from_hub(self._sid)
Jan 19 11:25:39 raspi1 hass[9060]: File “/home/homeassistant/.homeassistant/custom_components/xiaomi.py”, line 310, in get_from_hub
Jan 19 11:25:39 raspi1 hass[9060]: return json.loads(resp[“data”])
Jan 19 11:25:39 raspi1 hass[9060]: TypeError: ‘NoneType’ object is not subscriptable
I’m on 0.36.1 and things are looking good for now (only a couple of hours of testing). Any idea what should be the cause of this bug?
Hi pikapt thanks for your response i deed copy it but in deps. that i found other components like (in the specific folders):
forecastio
fuzzywuzzy
fuzzywuzzy-0.14.0.dist-info
jsonrpc_async
jsonrpc_async-0.2.dist-info
jsonrpc_base
jsonrpc_base-0.1.dist-info
limitlessled
and others.
I assume that is the folder with the components
I will give it a try on mine directory to see if that may change something.
Just deed, created a new folder called custom_components that has inside:
binary_sensor
light
sensor
switch
xiaomi.py
once again there is no error and no component.
Thanks again
Updated to 0.36.1 everything works well
My first automation with the switches (jusdt arrived). I have errors, what am I doing wrong?
#
# Automation with xiaomi Switch master bedroom
- alias: Pause Media Player Livingroom when hold
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_1583f85ac
#event single, double or hold
click_type: hold
action:
service: media_player.pause_media
entity_id: media_player.livingroom_home