Setpoint widget in a floorplan

For heating/cooling related questions in Domoticz

Moderator: leecollings

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

Setpoint widget in a floorplan

Post by CarlosDom »

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 0:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by sangve »

Same problem here! :O
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Setpoint widget in a floorplan

Post by Egregius »

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


Image

https://egregius.be/2016/php-floorplan- ... reenshots/
CarlosDom
Posts: 5
Joined: Sunday 23 October 2016 15:44
Target OS: Linux
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by CarlosDom »

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: 5
Joined: Sunday 23 October 2016 15:44
Target OS: Linux
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by CarlosDom »

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: 12
Joined: Sunday 18 September 2016 18:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Oxford
Contact:

Re: Setpoint widget in a floorplan

Post by StratosHF »

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: 12
Joined: Sunday 18 September 2016 18:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Oxford
Contact:

Re: Setpoint widget in a floorplan

Post by StratosHF »

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 / ODroid
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by thibaultlemaitre »

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: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Setpoint widget in a floorplan

Post by Dnpwwo »

@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: 12
Joined: Sunday 18 September 2016 18:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Oxford
Contact:

Re: Setpoint widget in a floorplan

Post by StratosHF »

Dnpwwo, thanks for the information, I'll give it a go.
Stanislaw
Posts: 5
Joined: Wednesday 28 February 2018 7:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by Stanislaw »

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 4254 times
wewa
Posts: 14
Joined: Saturday 11 May 2019 10:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: Setpoint widget in a floorplan

Post by wewa »

[PUMP]

I would need/prefer the same solution as mentioned by CarlosDom.
CarlosDom wrote: 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
Is ther any solution available so far?
gryzli133
Posts: 14
Joined: Wednesday 23 August 2017 22:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by gryzli133 »

Any progress? Is there a chance to add setpoint widget instead of Log as standard option for thermostat?
stlsparky
Posts: 9
Joined: Thursday 02 June 2016 1:12
Target OS: Linux
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by stlsparky »

For sure, as Egregius has stated, the solution is in his pass2php solution. I have been wanting the same ability to modify the floorplan for 2 years, and his solution was the only one that works. But make no mistake, and 2 reloads later, that solution took over a week and I ended up abandoning the whole process. I had new hope as there was a how-to script floating out there, so I gave it another try a few months ago, but it is dated and installed 2 webservers, etc. I am a noob, and the solution is super cool, but sadly, way TOO involved for a non-programmer. I would love for a renewed interest in his project or maybe a step-by-step install script or git, but it appears the process is too personalized for that. As an example, there are over 10 pages of only the install issues from following the latest script. Then you must master things called cron jobs, too, which use different variables, and that's where I gave up on Pass2php! I want soooo much for this to be a usable solution, so it really makes me frustrated. :(

His solution is perfect, since domoticz floorplan isn't so modifiable out-of-the-box. :cry:

If anyone does get this to work, would you please post the process to help us new users who want to take it to the next level?

And Gizmocuz stated in a post that domoticz natively handles php, so does that mean that pass2php isn't fully needed? Is there a way to modify the floorplan using that suggestion? If so, then how? Or when would one need pass2php then? So many questions and so little time!

Thanks for listening to my rant, guys!
gryzli133
Posts: 14
Joined: Wednesday 23 August 2017 22:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by gryzli133 »

Are there any chances that this feature could be available? With more then 200+ devices I cannot control my smart house other way than from floor plan. It would be even enough to have long click for changing setpoint (like with dimmer).
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Setpoint widget in a floorplan

Post by waltervl »

Dnpwwo wrote: Thursday 18 January 2018 15: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
Yes, I figured it out!
Change above Setpoint function in www/js/domoticzdevices.js in

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');
        this.imagetext = "Set Temp";
        this.controlable = true;
        this.onClick = 'ShowSetpointPopup(' + event + ', ' + this.index + ', ' + this.protected + ' , "' + this.data + '");';
    }
}
SetPoint.inheritsFrom(TemperatureSensor);
I only added 3 lines after the while statements

Edit: refresh your browser cache with CTRL-F5.

Edit: Screenshot as proof ;-)
Screenshot from 2021-01-13 22-12-39.png
Screenshot from 2021-01-13 22-12-39.png (80.76 KiB) Viewed 1504 times
Last edited by waltervl on Thursday 14 January 2021 12:04, edited 1 time in total.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
eleutscher
Posts: 22
Joined: Thursday 15 November 2018 11:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Setpoint widget in a floorplan

Post by eleutscher »

I added the 3 lines, restarted Domoticz but do not get the Setpoint option in my floorplan. I am on Domoticz 2020.2 (build 12393)
Am I missing something?
Zigbee, KAKU, Hue, Google, Honeywell, MotionEye, Telegram, Tasmota, Shelly, IFTTT, etc
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Setpoint widget in a floorplan

Post by waltervl »

You have to refresh the javascripts in your browser with CTRL-F5.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Setpoint widget in a floorplan

Post by kiddigital »

I have tried the suggestion as well and it seems to work, but there are also some small (UI) issues with it when using custom Icons.

At the moment I am trying to fix these issues and I will create a Pull Request on Github for it in the coming day(s).
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Setpoint widget in a floorplan

Post by waltervl »

kiddigital wrote: Thursday 14 January 2021 12:16 At the moment I am trying to fix these issues and I will create a Pull Request on Github for it in the coming day(s).
Thank you, I was hoping someone would fix this in the source code.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest