Sian-Lee-SA / Home-Assistant-Switch-Manager

Switch manager is a centralised component to handle button pushes for your wireless switches. This includes anything passed through the event bus. The component relies on switch blueprints which is easily made to allow GUI configuration of your switches and their button pushes. This helps remove clutter from the automations.
Other
232 stars 85 forks source link

Problems editing buttons #258

Closed skelgaard closed 1 month ago

skelgaard commented 1 month ago

hey, if i go into edit a button done before 2.0 billede then if i delete and add new actions sometimes the editor shows up, but mostly this way billede i see load of errors in the console billede billede

any suggestions is wery welcome

Sian-Lee-SA commented 1 month ago

I guess you missed the warning up the top of the readme? "The device sequence action is currently unsupported, use service/action calls instead as this should be used thoughout Home Assistant anyway.".

skelgaard commented 1 month ago

but even with all deleted actions it still says sequence ? billede and if i press add action it still stays in sequence ?

Sian-Lee-SA commented 1 month ago

have you hard refreshed the page? I also don't understand what "it still says sequence" means. Your screenshot shows the title sequence. That's suppose to be there, it's just empty which is normal.

skelgaard commented 1 month ago

billede and yes ofcourse i have rerefshed the page, restarted home assistant and cleared cache... still giving problems for me

Sian-Lee-SA commented 1 month ago

Hard refresh... meaning cleared cache etc. and again, your image gives no context to your problem whatsoever

Sian-Lee-SA commented 1 month ago

And you're running latest versions for both HA and Switch Manager?

skelgaard commented 1 month ago

billede billede

https://github.com/user-attachments/assets/65c0af30-b976-468c-ae8b-e832fa235114

Sian-Lee-SA commented 1 month ago

Was your switch saved with the device action that you tried previously? Also does this only happen with Light toggle or others aswell?

skelgaard commented 1 month ago

yes... i have deleted all actions, saved it, closed it, reopened it.... do i need to delete the switch and readd them to make it work again ? i would hate doing that for 20+ switches.....

Sian-Lee-SA commented 1 month ago

go into your HA config .storage folder and open the file switch_manager. You should see if the device action is stored in there for your switch. If you're comfortable with JSON, just go ahead and remove the device actions. Also if you do create a new switch, does adding actions work normally?

Also when making changes to the json file you'll need to restart HA

skelgaard commented 1 month ago
  "10": {
    "name": "Marius Switch",
    "enabled": true,
    "blueprint": "zigbee2mqtt-ikea-styrbar",
    "identifier": "zigbee2mqtt/Marius switch/action",
    "variables": null,
    "rotate": 0,
    "buttons": [
      {
        "actions": [
          {
            "sequence": [],
            "mode": "single"
          },
          {
            "sequence": [
              {
                "action": "light.turn_off",
                "metadata": {},
                "data": {},
                "target": {
                  "device_id": [
                    "739ccd74b93d10c43d2af14c5326345d",
                    "134d79bf79e0dc005900cb4778aa24b2",
                    "c903a00aa3c88b9d2491e685ec95fc5d"
                  ]
                }
              }
            ],
            "mode": "single"
          },
          {
            "sequence": [],
            "mode": "single"
          }
        ]
      },
      {
        "actions": [
          {
            "sequence": [],
            "mode": "single"
          },
          {
            "sequence": [],
            "mode": "single"
          },
          {
            "sequence": [],
            "mode": "single"
          }
        ]
      },
      {
        "actions": [
          {
            "sequence": [],
            "mode": "single"
          },
          {
            "sequence": [],
            "mode": "single"
          },
          {
            "sequence": [],
            "mode": "single"
          }
        ]
      },
      {
        "actions": [
          {
            "sequence": [],
            "mode": "single"
          },
          {
            "sequence": [],
            "mode": "single"
          },
          {
            "sequence": [],
            "mode": "single"
          }
        ]
      }
    ]
  },
Sian-Lee-SA commented 1 month ago

is the console log showing anything relevant?

skelgaard commented 1 month ago

billede billede

Sian-Lee-SA commented 1 month ago

Also if you do create a new switch, does adding actions work normally?... I did ask before but you might've missed it as it was an edit. Also that error doesn't give me much to go on without the full message.

skelgaard commented 1 month ago

i delete the switch and readded it... it does the same for me

or we in a state where i need to uninstall, delete the config and install agaon ?

Sian-Lee-SA commented 1 month ago

I really have no idea whats going on here, It's not even guarenteed to work even if you do that. I also have not had any issue raised that is remotetly similiar to this issue. I would try a different browser first just to rule that out. Also check to make sure it works normally in your automations page when you add an action etc. Lastly you can copy the json file and back it up and try a fresh install then revert if need be

philippnbg commented 1 month ago

I do have the same issue. Tested on multiple browsers, no browser-plugins present. homeassistant and switch-manager on latest version.

Steps to reproduce:

1) newly added switch via UI image

2) Add device action in init (or press, it doesn't matter) image

3) select device --> error image

skelgaard commented 1 month ago

just did a clean install on my test homeassistant and setuo same switch... here it works fine... will try and anylyse the difference in the two config files

skelgaard commented 1 month ago

not working button ` { "actions": [ { "sequence": [], "mode": "single" }, { "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "device_id": [ "739ccd74b93d10c43d2af14c5326345d", "134d79bf79e0dc005900cb4778aa24b2", "c903a00aa3c88b9d2491e685ec95fc5d" ] } } ], "mode": "single" }, { "sequence": [], "mode": "single" } ] },

working code ` { "actions": [ { "sequence": [ { "action": "light.toggle", "metadata": {}, "data": {}, "target": { "device_id": [ "35353e944b4cdf3d0f1b926391938d03", "0f7d5d4f54c3e74ef794a60421f5c57e", "70b230fbfe8dfd634d45cd677794c588" ] } } ], "mode": "single" }, { "sequence": [], "mode": "single" }, { "sequence": [], "mode": "single" } ] }, i copied over the working code, changed the id's and started HA again and now its working

skelgaard commented 1 month ago

one of the others making errors "sequence": [ { "type": "toggle", "device_id": "2b93e8dbd0349e86e005acc332759824", "entity_id": "8315260bc642d44f90a85caf70cce427", "domain": "light" } ],

philippnbg commented 1 month ago

I do have the same issue. Tested on multiple browsers, no browser-plugins present. homeassistant and switch-manager on latest version.

Steps to reproduce:

  1. newly added switch via UI image
  2. Add device action in init (or press, it doesn't matter) image
  3. select device --> error image

Oh boi. It took me a while to actually understand what @Sian-Lee-SA ment with The device sequence action is currently unsupported, use service/action calls instead as this should be used thoughout Home Assistant anyway

For everyone else that didn't RTFM: direct references to the device are currently not possible. In my case I wanted check a condition based on the state of a referenced device. Instead i should check the condition of the entity image

image

skelgaard commented 1 month ago

thats fine, but shouldn't it automatic convert it to that when i updated from 1. to 2. ? else there is no other way than to start with a clean config and do it all again......