Selector problem

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
gnomosg
Posts: 6
Joined: Sunday 05 February 2017 14:35
Target OS: Raspberry Pi
Domoticz version: v3.5877
Contact:

Selector problem

Post by gnomosg » Wednesday 01 August 2018 19:36

Hi all,

I have problem with selector switch after upgrade to last stable.
Linux raspberrypi 4.14.50+ #1122 Tue Jun 19 12:21:21 BST 2018 armv6l GNU/Linux
Domoticz:
Version: 4.9700
Build Hash: a3a45906
Compile Date: 2018-06-23 16:24:51
dzVents Version: 2.4.6
Python Version: 3.4.4 (default, Apr 17 2016, 16:02:33) [GCC 5.3.1 20160409]

I has some problem with view of selector switch on mobile device web browser - the are not visible, switches "below" selector was not displayed too.
I try to investigate it on the forum and clear browser cache (via chrome://appcache-internals) - then selector switches disappear totally on the PC web browser also (chrome, firefox) - and about half of normal switches too... :cry:

in firefox I see error in console:
ReferenceError: b64DecodeUnicode is not defined DashboardController.js:67:5

Has anybody know solution for proper displaying selector switches?

Thanks in advance
gnomosg

01ste02
Posts: 1
Joined: Monday 06 August 2018 10:02
Target OS: Windows
Domoticz version: 4.9700
Location: Lund, Sweden
Contact:

Re: Selector problem

Post by 01ste02 » Monday 06 August 2018 10:15

Hi!

I had the same problem as you, and I thought that I should share the solution that I found.

Since b64DecodeUnicode is not defined, I simply added the function to the LightController.js (in my case, but I suspect that it will work no matter what .js file you put it in) I added the following code on line five of LightController.js:

Code: Select all

b64DecodeUnicode = function b64DecodeUnicode(str) {
			return decodeURIComponent(atob(str).split('').map(function(c) {
			return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
			}).join(''));
		}
Then I restarted the Domoticz system, and voilá!

Hope this fixes your problem!
Oskar

gnomosg
Posts: 6
Joined: Sunday 05 February 2017 14:35
Target OS: Raspberry Pi
Domoticz version: v3.5877
Contact:

Re: Selector problem

Post by gnomosg » Tuesday 07 August 2018 23:31

Thanks for your help.
I investigate a little and found 2 files inside "domoticz/www/js" catalog:
"domoticz.js" and "domoticz.js.gz"
First one has function "b64DecodeUnicode" defined inside, but the second not!
Probably it was old file which was not removed during upgrade process, I think.
The same situation was with 3-4 another files.
After removing *.js.gz files web page works good :)
Check this :)

Thanks again Oskar :)
gnomosg

SweetPants
Posts: 2291
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.10069
Location: The Netherlands
Contact:

Re: Selector problem

Post by SweetPants » Friday 10 August 2018 14:08

You should delete domoticz.js.gz from www/js folder if domoticz.js is present
Ubuntu 16.04.5 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (from source)

Post Reply

Who is online

Users browsing this forum: Opus and 4 guests