asosnovsky / Shortumation

[Not Maintained] A better way to write automations in home-assistant without having to install and run a seperate automation engine!
MIT License
300 stars 7 forks source link

Error: Invalid Node Type #124

Closed blathers123 closed 2 years ago

blathers123 commented 2 years ago

Describe the bug After trying to edit an existing automation for the first time, Shortumation shows an error "Error: Invalid Node Type". It is not possible to get out of the page

To Reproduce Steps to reproduce the behavior: Edit an existing automation that wasn't previously created in Shortumation

Screenshots image

Desktop (please complete the following information):

Additional context Problem will persist across restarts and Shortumation must be uninstalled/reinstalled

Logs:

/app /app

BUILD_VERSION = v0.5.2 HOST = 0.0.0.0:8000 HASSIO_WS = Python 3.9.13

[2022-08-06 02:31:49 -0400] [8] [INFO] Running on http://0.0.0.0:8000 (CTRL + C to quit) INFO:hypercorn.error:Running on http://0.0.0.0:8000 (CTRL + C to quit) INFO:src.api.routes.socket:Websocket closed. INFO:src.ws_redirect:Closing socket... INFO:src.ws_redirect:Closed socket

asosnovsky commented 2 years ago

Any chance you can share the automation that blew up the UI? I'll investigate this later as soon as I can. It really shouldn't be blowing up when it sees something new. (I suspect it's the unimplemented calendar node type)

SgtTacooo commented 2 years ago

Not OP but I have the same issue. Very first thing I tried doing killed the app. Had to reinstall just to get it working again.

alias: Light.Tank_Day
description: ""
trigger:
  - platform: sun
    event: sunrise
    offset: "30"
condition: []
action:
  - scene: scene.light_day
  - service: input_select.set_options
    target:
      entity_id: input_select.tank_light_mode
    data:
      options: day
mode: single
asosnovsky commented 2 years ago

Not OP but I have the same issue. Very first thing I tried doing killed the app. Had to reinstall just to get it working again.


alias: Light.Tank_Day

description: ""

trigger:

  - platform: sun

    event: sunrise

    offset: "30"

condition: []

action:

  - scene: scene.light_day

  - service: input_select.set_options

    target:

      entity_id: input_select.tank_light_mode

    data:

      options: day

mode: single

In your case it may be the scene node type. I definitely haven't implemented it yet.

In general I will try to push a fix that can handle I unimplemented nodes better.

Also, when you say "reinstall" do you mean just restart the add on? Like a refresh of the browser should have cleared this error. If that's not the case, do you mind posting the api logs?

SgtTacooo commented 2 years ago

No, I wish refreshing the browser fixed it. Tried stopping and starting the addon and everything. In the end I fully uninstalled it and reinstalled it. Same error messages as OP for the addon itself and when trying to access the addon via GUI. Let me know if you need more.

  /app /app
--------------------
BUILD_VERSION = v0.5.2
HOST = 0.0.0.0:8000
HASSIO_WS = 
Python 3.9.13
--------------------
[2022-08-07 02:35:09 +1000] [7] [INFO] Running on http://0.0.0.0:8000 (CTRL + C to quit)
INFO:hypercorn.error:Running on http://0.0.0.0:8000 (CTRL + C to quit)
INFO:src.api.routes.socket:Websocket closed.
INFO:src.ws_redirect:Closing socket...
INFO:src.ws_redirect:Closed socket
INFO:src.api.routes.socket:Websocket closed.
INFO:src.ws_redirect:Closing socket...
INFO:src.ws_redirect:Closed socket
INFO:src.api.routes.socket:Websocket closed.
INFO:src.ws_redirect:Closing socket...
INFO:src.ws_redirect:Closed socket
INFO:src.api.routes.socket:Websocket closed.
INFO:src.ws_redirect:Closing socket...
INFO:src.ws_redirect:Closed socket
INFO:src.api.routes.socket:Websocket closed.
INFO:src.ws_redirect:Closing socket...
INFO:src.ws_redirect:Closed socket
asosnovsky commented 2 years ago

@SgtTacooo i think it might be the cookies... next time it happens, can you clear cookies first?

SgtTacooo commented 2 years ago

Luckily I left the second install broken after testing to confirm. Yep, it's cookies causing that to reoccur. Clearing them (or just the faulty one) fixes the issue (until opening another automation that contains a scene). Checked a few random automations that didn't have scenes in them - all worked fine.

asosnovsky commented 2 years ago

Cool. I got a very clear idea on how to fix this now. Just need to find the time to sit and do this. Will likely happen Monday night. Got a busy weekend :(

asosnovsky commented 2 years ago

ok, so a fix for this is planned for the next release (which should happen later tonight)

asosnovsky commented 2 years ago

Just made a new release that should fix this issue! Let me know if this works for you, and close this if it does :)

SgtTacooo commented 2 years ago

Yep, confirmed able to load up the scene-based automations now. Thanks and good work on the fix.

However, this brings up two other issues which I may as well report on. Let me know if you want to open new issues for these. "Sun" is not a known trigger type, and it fails to identify activating a scene as a subtype.

asosnovsky commented 2 years ago

Support for sun and scene is already covered in other issues. They have been on mind to do for a while.

https://github.com/asosnovsky/Shortumation/issues/133

https://github.com/asosnovsky/Shortumation/issues/130

blathers123 commented 2 years ago

Man you guys are quick. Solved my issue. Nice job! And thanks!