Setpoint widget in a floorplan

For heating/cooling related questions in Domoticz
Post Reply
CarlosDom
Posts: 4
Joined: Sunday 23 October 2016 15:44
Target OS: Linux
Domoticz version:
Contact:

Setpoint widget in a floorplan

Post by CarlosDom » Sunday 23 October 2016 16:31

Hello.

Many thanks for the great software and the great ideas you share in this forum.

This is my first post on this site. Let me go straight to my question: Does domoticz support accessing a setpoint widget from the floorplan?.

Details on my scenario are:

I am using Dummy thermostat which allows me to access a setpoint widget where I define my target temperature. This is working fine and, by default, Domoticz gives me access to the widget when I click on the thermostat icon (either from Dashboard or from utilities tab).

Domotics is also capable to show the thermostat in the floorplan but the default action when I click it is to show the graph of the setpoint value through time (no other action is possible for that icon in the floorplan). The obvious workaround is to not use floorplan and just use Dashboard or utilities tab but I am planning to have one thermostat per radiator and the number of them is large (takes time to search to get to the right icon). The Main purpose of the floorplan for my scenario was to be able to visually access the right thermostat and switches and change them from there.

Many thanks in advance for your help
Carlos

sangve
Posts: 4
Joined: Friday 02 December 2016 1:02
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by sangve » Saturday 03 December 2016 1:40

Same problem here! :O

User avatar
Egregius
Posts: 2715
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE
Contact:

Re: Setpoint widget in a floorplan

Post by Egregius » Saturday 03 December 2016 8:35

Create your own floorplan and create all the freedom of design as you like.


Image

https://egregius.be/2016/php-floorplan- ... reenshots/

CarlosDom
Posts: 4
Joined: Sunday 23 October 2016 15:44
Target OS: Linux
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by CarlosDom » Saturday 21 January 2017 2:09

Ok. I understand now, Domoticz out of the box does not allow you to access a setpoint widget from the floorplan. :-(

I understand Egregius solution will allow us to build our own floorplan and have any custom widgets we want to fit our needs. This involves coding in php and integrating it into a domoticz instance. If this is really the only way to do it I will have to go for it but it seems too much complexity for my small requirement (I don't need any special widget I just want to access an existing one from the floorplan).

What I mean is that perhaps there is a way to just change the current web link we see in a thermostat "Show Graph" into "setpoint widget". If I could just change that link, then all my requirements will be met.
I will try to explore this but if anybody has any suggestion that would be appreciated.

Thanks
Carlos

CarlosDom
Posts: 4
Joined: Sunday 23 October 2016 15:44
Target OS: Linux
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by CarlosDom » Monday 23 January 2017 2:10

Just to update on how far I got.

I see the set point widget is available in the dashboard view and I found the following code in the file "DashboardController.js"

Code: Select all

 else if ((item.Type == "Thermostat")&&(item.SubType=="SetPoint")) { 
	xhtm+='override.png" class="lcursor" onclick="ShowSetpointPopup(event, ' + item.idx + ', ShowFavorites, ' + item.Protected + ', ' + item.Data + ');" height="40" width="40"></td>\n'; 
	status=item.Data + '\u00B0 ' + $scope.config.TempSign; 
}
Similarly the set point widget is available in the utilities screen and I found the following code in "UtilityController.js"

Code: Select all

else if (((item.Type == "Thermostat")&&(item.SubType=="SetPoint"))||(item.Type == "Radiator 1")) { 
  xhtm+='override.png" class="lcursor" onclick="ShowSetpointPopup(event, ' + item.idx + ', RefreshUtilities, ' + item.Protected + ', ' + item.Data + ');" height="48" width="48" ></td>\n'; 
  status=item.Data + '\u00B0 ' + $scope.config.TempSign; 
}
On the other hand the set point widget is not available in the floorplan screen and perhaps this could explain why I could not find any similar code in the file "FloorplanController.js"

I am not totally sure I am looking at the right places so if anybody has comments, that would be appreciated.

Many thanks
Carlos

StratosHF
Posts: 23
Joined: Sunday 18 September 2016 18:33
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Oxford
Contact:

Re: Setpoint widget in a floorplan

Post by StratosHF » Wednesday 27 September 2017 22:06

I'm interested in this too, it's more useful to be able to change the thermostat set point from the floorplan icon rather than look at the history.

StratosHF
Posts: 23
Joined: Sunday 18 September 2016 18:33
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Oxford
Contact:

Re: Setpoint widget in a floorplan

Post by StratosHF » Saturday 28 October 2017 12:58

Does anyone have any advice on this? I'm slowly getting familiar with Python and Lua but this is new territory for me.

thibaultlemaitre
Posts: 2
Joined: Sunday 30 April 2017 17:10
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by thibaultlemaitre » Wednesday 17 January 2018 23:50

Hi everybody,

I'm also interested to be able to change the value of a setpoint from the roomplan view.

I don't know how to help to achieve this improvement, but the code analyzed by CarlosDom in previous post (https://www.domoticz.com/forum/viewtopi ... 28#p115677) seem to be a way to explore.

Thanks for the development of this soft.

User avatar
Dnpwwo
Posts: 736
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Setpoint widget in a floorplan

Post by Dnpwwo » Thursday 18 January 2018 16:07

@StratosHF and @thibaultlemaitre,

The code that controls the device in a floorplan is is domoticzdevices.js:

Code: Select all

function SetPoint(item) {
	if (arguments.length != 0) {
		this.parent.constructor(item);
		this.image = "images/override.png";
		if ($.isNumeric(this.data)) this.data += '\u00B0' + $.myglobals.tempsign;
		if ($.isNumeric(this.status)) this.status += '\u00B0' + $.myglobals.tempsign;
		var pattern = new RegExp('\\d\\s' + $.myglobals.tempsign + '\\b');
		while (this.data.search(pattern) > 0) this.data = this.data.setCharAt(this.data.search(pattern) + 1, '\u00B0');
		while (this.status.search(pattern) > 0) this.status = this.status.setCharAt(this.status.search(pattern) + 1, '\u00B0');
	}
}
SetPoint.inheritsFrom(TemperatureSensor);
you probably just need to add a line that overrides the default behavior of TemperatureSensors onClick (which is to show the log). Adding a line like:

Code: Select all

		this.onClick = <put code here>;
after the while statements would do the trick
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

StratosHF
Posts: 23
Joined: Sunday 18 September 2016 18:33
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Oxford
Contact:

Re: Setpoint widget in a floorplan

Post by StratosHF » Thursday 18 January 2018 16:34

Dnpwwo, thanks for the information, I'll give it a go.

Stanislaw
Posts: 5
Joined: Wednesday 28 February 2018 8:29
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by Stanislaw » Wednesday 18 April 2018 14:40

Hi,
I have the same problem here. I'm doing some changes in the domoticzdevices.js in chrome browser but I can't figure this out...
Maybe someone could help?
Attachments
Przechwytywanie.JPG
Przechwytywanie.JPG (76.56 KiB) Viewed 920 times

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests