Smartly inject not working in 2.3.3 (Now working in 2.3.4?)

@TechMedX said that he would do some looking for us to see if there is anyone still around who knows enough about the code to help resolve the issues. No promises yet...and very nice of him to try to help. :wink:

4 Likes

I want to take a minute to thank everyone that has supported smartly over the years. When my friend @spelcheck started this project he had one simple vision in mind.

"Make it (HE) prettier and more 'marketable', hubitat sales will increase, hubitat will hire more developers that fix all the things, smartly ends up being unnecessary."

While this project may have been..., misdirected, as a personal friend to the original dev I wanted to post an "un-official" end to this chapter of smartly. The official announcement will be linked in a mirrored post. If you've followed smartly you know where it is.

IMHO smartly did accomplish @spelcheck's dream of making HE dashboards prettier, and that functionality still remains. There are no plans to remove the smartly transmogrifier website (credit @danabw ), or any of the hosted icons and such that make its main objective accomplishable.

However in closing, there will be no future development, or patches to smartly in the foreseeable future. I've never claimed to be a dev; just a friend, and faithful minion to a very talented one, that unfortunately, is no longer directly available. If there is a dev willing and able to continue this project, my simple services, and connections are always available.

again, Thanks for supporting smartly!!

:heart:

image

:bowing_man::bowing_woman:

10 Likes

Very well put, and completely understandable.

Thanks for everything you did to help things along. Always appreciated.

2 Likes

I use Smartly alot and I figured that this would not be solved, understandably, by the other team. So I poked around a bit focusing on why the device gets stuck on 'Loading Layout' (because now you can't even delete that device). While it may be a red herring I noticed that it tries and fails to load a device page with '/layout' as a suffix (this is hardcoded in the device code as I'm sure you've seen). i.e. http:///device/edit/407/layout. This now gets a 404 error, I would've assumed that this worked OK in Pre 2.3.3 versions. Maybe HE changed a path/link name?

1 Like

EDIT, actually I might be talking about something different, now that I read your post a little closer... There is also a layout call for the dashboard in the JS file. I expect it is a different thing...

I've literally been looking at it for the last 3 hours :slight_smile: And I noticed something similar, a 401 at the beginning when loading the dashboard, which doesn't appear when opening dashboards without the injector. But this doesn't show up when clicking Save in Smartly.

The best I can tell is that the layout JSON is constructed successfully, it is just when it goes to try and save it that it fails. Might not be a huge leap from where we were already, but at least I have got to the point of understanding that I don't think there is a problem with it interrogating the 2.3.3 dashboard structure, just when it tries to save. But it's very hard (for me) to follow the sequence of steps through the code, so am not sure how much further I will be able to get.

I did also try a legacy URL, wondering if it was a problem with the HTTP request trying to interrogate the URL parameters for the window, but that had the same issue.... grrr....

1 Like

I get the same thing, but I suspect that is probably ok. It may be to do with the JS in the attribute you add to the dashboard, the edit page is trying to call a URL for the device that it would normally call when you open a dashboard, taking the URL of the page you are on and then adding some extras to the URL to get the layout for the dashboard, which is not a thing for a device.

If you want to remove the device, on the devices page (the listing of devices), clicking the tickbox next to the Smartly injector device to disable it, then open the device and I think you should be able to remove it that way.

Oh, yea, thanks I forgot about the extra hidden/unselected columns on the device page, that worked.

I don't recall the legacy device page 'locking up' like that so that's what directed my initial look. I'm nowhere near a developer for this type of code (decades of PLC/HMI) so while I can sort of follow code, the stuff Markus wrote is way, way beyond me. But, I agree with you, the symptoms point to a file save error which then points to location/permission issue of some sort. That's why when I saw the 404Error it caught my. eye and wanted to mention it. Hopefully something can be found.

Could the code be edited to allow the finished JSON to be saved via dialog box to the computer making the edits, or HE's file manger? From there one could manually move/copy paste the final JSON output. Extra steps I know, but better than not working at all, if possible.

On another note, I want to be sure everyone that uses smartly knows the "pro" version is available for smartly 2.1. It will not fix the current issue, but can be useful if you don't run the smartly defaults.

smartly 2.1.0 pro - brings back the update options that "instead of clobbering any customized dashboard settings or tile colors, choose what you'd like to update."

2 Likes

Yes, that would be achievable. Good idea.

2 Likes

I'd also like to extend my thanks to all those responsible for the Smartly project. This kick-started a lot of my interest in modifying dashboards and producing tools to make that easier.

With the recent issue reported with the Drag and Drop feature not working post platform version 2.3.3.x, I have modified the Javascript file for the Drag and Drop feature of Smartly, which will now copy the updated layout JSON to the clipboard when you click the Save (disk) icon. This text can then be manually pasted into the Layout section of the Advanced dashboard Settings.

I have spoken with Markus and he was happy for me to maintain this feature, suggesting I setup my own copy under a separate repository, which I have done. I still need to do some more housekeeping like bringing the device driver across and setting it up for HPM use, so for now you will need to manually download the file to your PC from the link below, then upload it to your HE hub via File Manager. You can then open / refresh your dashboard to start using the updated process.

https://raw.githubusercontent.com/sburke781/Smartly-Drag-And-Drop/master/0f211437-fff7-592d-bd7d-4c0524cfeeb7-smartly.js

7 Likes

Great work!

Sorry, as usual I'm a little confused.

So we just upload that onto our hub using file manager, we don't need to do anything to create a new smartly device?

1 Like

Thanks.

That is correct, just upload the JS file via File Manager and then refresh / open your dashboard. The file name is the same, so the device will find it.

I have edited the instructions slightly, hopefully it will be a little clearer. I still need to work out the process for people to get the updated file in a more automated way, I'm sure there was something built in, I just haven't had the time to find it.

Thanks...save the contents to a text file called smartly.js, then upload to hub.

You should save it with whatever name it has on your HE hub, that way when you upload it, the copy on your hub will be overwritten. The name of the file I had was the same as the one I posted earlier, not sure if that is different for other users or not....?

1 Like

I'm somehow screwing this up...

FWIW, the name on the file you posted the link to is the same as the name of the exising smartly.js file that was already on my hub:

  • 0f211437-fff7-592d-bd7d-4c0524cfeeb7-smartly.js

I first tried saving/uploading a javascript file from Notepad++, and also saved a text file from Windows Notepad.

Opened and refreshed (green check-mark) a dashboard that is using smartly inject.

In both cases (javascript file from Notepad++ and text file from notepad) when I click on the Smartly paw icon to go into smartly edit mode in the dashboard, my dashboard goes completely blank - no tiles, no smartly or Smartly/HE dasboard icons:

What am I doing wrong this time? :wink:

Hmmm... That's not what I intended as a "fix"... let me mull it over.... And actually test the file I provided :wink:

1 Like

Oh no, don't test it! That will ruin all the fun!! :wink:

1 Like

Hmmm... At this stage I can only quote the "it works for me" response.... I'll look over your post a little more...

1 Like

Maybe upload the actual file you're creating from the raw code?

I'm doing a simple copy/paste from the raw into Notepad++ and then saving the file as:
image

That's what I have done, copy-paste from Git link I posted into Text editor of preference (acknowledging potential of CR/LF issues...., unlikely in your case, I hope...), saving as the same file name into, let's say, your Documents folder, then uploading this via File Manager.