excaliburpartners / OmniLinkBridge

MQTT bridge, web service API, time sync, and logging for HAI/Leviton OmniPro II controllers
GNU General Public License v3.0
41 stars 24 forks source link

User code not required to disarm #36

Closed WorldOfMaze closed 2 years ago

WorldOfMaze commented 3 years ago

For and foremost, thank you for the OmniLinkBridge. I have a mix of old and new tech in Home Assistant (HA) and the Bridge has allow me to seamlessly integrate all of my technologies.

When I arm or disarm the alarm panel thru HA, a user code is not required. While this is OK when going from less to more secure - e.g.: disarmed to Arm Away - I would like the user to be required to enter a code when going to less secure (Disarmed). Am I missing a configuration setting somewhere?

Thanks.

rwagoner commented 3 years ago

OmniLinkBridge uses the MQTT Alarm Control Panel integration in Home Assistant. The integration docs show you could specify a code used by Home Assistant to arm or disarm. I had looked at this before, but the code could not be passed over MQTT to be validated by OmniLinkBridge and the OmniPro panel. The idea was to let the panel handle user codes for arming / disarming. For now I'm relying on the fact you have to log into Home Assistant as enough security to be able to disarm.

WorldOfMaze commented 3 years ago

Thanks for the response, Ryan. It has been a while since I did any development for OmniLink, but my recollection is that user code to not passed as part of the arm/disarm API so you would need to validate the code before arming. It would be nice to have this feature, but, as you say, if you can get to HA to disarm the OmniPro, you are probably authorized.

Thanks again for making the Bridge available.

rwagoner commented 3 years ago

Yes that is correct. OmniLink has a validate security code command you call first. It checks if the code is valid and returns the authority level and user code number. Then you call the arm command with the user code number.

madasus commented 2 years ago

I'm looking to use HA on tablets around my house and not being prompted to enter a pin to disarm the alarm is holding me back from adopting this solution. Do you know if there is way for HA to prompt for a pin and use that in the disarm process?

The goal would be to prevent someone from just pressing disarm on the tablet and shutting the alarm off.

I've looked on the HAI side and there is an alarm card but i'm not sure how I would utilize that against this solution?

WorldOfMaze commented 2 years ago

From @rwagoner Oct 19, 2021 in this same thread...

_OmniLinkBridge uses the MQTT Alarm Control Panel integration in Home Assistant. The integration docs show you could specify a code used by Home Assistant to arm or disarm. I had looked at this before, but the code could not be passed over MQTT to be validated by OmniLinkBridge and the OmniPro panel. The idea was to let the panel handle user codes for arming / disarming. For now I'm relying on the fact you have to log into Home Assistant as enough security to be able to disarm._

madasus commented 2 years ago

i'm able to figure out how to send a PIN in the MQTT command request but it looks like there is no validation on the OmniLinkBridge side of things. I'm guessing the number after the disarm is just the user location in the HAI config (1,2,3 etc).

Is there anyway to ask the OmniLinkBridge to validate a pin as i'm now able to send it in the request?

rwagoner commented 2 years ago

I looked into this again. Home Assistant now has a REMOTE_CODE placeholder that will pass over the user entered code. I have it working on a dev branch. I need to do some more testing and will release 1.1.13 hopefully tomorrow.

madasus commented 2 years ago

Yes - it works perfectly to pass the code now. Here is the correct code for the yaml. Thank you for the quick response.

mqtt: alarm_control_panel:

rwagoner commented 2 years ago

@madasus If you set OmniLinkBridge.ini mqtt_discovery_area_code_required= with the area id, Home Assistant MQTT discovery will enable the alarm keypad. Additionally I changed it to {{ action }},validate,{{ code }} to ensure it validates the security code and doesn't accidentally accept a user code number.