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
79 stars 29 forks source link

’<’ not supported between instances of ‘str’ and 'int’ when editing settings #34

Open skynet01 opened 5 years ago

skynet01 commented 5 years ago

Your components (from Alarm/Settings/About):

Platform & Browser:

Describe the bug When going to settings of the panel I get the following errors

Failed to call service alarm_control_panel/alarm_yaml_user. list indices must be integers or slices, not str when saving any setting in the settings I get this ’<’ not supported between instances of ‘str’ and 'int’

To Reproduce Steps to reproduce the behavior:

  1. Go to settings pannel

Expected behavior Saving settings

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Installed using HACS copied resources folder to /config inside: /config/resources/bwalarm/bwalarm.yaml

in the main confing alarm_control_panel: !include resources/bwalarm/bwalarm.yaml

akasma74 commented 5 years ago

Did you install the integration when on HA 0.96.3 or on previous version of HA that was updated later? Just checking because I'm currently on 0.95.4 and so far have no intention to update as a) I'm away from my HA and b) I have no issues with saving any changes to bwalarm.yaml..

skynet01 commented 5 years ago

With HA 0.96.3, it's a fresh install

dnguyen800 commented 5 years ago

Hi, I also get the same error message as @skynet01 , but I have a slightly different HA setup. I cannot save any settings through the Alarm UI either. I did initially try to setup bwalarm settings in the bwalarm.yaml, but then erased and tried to save settings in the UI.

This is a first-time install of bwalarm. I have tried uninstalling and re-installing through HACS again but the issue remains.

Your components (from Alarm/Settings/About): component version v1.10.1

Platform & Browser: Platform name & Home assistant version [e.g. Hass.io 0.95.4] Browser name Chrome

Describe the bug When pressing a button on the alarm (in the screenshot, I press the 'Away' button, I get this message:

Failed to call service alarm_control_panel/alarm_arm_away

when saving any setting in the settings I get this:

’<’ not supported between instances of ‘str’ and 'int’

To Reproduce Steps to reproduce the behavior:

Click on any button in alarm panel, or change any setting.

Expected behavior Saving settings

Screenshots If applicable, add screenshots to help explain your problem.

image

image

Additional context Installed using HACS copied resources folder to /config inside: /config/resources/bwalarm/bwalarm.yaml

platform: bwalarm in the main config alarm_control_panel: !include resources/bwalarm/bwalarm.yaml

dnguyen800 commented 5 years ago

Update: I installed bwalarm on another HA instance and it worked. The only difference I can think of is in the bwalarm.yaml file. I previously had this entry (with the '-') in the yaml file:

- platform: bwalarm

Changing to this fixed the issue:

platform: bwalarm

Now that I see a working config, I can see why the dash was causing problems. The Alarm UI edits the bwalarm.yaml file and adds configuration entries. If you have another alarm besides bwalarm listed in the .yaml file, then you will run into the issue.

akasma74 commented 5 years ago

@dnguyen800 so in your case it's another platform in bwalarm.yaml that created the issue, right?

The only difference I can think of is in the bwalarm.yaml file. I previously had this entry (with the '-') in the yaml file

it's not the original bwalarm.yaml, is it? it won't work with dash as it's not a list.

dnguyen800 commented 5 years ago

Correct, it was my fault as I wanted to include another MQTT alarm platform in bwalarm.yaml. By adding the '-', it messed up the YAML formatting when the UI alarm settings are changed.

akasma74 commented 5 years ago

@skynet01 could you post content of your bwalarm.yaml and HA log when you see that error here?

skynet01 commented 5 years ago

Yes, I can confirm that removing the "-" from the config fixes the issue. No more errors in the setting and everything seems to be working. Would be nice to have this fixed since I have other devices that have built-in alarm panels like Arlo that I can't use

akasma74 commented 5 years ago

@skynet01 do you know how to fix it? as far as I understand, it's incorrect YAML syntax and there is nothing anyone can fix apart from correcting the yaml file itself - correct me if I'm wrong.

skynet01 commented 5 years ago

Maybe the config for the app should be in a separate file since it’s managed by the ui anyway. That way we can just have our alarm.yaml file in the main config folder with just single line platform declaration.

akasma74 commented 5 years ago

Got it. Need to think about it as it's a bit complicated stuff

skynet01 commented 5 years ago

Can't you just have the component load with "platform: bwalarm" in alarm.yaml file and then just keep all of the config parameters in a separate settings file? Or its not that simple