Bwalarm (akasma74 edition)

So you’re talking about HA user settings, right?
They should apply even after restart as soon as you use the same user name, and they should apply on every device this user connects to HA from. That’s how it was designed in HA.
I’ll double check my config and repost back.

UPDATE: Always hide the sidebar is per device, i.e you need to configure it for your user on each device (and by default it is off).
If device is restarted, the setting retains its state (as it’s held by HA).

And the main thing - it’s still possible to swipe from left to right to show the sidebar.
So ideally one need to take additional measures like using custom header, Fully Browser (not sure).
Or just use a user account without admin rights and restrict views/set a separate dashboard for that device.
Plenty of choice.

Those who use Lovelace to set the alarm - could you describe your “ideal” alarm card (and what you cannot get using the standard one)?
What would you like to see on it, should it take the whole view (panel_mode) or not, do you want to stick to standard Lovelace alarm card or happy to to install some custom cards to get what you want etc?

The reason I’m asking is I played with the alarm recently trying to get feedback from it into Lovelace and somehow let users know that there are active sensors so it won’t arm when you click say, ARM AWAY.
Here’s the result with only standard LL cards, all you need to have is a small package.
Screen Shot 2020-04-10 at 17.56.27 (2)

Of course, the sensors bit can be polished as it’s a markdown card.
It can be done much prettier but you’ll need to install some custom LL cards.

Please let me know what you think about it.

3 Likes

Nice. The active sensor list would be great. Other than that the only thing that needs improving over the original card is a keypad font you can read without a microscope.

I would prefer a card to full panel.

what is it?

the only way I can do that is using card-mod.

it’s easily done :wink:

The list of sensors you have shown in the card

Well that’s what I do now. Maybe I misunderstood. I thought you were making a new card.

yeah, that was the reason to mess around with it. it can be done so I thought why not?

well, it’s not easy to make a custom card and not everyone is happy to use custom cards.
this card is basically an alarm card, a markdown card and 2 buttons in a conditional card and it took me a couple of hours to create the whole thing from scratch.
a new card would take much longer as I have no experience.

the most important thing now is to get an idea what people need most from such a card in order to decide which way to go.

Hi. I’m using node red for my alarm. I’m trying to integrate Automations into my flows

I’m using a function node link to an email node, The email subjects works. the email body shows data…

Below is my function node code.

msg.topic = "Home Assistant - Alert - Automation"
msg.payload = { "data": {message: 'ALARM TRIGGERED!!! {{ states[states.alarm_control_panel.house.attributes.changed_by.split(".")[0]][ states.alarm_control_panel.house.attributes.changed_by.split(".")[1]].name }}'} }
return msg;

Please help me fix my code so it shows which sensor triggered the alarm

so what’s wrong with the code then?

what about this?

msg.payload = {
  'data': {
    'message': >
      ALARM TRIGGERED by {{ states[state_attr('alarm_control_panel.house', 'changed_by')].name }}
  }
}

I was originally getting the below text in the email body

{"data":{"message":"ALARM TRIGGERED!!! {{ states[states.alarm_control_panel.house.attributes.changed_by.split(\".\")[0]][ states.alarm_control_panel.house.attributes.changed_by.split(\".\")[1]].name }}"}}

im now getting syntax errors in node red with the new code

You need to say so. I think that’s because you’re doing it in a NodeRed function so there is no way to use Jinja templates.

but yo won’t tell us what it complains about, will you? Actually, don’t bother as I can see the issue now.
I have 0 experience with NodeRed so if you don’t help me (by providing info) I won’t be able to help you.

Please explain what you want to achieve and why you cannot use a normal automation for that?

Your post on the Lovelace card is timely, as I was just preparing to ask a related question.

So, first, on your card: I would like almost precisely what you displayed. A way to see open sensors, and a way to arm with overriding those active sensors. It looks to me like you are heading in the exact direction I would like to see! And I would probably put it as a card, not as a panel. But if someone put it as the first card and enabled panel mode, then that should take care of anyone wanting it to be full panel.

Now, on my question (which may become mute). I wanted to display your alarm panel in a card rather than a separate page with left-bar link. So I tried Iframe with the full URL:

type: iframe
url: 'http://192.168.1.xxx:8123/alarm'
aspect_ratio: 75%

