Skip to content
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

Disarmed/off state on Homebase vs. home assistant. #45

Closed
r2xud opened this issue Aug 14, 2021 · 27 comments
Closed

Disarmed/off state on Homebase vs. home assistant. #45

r2xud opened this issue Aug 14, 2021 · 27 comments
Assignees

Comments

@r2xud
Copy link

r2xud commented Aug 14, 2021

  • When using the home assistant alarmpanel, that is generated by the intergration, to disarm the alarm; the Eufy homebase switches to the "DISARMED" mode.
  • When using the Eufy keypad to disarm the alarm; the Eufy homebase switches to the "OFF" mode.

This way when using the keypad to disarm the alarm, home assistant does not replicate it's state and will still read as armed.

The home assistant alarmpanel should also switch the Eufy homebase to the "OFF" state instead of the "DISARMED" state to make sure the alarm state on the Eufy homebase, the Eufy keypad and in home assistant read the same.

@fuatakgun
Copy link
Owner

fuatakgun commented Aug 14, 2021

Can you share a screenshot from eufy app? I do not have Off state, i have only 5 predefined guard modes ( i don't have a keypad);

  • home
  • away
  • disarmed
  • geofencing
  • schedule

Screenshot_2021-08-14-17-05-10-121_com.oceanwing.battery.cam.jpg

@r2xud
Copy link
Author

r2xud commented Aug 14, 2021

It's probably the keypad that adds the "OFF" state and switches to it when using the keypad to disarm.

The screenshot is in Dutch.

Uitgeschakeld = Disarmed
Uit = Off

Screenshot_20210814-170838_EufySecurity

@fuatakgun
Copy link
Owner

fuatakgun commented Aug 14, 2021

Please click on settings icon on Off mode to show details. Is there any delete button at the end of page? If yes, this is just a custom mode you can create but you need to call it over integration services.

@fuatakgun
Copy link
Owner

Screenshot_2021-08-14-17-34-41-254_com.oceanwing.battery.cam.jpgScreenshot_2021-08-14-17-34-34-833_com.oceanwing.battery.cam.jpg

@r2xud
Copy link
Author

r2xud commented Aug 14, 2021

It's not a custom mode. Adding the keypad creates this mode.

Screenshot_20210814-175159_EufySecurity

@r2xud
Copy link
Author

r2xud commented Aug 14, 2021

From the user manual:

162895690285685104030074810797

@fuatakgun
Copy link
Owner

I see, i remember this was recently added to add on here, just 3 days ago; bropat/eufy-security-client#27

New release will be published and i need to test it for integration.

On the other hand, i don't think enabling off mode everyone would make sense, we need to find a common solution for all here. In alarm panel, there are only 3 states.

bropat/eufy-security-client#27

@r2xud
Copy link
Author

r2xud commented Aug 14, 2021

Did not see Issue #27. Sorry for that. Yes, finding a common solution for all would be best.

I'll wait for the new release. Thanks for the great work you do! :)

@r2xud r2xud closed this as completed Aug 14, 2021
@fuatakgun fuatakgun reopened this Aug 14, 2021
@fuatakgun
Copy link
Owner

fuatakgun commented Aug 14, 2021

Welcome, let's keep this open, I am still not clear what should be the solution for all Integration users. If you check here (https://www.home-assistant.io/integrations/manual), there are 4 states in home assistant alarm control panel;

  • disarmed - has direct mapping in eufy
  • armed away - has direct mapping in eufy
  • armed home - has direct mapping in eufy
  • triggered.

I have implemented first three of them in integration. The other states as schedule and geocode are actually not state but rules sets to change the state, so I am not worried about them.

But, I am not sure where and how we should place off in this mapping.

@fuatakgun
Copy link
Owner

One possible solution; whenever keypad is used to deactivate alarm, we can assume off is equal to disarmed, is this a correct assumption? So, if you use integration, it will switch to disarmed but if you use keypad, it will switch to off. Both cases will be visible to you as disarmed in the integration. What do you think?

@r2xud
Copy link
Author

r2xud commented Aug 14, 2021

I agree. That seems like a possible solution. The Off state can be seen as equal to the disarmed state in my opinion.

@domemshur
Copy link

When I do this intergration, nothing gets created or populates in home assistant for my eufy alarm station. My Motion sensors show up, but not my keypad.

Thanks

@fuatakgun
Copy link
Owner

@domemshur , what is alarm station? is it home base or something different? If this is a different device, please create a separate issue to support it.

On keypad, it is an interface to eufy, not an actual device to be represented in home assistant. At least, that is my perception, happy to discuss more on this. I will focus on mapping OFF state to DISARMED in home assistant.

@fuatakgun fuatakgun self-assigned this Sep 17, 2021
@fuatakgun
Copy link
Owner

@r2xud , please help me following these steps;

  • alarm your home base
  • turn off using keypad
  • restart your home assistant to get the latest data status from eufy servers
  • go to Developer Tools page and find respective alarm_control_panel entity
  • share state attributes here (remove some attributes if you are worried about serial number or etc)

@r2xud
Copy link
Author

r2xud commented Sep 18, 2021

The problem is that the intergration will not load when i restart home assistant while the state is switched to "Off".

I get the following error msg:

Logger: custom_components.eufy_security
Source: custom_components/eufy_security/websocket.py:69
Integration: Eufy Security (documentation, issues)
First occurred: 21:31:16 (2 occurrences)
Last logged: 21:31:16

eufy_security - Exception - process_messages: 6 - traceback: Traceback (most recent call last): File "/config/custom_components/eufy_security/websocket.py", line 67, in process_messages await self.on_message(msg) File "/config/custom_components/eufy_security/websocket.py", line 83, in on_message await self.message_callback(message) File "/config/custom_components/eufy_security/coordinator.py", line 184, in on_message self.async_set_updated_data(self.data) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 287, in async_set_updated_data update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 464, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 498, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 470, in _stringify_state state = self.state File "/config/custom_components/eufy_security/alarm_control_panel.py", line 128, in state return CODES_TO_STATES[current_mode] KeyError: 6 - message: WSMessage(type=<WSMsgType.TEXT: 1>, data='{"type":"event","event":{"source":"station","event":"property changed","serialNumber":"XXXXXXXXXXXXXXXX","name":"currentMode","value":6,"timestamp":1631993476404}}', extra='')
eufy_security - Exception - process_messages: 6 - traceback: Traceback (most recent call last): File "/config/custom_components/eufy_security/websocket.py", line 67, in process_messages await self.on_message(msg) File "/config/custom_components/eufy_security/websocket.py", line 83, in on_message await self.message_callback(message) File "/config/custom_components/eufy_security/coordinator.py", line 184, in on_message self.async_set_updated_data(self.data) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 287, in async_set_updated_data update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 464, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 498, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 470, in _stringify_state state = self.state File "/config/custom_components/eufy_security/alarm_control_panel.py", line 128, in state return CODES_TO_STATES[current_mode] KeyError: 6 - message: WSMessage(type=<WSMsgType.TEXT: 1>, data='{"type":"event","event":{"source":"station","event":"property changed","serialNumber":"XXXXXXXXXXXXXXXX","name":"guardMode","value":6,"timestamp":1631993476635}}', extra='')

@fuatakgun
Copy link
Owner

fuatakgun commented Sep 18, 2021 via email

@fuatakgun
Copy link
Owner

please get latest version and test, feel free to resolve later on.

@r2xud
Copy link
Author

r2xud commented Sep 20, 2021

I installed version 0.4.2. now i can see the door sensors and the keypad in the intergration panel but when rebooting i get the following error msg:

Logger: homeassistant.components.alarm_control_panel
Source: custom_components/eufy_security/alarm_control_panel.py:128
Integration: Alarm bedieningspaneel (documentation, issues)
First occurred: 11:45:37 (2 occurrences)
Last logged: 11:45:37

Error adding entities for domain alarm_control_panel with platform eufy_security
Error while setting up eufy_security platform for alarm_control_panel
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 587, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 698, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 464, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 498, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 470, in _stringify_state
    state = self.state
  File "/config/custom_components/eufy_security/alarm_control_panel.py", line 128, in state
    return CODES_TO_STATES[current_mode]
KeyError: 6

@fuatakgun
Copy link
Owner

fuatakgun commented Sep 20, 2021 via email

@r2xud
Copy link
Author

r2xud commented Sep 20, 2021

Alright. I do not see the latest version of the integration. How do i install it?

@fuatakgun
Copy link
Owner

you should see an update notification in HACS like this
image

@r2xud
Copy link
Author

r2xud commented Sep 20, 2021

Yes that is what i was looking for. There is no update available.

@fuatakgun
Copy link
Owner

did you update recently? I had changed the library 16 hours ago.

@r2xud
Copy link
Author

r2xud commented Sep 20, 2021

No i did not as far as i know. Is there a way to check what version i am running?

In the repo i see that the last edited file is the README.md 3 days ago. I do not see the change from 16 hours ago.

download

@fuatakgun
Copy link
Owner

I am getting old, updated the repo just now, please try and share the results.

@r2xud
Copy link
Author

r2xud commented Sep 20, 2021

Thanks for the great work you do.

I just installed the update. I will test tonight and let you know the results.

@r2xud
Copy link
Author

r2xud commented Sep 20, 2021

I'm now able to arm_home, arm_away and disarm the alarm using the home assistant alarm panel. When disarming the state one the homebase switches to Disarmed so it does not show on the keypad. But that was to be expected since not everyone has a keypad.

Thanks for the great work! I think it's resolved.

@r2xud r2xud closed this as completed Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants