Alarm component - Home Assistant

Hi,
I cant set a pin-code in the widget. No entity is found. I would like to define a code manually.
Im using a custom alarm component: https://github.com/akasma74/Hass-Custom-Alarm

But the service call to disarm is exactly the same:

@asifma Is this an issue when calling service manually from HA UI or from HomeHabit app?

From Homehabit i can only Arm away and Arm home. I cant Disarm.
I cant even bind i passcode. When i try to bind a passcode, no entity is found in homehabit.
I would like to have the possibility to set any integers by myself in homehabit

@asifma Passcode doesn’t need to be bound for HA integration, since HA alarm entities have built-in passcode. It should normally be hidden when binding to HA alarm entity with passcode already.

Can you show what are the attributes for alarm_control_panel.house entity on “States” tab?

Im running the custom alarm component which is very powerful and popular. These are the attributes that comes from it. The passcode are stored in the user attribute within a user object. I have removed the values of all the attributes.

code_format
changed_by
code_arm_required
platform
immediate
delayed
ignored
allsensors
ignore_open_sensors
code_to_arm
panel_locked
passcode_attempts
passcode_attempts_timeout
changedbyuser
panic_mode
arm_state
enable_night_mode
enable_persistence
enable_log
log_size
supported_statuses_on
supported_statuses_off
updateUI
default_images_path
override_images_path
default_icon_name
admin_password
py_version
users: [object Object],[object Object],[object Object],[object Object]
panel
“cameras”: [

],
“enable_clock”
“enable_weather”
“hide_sidebar”
“hide_sensors”
“shadow_effect”
“panel_title”
“camera_update_interval”
“enable_sensors_panel”
“enable_camera_panel”
“enable_floorplan_panel”
“floorplan”
“round_buttons”
“enable_custom_panel”
“enable_serif_font”
“hide_passcode”
}
logs
mqtt
“enable_mqtt”
“payload_arm_away”
“qos”
“state_topic”
“payload_disarm”
“override_code”
“payload_arm_home”
“payload_arm_night”
“command_topic”
“pending_on_warning”
}
states
“armed_away”
“immediate”
“delayed”: [

],
"override"
"pending_time"
"warning_time"
"trigger_time"
"check_before_arm": [

]

},
“armed_home”
“immediate”: [

],
"delayed"
"override"
"pending_time"
"warning_time"
"trigger_time"
"check_before_arm": [

]

},
“armed_night”
“immediate”
“delayed”
“override”
“pending_time”
“warning_time”
“trigger_time”
“check_before_arm”
}
}
friendly_name

@asifma I do need to see values for some attributes. Mainly was is the value for code_format attribute?

Hi, I actually cant find the digits in any of the attributes.
code_format: null

it would be great if I could bind a digit by myself or an other custom entity that I create in Home Assistant which has this attribute.

In your widget, what attribute are you looking at to fetch the disarm code?

The app never gets the disarm code from HA server, it just submits whatever user enters and HA compares it. The app makes the same service call as you showed in the first post, with code in service data.

The code_format attribute should be one of the known values though. The app currently supports only number (text is not supported yet). If code_format is null it means there is no code required.

Does standard HA UI works correctly with this component and asks for a code just like with build-in alarm panel components?

Yeah I got you.
Acually it does work perfectly with the standard HA UI.

Im looking at the custom component code which is for some reason:

@property
def code_format(self):
    """One or more characters."""
    return None if self._code is None else '.+'

And Standard Home Assistant component has:

@property
def code_format(self):
    """Return one or more digits/characters."""
    if self._code is None:
        return None
    if isinstance(self._code, str) and re.search("^\\d+$", self._code):
        return alarm.FORMAT_NUMBER
    return alarm.FORMAT_TEXT

Anyway the standard HA UI seems to give me a digit panel even if the attribute is null.

ok, let me check on standard HA UI behavior. Will update.

Sorry, the code in the custom component is:

@property
def code_format(self):
    """Regex for code format or None if no code is required."""
    # affects Lovelace keypad presence (None means no keypad)
#        return None if self._code is None else '.+'
    FNAME = '[code_format]'
    res = None if (self._code is None or (self._state == STATE_ALARM_DISARMED and not self.code_arm_required)) else alarm.FORMAT_NUMBER
    _LOGGER.debug("{} self._code: {}, self._state: {}, code_arm_required: {}, returning {}".format(FNAME, self._code, self._state, self.code_arm_required, res))
    return res

can you also tell me what are the values of code_arm_required and code_to_arm attributes?

Its working now!!! When I had the alarm armed it gave the code_format: number.
I also had to Add the widget in homehabit WHILE the alarm was in arm_mode. Now its working!
I love this project! Started with Tileboard, but found this way much better.

Great job! What I’m still missing is Color-picker for lights, Media_player widget, and buttons where you can define your own service calls. Same thing that exists in node-red

E.g:

Oh, this is interesting. Definitely not expected behavior, but I will see if it can be improved on the app side.

Thank you!

Both of those should already be available for HA integration. If it isn’t working for you, please provide some details, there might be a bug or something.

My bad!!! Media Player works perfectly :smiley. What I meant with color-picker was more like a color wheel with the whole spectrum instead of five colors that you can define. But that has already been suggested.

Thanks again!

1 Like