However, this loads a complete new instance of HA. While it works in my PC browser, and also from WallPanel, it does not work from HA App on Android (it does not load HA again). Also, in WallPanel, it loses connection in the iframe instance and must be reloaded.

So, is there a proper way to put your existing alarm interface into a Lovelass panel, probably through iframe but with a more direct URL? Obviously, if you complete what you have proposed above, then this is not needed, but for now I would like to know if there is an existing way to display your alarm in a Lovelace panel.

Thanks
Chuck

If you search this topic by iframe you should find some success stories.
Have to admit that I haven’t tried as a) I like the separate panel, it works fine in my WallPanel app and b) eventually it might be converted into a proper Lovelace card.
So officially this component should be controlled via its panel. Yes, it is possible to do that from LL alarm card, but it’s not 100% replacement and people do it at their own risk until we have a proper alarm card.

The difference between the current panel and the mock LL card I showed is the former allows for many things like changing settings, checking logs, adding custom panels etc so it’s much more complex thing and converting it into a card is a serious task. The downside of the current panel is it takes a lot of time to load it and sometimes it’s an issue.

Ideally I’d like to re-design it so we have lightweight LL card with rich functionality. Still thinking about ways to achieve it in terms of look and feel, internal design etc.

Yes, I agree that your panel has better features. I was hoping to put your panel in a card, using the Ipanel. I have not found via google a good way of doing that yet. I found some very old posts that do not appear to be currently relevant.

I will watch as you progress on a lightweight Lovelace card with more features than the Alarm Card.

Chuck

have you seen this?

Yes, and his iframe card is same as mine. It will not display in HA App, and disconnects after some time in WallPanel. I was hoping there was a way of specifying your panel without using HA/alarm, which loads a whole new copy of HA.

Chuck

@michaelhdmd, from January. I tried putting the BWAlarm in a iframe, using your code. Ran into two issues: 1. it would not display on HA App on Android, though it works in a browser and on wallpanel. 2. The BWalarm in the iframe would disconnect with inactivity, and manual refresh took way too long (would reload main HA, then reload HA in the iframe).

Did you see such issues?

Works fine as a full panel as originally intended.

Thanks
Chuck

Hi since up date to 108 and 109
If I install any update on reboot the alarm has the below error and is not loaded, a second reboot all is good again

Error while setting up bwalarm platform for alarm_control_panel
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/config/custom_components/bwalarm/alarm_control_panel.py", line 399, in async_setup_platform
    config={"alarmid": "alarm_control_panel.house"},
  File "/usr/src/homeassistant/homeassistant/components/panel_custom/__init__.py", line 140, in async_register_panel
    require_admin=require_admin,
  File "/usr/src/homeassistant/homeassistant/components/frontend/__init__.py", line 190, in async_register_built_in_panel
    raise ValueError(f"Overwriting panel {panel.frontend_url_path}")
ValueError: Overwriting panel alarm

It’s been a while since I’ve used HA, as we’ve been waiting for our home to be built.
Just want to say a big thanks to @AhmadK for maintaining this. It’s better than ever!

I’ve got everything working, and all my automations into NodeRed. Also have the alarm integrated into homekit and google home.
Just wondering though, how are people dealing with “open sensors” when not using the Bwalarm panel?

I’ve created automations in nodered to notify me of which sensor is open via Push notification and google TTS, but obviously there’s not “Override” option here.
Curious how others are dealing with this?

Thanks.

Good point !!
I don’t :slight_smile:
It happened to me yesterday and I had to go the bwalarm panel.
I have built a nodered panel and I don’t use bwalarm panel nor alarm panel from HA.
So sending the “open sensors” in MQTT et being able to force using MQTT message would be cool.

GV

@onkytonk, @greengolfer what’s your use case?
Currently it’s possible to change how the alarm treats open sensors when arming using service calls, check this document.
Speaking about MQTT - only arm_xxx and disarm commands are supported at the moment, but it’s possible to extend if needed, just need an idea what’s required.
I’m not quite sure but I might add an attribute that can be checked (something like `alarm_control_panel.house.attributes.active_sensors) - actually, it should be a dictionary for all enabled arm modes. Don’t know if it would help, any thoughts?