akasma74 / Hass-Custom-Alarm

It is a fork of "Yet another take on a home assistant custom alarm" that will exist until its author is back to our Earth
80 stars 31 forks source link

Error when arming from Lovelace #19

Closed ncgbrown closed 5 years ago

ncgbrown commented 5 years ago

Home Assistant: v0.94.4 This Panel: v1.3.8_ak74 Component (Bwalarm): v1.1.8_ak74 Python: v(3,7,3,final,0)

2019-06-27 06:18:56 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1796488304] async_alarm_arm_home() missing 1 required positional argument: 'ignore_open_sensors' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service connection.context(msg)) File "/usr/src/homeassistant/homeassistant/core.py", line 1150, in async_call self._execute_service(handler, service_call)) File "/usr/src/homeassistant/homeassistant/core.py", line 1172, in _execute_service await handler.func(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 194, in handle_service required_features File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 316, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 337, in _handle_service_platform_call await getattr(entity, func)(**data) TypeError: async_alarm_arm_home() missing 1 required positional argument: 'ignore_open_sensors'

akasma74 commented 5 years ago

Could you share your Lovelace code or something and describe how to reproduce the issue? Without than I can't help.

ncgbrown commented 5 years ago

I'm on a vanilla .94.4 install. From there I added sensors to the configuration.yaml and I added your component per install document. I will attach the alarm.yaml that has been created by the configurator. From the front page I am attempting to use this: image

Either Arm Away or Arm Home yields the above error. Interestingly, if I arm from the bwalarm component, then I can go back to the main screen and disarm from the above buttons just fine.

alarm.yaml.txt

akasma74 commented 5 years ago

I'm on a vanilla .94.4 install. From there I added sensors to the configuration.yaml

you mean alarm.yaml?

and I added your component per install document. I will attach the alarm.yaml that has been created by the configurator. From the front page I am attempting to use this:

image

i.e Lovelace alarm card. This component was created before Lovelace and therefore is not guaranteed to work with it.

Either Arm Away or Arm Home yields the above error.

because arm_xxx methods' attributes are extended - added ignore_open_sensors attribute. I hoped that it would let us arm from Lovelace even if there are open sensors, but it doesn't work that way.

Interestingly, if I arm from the bwalarm component, then I can go back to the main screen and disarm from the above buttons just fine.

disarm has no changes to its attributes structure hence you can disarm it everywhere.

I thought you tried to make this

work and wanted to have a look at the code. The thing is this integration would benefit form Lovelace card to control it, but it should be a custom card (as I explained above) and I just have no knowledge/time to deal with it as I new to this stuff. The main issue here is that this panel can check if any of the sensors is open and ask user whether to cancel or proceed. The standard alarm card obviously can't do that, it's simple enough. If someone could implement that dialog it would be great as there i already a custom alarm card that give us all necessary code and just requires some tweaks.

asifma commented 5 years ago

The problem started to occur when you introduced the attribute: "ignore_open_sensors" Before that, the Lovelace card worked perfect! I rather would Arm from my Lovelace card and not within the "Alarm component" view.

Could you address the problem somehow so that we can continue using the Alarm Lovelace card?

akasma74 commented 5 years ago

sure I can, it'll be even better soon ;) just keep in mind that with a standard alarm card open sensors will be ignored when arming. it is fairly easy to add support of that great feature, but I'm not that good at custom Lovelace cards yet.

Just don't get people opening an issue and disappearing without giving enough information to deal with it.

asifma commented 5 years ago

Sorry man! I'll be glad to provide more information. You are doing a great job with forking this project. I have done super nice automation with this alarm component in combination with Node-Red

For this particular thing, the problem is that the Lovelace Alarm Panel Card: https://www.home-assistant.io/lovelace/alarm-panel/

is configured to arm/disarm with the standard alarm_control_panel.alarm_arm_away and not: bwalarm.alarm_arm_away And that was not an issue until you added the new flag.

I'm not sure how you could tackle this. But perhaps a setting were you could specify not to have it mandatory in the service call.

Because the disarm from the lovelace alarm panel is still working :)

akasma74 commented 5 years ago

I'm talking about the author of this issue regarding the additional info. I'll just rename my service call so there will be old-style calls for standard Lovelace card and new style ones for more advanced custom cards/automation. I'm hoping to make a new release especially to address this issue soon

ncgbrown commented 5 years ago

My apologies for not responding. I have been dealing with a family issue and are just now reading responses. Currently I am on vanilla home assistant. I have not yet added any code to implement the above keypad but I assumed that I would need the default Lovelace 'Disarm' / 'Arm' working since I believe the keypad is just an extension of these buttons - but I believe that both asifma and myself are needing the same thing.

akasma74 commented 5 years ago

No worries. The picture I was referring to isn't the default one, hence my question. You both will get that thing back shortly today ;)

ncgbrown commented 5 years ago

Awesome - And again, many thanks for all the effort . . .