-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arlo Alarm Control Panel Repeatedly Loses Status #15177
Comments
Same here. A while ago, I set up an automation that would restart HA whenever the control panel went dark. Looking at current statistics, it takes about 20 to 30 minutes until the control panel turns its state to unknown. |
Same here...I am seeing the same. |
I'm still on 0.68.1, and I may be having the same issue. The only mentions of Arlo in the release notes is on 0.72.0. |
This is an issue on 0.73 as well... |
also seeing it |
Another casualty of the ongoing Arlo dramas... |
Same here, satus jumps to unknown every now and then |
Tagging @tchellomello as he has done amazing work getting Arlo to work better. |
Hello folks, this issue is happening because it seems the Arlo has changed the endpoint to get the base station status. We currently have an issue opened at tchellomello/python-arlo#92 |
I've implemented a temporary solution by using a python script which arms/disarms the arlo cameras... So I've created the following script, which I called set_arlo_mode.py #! /usr/bin/python
from pyarlo import PyArlo
import sys
import argparse
args_parser = argparse.ArgumentParser(description='Arlo mode setter')
args_parser.add_argument('--mode', dest='mode', type=str, default='')
args_parser.add_argument('--debug', action='store_true')
args = args_parser.parse_args()
if args.mode == '':
print('Error: --mode is missing')
args_parser.print_help()
exit()
arlo = PyArlo('<username>', '<password>')
if not arlo.is_connected:
print('Error: Not connected to Arlo')
exit()
base = arlo.base_stations[0]
if args.debug:
print('Device: %s' % (arlo.devices))
print('Base: %s' % (arlo.base_stations))
print('Available Modes: %s' % (base.available_modes))
if args.mode not in base.available_modes:
exit('Error: unknown mode "%s".\nRecognized modes: %s' % (args.mode, base.available_modes))
base.mode=args.mode
if args.debug:
print('Mode set to %s' % (args.mode)) (don't forget to make it executable using Then, in the homeassistant configuration, I've added the following (adjust your path...) shell_command:
arm_arlo: '/home/homeassistant/.homeassistant/homeassistant-configs/set_arlo_mode.py --mode=armed'
disarm_arlo: '/home/homeassistant/.homeassistant/homeassistant-configs/set_arlo_mode.py --mode=disarmed' If you have different mode names, use the --debug flag when running After adding the above config, you will have 2 new service calls added in homeassistant called In my case, these are the scripts I call from the automation arming/disarming the "alarm": alarm_on:
alias: Arm Alarm
sequence:
- alias: Arm Arlo Alarm
data:
entity_id: alarm_control_panel.arlo1
service: alarm_control_panel.alarm_arm_away
- alias: Set Alarm state to Armed
data:
entity_id: input_boolean.alarm_armed
service: homeassistant.turn_on
- service: shell_command.arm_arlo
alarm_off:
alias: Disarm Alarm
sequence:
- alias: Disarm Arlo Alarm
data:
entity_id: alarm_control_panel.arlo1
service: alarm_control_panel.alarm_arm_home
- alias: Set Alarm state to Not Armed
data:
entity_id: input_boolean.alarm_armed
service: homeassistant.turn_off
- service: shell_command.disarm_arlo |
Thanks, I will definitely check this out. If I understand the script right you are still using the Arlo control panel? https://www.home-assistant.io/components/alarm_control_panel.arlo/ |
@Nicxe, yes, the script still uses the regular control panel. I did not remove that, but just added the external shell script |
Thanks @arievayner I will giv this a try. Hope it can be involved in the component. |
I can't get this to work @arievayner Maybe it has something to do with that I run hassio? I get the error |
Whilst a better fix is hopefully on the way, I've come up with a simple workaround. Make a new templates sensor reading the state of the Arlo Control Panel. If the state of Arlo Control Panel is
|
That doesn't really do much, unfortunately, because setting the state has the same problem. Arming and disarming the base fails all the time. The actual issue is the HTTPS request to Arlo API times out more often than not. Perhaps increasing the timeout would help? Is there a way to create a state machine that would keep retrying in case the update attempt throws a timeout exception? |
Still got the same issue as @orcinus , arming and disarming of often fails. I run the arm and disarm with IFTTT for now, but arming custom modes don't work thru IFTTT so still needs this to work. |
@tchellomello, I don't think the endpoint is the issue. I was able to easily get and set the mode via the following (note, I am using my Android app credentials instead of home assistant):
The time it takes to get or set the mode is 10+ seconds. Here is the same thing, but with my home assistant credentials (notice it is returning None for the mode):
The issue seems to be that HA is polling the cameras (or other components) before the mode can be received (or set). This goes back to netgear only allowing a single account to access the interface at a time. Due to the new async methods, it is just queuing it up and the next one is colliding with it at netgear's site and interrupting it. That is why it is sporadic - sometimes it hits between polls. I'm not familiar enough with asyncio to do a PR, but it seems if there was a way to not allow other components to attempt a connection if there is already one in use that would fix it. Thoughts? |
Does HA have some kind of a mutex mechanism built in? If not, that would be a good thing to have. Alternative temp fix would be to set cameras and alarm panel as separate platforms, and using separate accounts for each. |
In my config I don't load any cameras, only the Arlo component an the Arlo Control Panel but still got the same issue that the change of status is very unreliable |
Sorry, didn't see this... I guess you need to install the module in whatever virtualenv it is running in... |
Any update on this 'unreliable' Arlo control panel issue ? I experience that the Arlo control panel after x hours suddenly can't relay changes to Arlo API. Only a reboot of HA, restores the ability to change state again. Can someone please share examples of their IFTTT settings (Nicxe ?), as I need to migrate this vital core thing in my HA setup from Arlo control panel to IFTTT. Thank you in advance |
Is there an update on this issue, really missing ARLO integration :( |
If arm/disarm Arlo control panel is your top priority and you are ok that it is not reporting accurate status, below is a temporary workaround. The following code is a modified version of
and restart HA. It will override the existing It has been working for me, as a result it becomes more responsive in handling arm/disarm, and I can still see (approx.) status-change history; however, they are blind statuses because the modified component only requests for arm/disarm and always assumes it successful without actually verifying the status with Arlo. I've added a bunch of warning messages in the code below as a reminder of such trade-off. """
This is a modified version of Arlo Alarm Control Panels of HA v0.87.0
Please evaluate the trade-offs below and use it as is.
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.components.alarm_control_panel import (
AlarmControlPanel, PLATFORM_SCHEMA)
from homeassistant.components.arlo import (
DATA_ARLO, CONF_ATTRIBUTION, SIGNAL_UPDATE_ARLO)
from homeassistant.const import (
ATTR_ATTRIBUTION, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_NIGHT)
_LOGGER = logging.getLogger(__name__)
ARMED = 'armed'
CONF_HOME_MODE_NAME = 'home_mode_name'
CONF_AWAY_MODE_NAME = 'away_mode_name'
CONF_NIGHT_MODE_NAME = 'night_mode_name'
DEPENDENCIES = ['arlo']
DISARMED = 'disarmed'
ICON = 'mdi:security'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_HOME_MODE_NAME, default=ARMED): cv.string,
vol.Optional(CONF_AWAY_MODE_NAME, default=ARMED): cv.string,
vol.Optional(CONF_NIGHT_MODE_NAME, default=ARMED): cv.string,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Arlo Alarm Control Panels."""
arlo = hass.data[DATA_ARLO]
if not arlo.base_stations:
return
home_mode_name = config.get(CONF_HOME_MODE_NAME)
away_mode_name = config.get(CONF_AWAY_MODE_NAME)
night_mode_name = config.get(CONF_NIGHT_MODE_NAME)
base_stations = []
for base_station in arlo.base_stations:
base_stations.append(ArloBaseStation(base_station, home_mode_name,
away_mode_name, night_mode_name))
add_entities(base_stations, True)
class ArloBaseStation(AlarmControlPanel):
"""Representation of an Arlo Alarm Control Panel."""
def __init__(self, data, home_mode_name, away_mode_name, night_mode_name):
"""Initialize the alarm control panel."""
self._base_station = data
self._home_mode_name = home_mode_name
self._away_mode_name = away_mode_name
self._night_mode_name = night_mode_name
self._state = None
@property
def icon(self):
"""Return icon."""
return ICON
async def async_added_to_hass(self):
"""Register callbacks."""
async_dispatcher_connect(
self.hass, SIGNAL_UPDATE_ARLO, self._update_callback)
@callback
def _update_callback(self):
"""Call update method."""
_LOGGER.warning("Skip _update_callback()... This is a hack to prevent Arlo basestation from being unresponsive.")
# self.async_schedule_update_ha_state(True)
@property
def state(self):
"""Return the state of the device."""
return self._state
def update(self):
"""Update the state of the device."""
_LOGGER.debug("Updating Arlo Alarm Control Panel %s", self.name)
_LOGGER.warning("Skip update()... This is a hack to prevent Arlo base station from being unresponsive.")
# mode = self._base_station.mode
# if mode:
# self._state = self._get_state_from_mode(mode)
# else:
# self._state = None
async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
self._base_station.mode = DISARMED
_LOGGER.warning(f"Blindly setting Arlo control panel state to {STATE_ALARM_DISARMED}... This is a hack to prevent Arlo base station from being unresponsive.")
self._state = STATE_ALARM_DISARMED
async def async_alarm_arm_away(self, code=None):
"""Send arm away command. Uses custom mode."""
self._base_station.mode = self._away_mode_name
_LOGGER.warning(f"Blindly setting Arlo control panel state to {STATE_ALARM_ARMED_AWAY}... This is a hack to prevent Arlo base station from being unresponsive.")
self._state = STATE_ALARM_ARMED_AWAY
async def async_alarm_arm_home(self, code=None):
"""Send arm home command. Uses custom mode."""
self._base_station.mode = self._home_mode_name
_LOGGER.warning(f"Blindly setting Arlo control panel state to {STATE_ALARM_ARMED_HOME}... This is a hack to prevent Arlo base station from being unresponsive.")
self._state = STATE_ALARM_ARMED_HOME
async def async_alarm_arm_night(self, code=None):
"""Send arm night command. Uses custom mode."""
self._base_station.mode = self._night_mode_name
_LOGGER.warning(f"Blindly setting Arlo control panel state to {STATE_ALARM_ARMED_NIGHT}... This is a hack to prevent Arlo base station from being unresponsive.")
self._state = STATE_ALARM_ARMED_NIGHT
@property
def name(self):
"""Return the name of the base station."""
return self._base_station.name
@property
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
'device_id': self._base_station.device_id
}
def _get_state_from_mode(self, mode):
"""Convert Arlo mode to Home Assistant state."""
if mode == ARMED:
return STATE_ALARM_ARMED_AWAY
if mode == DISARMED:
return STATE_ALARM_DISARMED
if mode == self._home_mode_name:
return STATE_ALARM_ARMED_HOME
if mode == self._away_mode_name:
return STATE_ALARM_ARMED_AWAY
if mode == self._night_mode_name:
return STATE_ALARM_ARMED_NIGHT
return mode |
Can we just not use the API here? The API on Arlo's end has been updated and it seems this API is not keeping up. The above referenced API works great. I keep seeing this same issue closed instead of dealing with it. . disappointing given how much everyone seems to want it. |
If you have the know how many you can help get it to work @zemerick1 ? |
I will look into it. I'm just recommending that the Arlo component be swapped out with the API I linked to. It's better maintained. The hack above freaked out on me too. . froze HA solid. LoveLace also seems to spazz out when using the Alarm card. . . |
Looking forward to your rebuild of the component zemerick1 It will be great to have a working component again. |
@zemerick1 were you running other components like arlo camera or arlo sensor? My hack probably won’t work in that case because they could have their own query cycles and might still keep the base station occupied. This is just my hypothesis though since I didn’t look at their codes |
Follow https://community.home-assistant.io/t/arlo-replacement-pyarlo-module/93511 for an update on Arlo integration. We will soon move to that library. |
Well shit. .just wasted a couple hours of my time. lol. Thanks for the update @arsaboo |
@Detoo Yeah, after looking at the code it looked like everything was being updated every 60 seconds. Either way, it looks like the project arsaboo referenced is the way to go. I had it 50% rewritten and he dropped that bomb on me. . haha |
Is the issue fixed then? @zemerick1 |
Hello! Any reactions here?!! Issue started one year ago? |
Swap to Aarlo component, much better! |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Home Assistant release with the issue:
0.72.1
Last working Home Assistant release (if known):
0.71
Operating environment (Hass.io/Docker/Windows/etc.):
Hassbian on Raspberry Pi 3B+
Component/platform:
Arlo alarm control panel
Description of problem:
I have an automation to post to a Slack channel when my Arlo's Alarm Control Panel state changes, and it's repeatedly changing between unknown and other states. This causes automation coordination of alarm systems to fail, which I've had to disable.
Sample Slack logs:
The text was updated successfully, but these errors were encountered: