Try new code in Docker

Hello friends,
I am running appdaemon/hadashboard in docker and now I want to try to change a widget JavaScript code and try it in my hadashboard.

Can anyone help me out with this? I don’t know how.

I change the code inside the docker container and restart it. But afterwards I don’t see my changes in hadashboard.

Any help is appreciated.

BR,
Christian

you shouldnt try to change the widgets or any part of the original code.

you can create custom widgets or custom skins.

copy the original widget to the custom widgets directory, change the names (on several places and then try out some changes.

for more details read the docs.

To make specific file change you may mount file or folder including file then edit desired file.

This is same way config file is managed. It is mounted and stored on host remaining persistent after restart container.

I am not sure how widget install so as @ReneTode mention I think documented method exist that allows this customization

Thank you for your replys but my problem persists.
Even if I create a custom widget as with the docs it says “Unable to find widget type ‘newiframe’”

Anyone here created a custom widget in docker?

did you create all the files?

a subdir with the base widget, with css, html and js files
And a yaml file called newiframe??

Thank you!

After your post I found that I had put the files in the widget directory instead of the custom_widgets directory.

1 Like

@ReneTode Maybe I’ve misunderstood something. Have “custom_widgets” directory created in same location level as appdaemon.yaml. Created “basew2” folder within “custom_widgets”. “basew2” contains the 3 files, basew2.css, basew2.html, basew2.js. In .dash file added widget as widget_type: w2, in hadashboard I get “Unable to find widget type ‘w2’”. Am I doing something wrong. All w2 files are currently just copies of the weather widget.

there is 1 thing you forgot and that is to copy the weather.yaml from the widget dir and call that w2.yaml

thats just the start.
you MUST change parts from the widget files to get it to work.
in the css, js, html and yaml files you need to replace weather with w2
in the variables.yaml from the skin you use, you need to copy and rename all variables that are there for the weather widget. (if you use the default skin you need to do that there)

after all that is done you can start to change the newly created widget.

Thanks, I had done the w2.yaml file but forgot to mention it. The key was inside the w2.yaml (changing $weather to $w2) and adding that to the skin variables.yaml file. Thanks for the assist!

dont forget that you also need to change weather to w2 in the css and in the first line from js.

Thanks, all working now!

1 Like

so now you can start showing us what great widgets you can create :wink: