Need help with ghost thermostat

To do what you say is not better to put a switch with which to select the source of the data?

well the setpoint comes from the stat if changed, if left alone then it comes from schedule input. I use a separate switch at the moment with the nest stat, mainly to show the "mode" but also to toggle back to auto.

If I can select auto from the stat there there is no need for the switch, so it will look neater :wink:

First and foremost, thanks @ghostmaster75 Pier for taking time to modify the node.
is the newest version here?
https://flows.nodered.org/flow/9ca3a19e0e2ff606bd64f1e73a2191eb
or is updated on github?
I want to make sure I get the correct one.
Cheers,
Billy

So I have them installed on 3 vessels an they work great except for when I set them on my laptop.
and then I'm away from brewery and I open up dashboard on cell phone. they are not set properly.
and I have reset them. Am I doing something wrong or is that just how these are supposed to work?
@ghostmaster75 please let me know if i missed something. here is a copy of my flow for one.
ghostflow.json (34.3 KB)

Yes I agree. It would be better to avoid using a separate switch if possible.

@9toejack you need to store your values in the globals variables.
keep in mind that tab data is ephemeral and is lost when you switch tabs, or open the same application from multiple devices. To keep them you have to save them in some global variables (there are also some flow variables).
In the flow that I have attached you I have added 3 knots
1 which saves the values ​​of the thermostat variables in global variables and 2 which restores the values ​​when you open the tab from any device so as not to lose the settings.
To better manage your project you should use these to open and close the valves or check what you need

storing variable node
immagine

get variables nodes

flow.json (42.5 KB)

1 Like

@Paul-Reed @smcgann99
adding a new "maual" mode would imply that I would have to ignore any input data regarding the target mode or temperature, but if I do so I would not be able to manage the thermostat so that it can be "synchronized" across multiple devices. In fact, as I explained in my previous answer, to keep the information usable it is necessary to save it in global (or flow) variables and then ignite it in the thermostat in order not to lose the information.

Not really I already handle the logic outside of the nest stat, and feed back what is needed, its just that it cannot display the auto / manual state.

I will have a play with your code and see if I can bend it to my will :wink:

1 Like

here i've added a "auto" mode
if you want add (or remove) modes just edit this variable:

and add (or remove) mode in the modeNames array.

you can change icons with fontawesome 4 icons (unicode code)

for example to use a gear icon use \uf013 code (\u prefix with f013 unicode code)

script.txt (25.4 KB)

image image

This should do the trick :wink:

 var properties = {
            radius: options.diameter / 2,
            modes: [{
                    label: "heating",
                    icon: "\uf06d",
                    color: "orange"
                }, {
                    label: 'cooling',
                    icon: "\uf2dc",
                    color: "rgb(81,170,214)"
                }, {
                    label: 'auto',
                    icon: "\uf013",
                    color: "rgb(137,196,57)"
                }, {
                    label: 'user',
                    icon: "\uf007",
                    color: "rgb(236,236,26)"
                }, {
                    label: "off",
                    icon: "\uf011",
                    color: "rgb(230,0,0)"
                }
                /*, {
				label: 'away',
				icon: "\uf1ce",
				color: "gray"
			} */
            ],
            modeNames: ["heating", "cooling", "auto", "user","off"],
            swtitchStates: ["heating", "cooling", "off"]
function chkSwitchState() {
            console.log("chkSwitchState");
            var switchState = state.switch_state;
            switch (state.mode) {
                case 0:
                    switchState = state.ambient_temperature < state.target_temperature ? 'heating' : 'off';
                    break;
                case 1:
                    switchState = state.ambient_temperature > state.target_temperature ? 'cooling' : 'off';
                    break;
                case 2:
                    switchState = state.ambient_temperature < state.target_temperature ? 'heating' : 'off'; //auto
                    break;
                case 3:
                    switchState = state.ambient_temperature < state.target_temperature ? 'heating' : 'off'; //user
                    break;

                default:
                    switchState = 'off';
            };

            ledRingGradientColorIn.setAttribute('stop-color', options.ledColors[state.switch_state]);
1 Like

@ghostmaster75
Ok thanks for fast response Pier,
However, I set that up and still have an issue.
I can pull it up on computer and it works fine.
Then when i walk away, and want to check status on cell phone.
I get temp showing 200 and set is at 0 again and its set to Off.

I think i need to pause for a little bit , I really need to understand how its put together.
Which means, I need to learn more about Ui template node and how things make it work.
I did see this thread where @hotNipi nudged someone into learning making there own ui template. I think in order to not rely on others, I need to rely on myself more and learn it the right way.(step by step)
here is the thread lots of good useful info here.

Last try.... add an inject node to "Ghet data from Globals" in parallel at "ui contol" and enable "inject once ofter 0.1 seconds" in their properties
immagine

@9toejack try this (re add display node)

flow.json (42.8 KB)

I'm transit with wife, I'll be back in 2 hours, and I try this.

Right now I have flow disabled so I don't have an issue with fermenters.

Thanks again Pier!

I seem to have found a couple of undocumented features :smiley:

If I send a payload like this -

payload: object
ambient_temperature: 20.6
target_temperature: 12
mode: "user"
away: "false"

Nothing happens with the display until I send it again. If I send 2 different payloads the 2nd message causes the 1st msg to be displayed :wink:

The input msg accepts numbers but if I change via gui the output is a string -

Can this be changed to a number ?

object
topic: "changed_state"
payload: object
ambient_temperature: 20.7
target_temperature: "19.5"
mode "user"
switch_state: "off"
away: false

EDIT

I had to add a trigger node on the output to only send latest msg after 2 second delay to stop it spamming my flow, also had to delete msg.socketid so that updates go to stats on all browser sessions.

You might consider adding these functions in to the template ?

There also seem to be some odd rounding errors eg

target temp of 20.1 and 20.2 is shown as 20.1
target temp of 20.3 and 20.4 is shown as 20.3
target temp of 20.5 is shown as 20.5
target temp of 20.6 and 20.7 is shown as 20.6
target temp of 20.8 and 20.9 is shown as 20.8

EDIT 2

Really sorry but I found another issue (may be related to above?)

If I have the same stat visible on multiple browsers, and adjust the setpoint so that the LED ring lights up on the browser I’m using, the other stats do not light up.

The change of setpoint is updated on each browser(after I send 2x message, without socket.id) but it requires a 3rd message to get the other browsers to light the ring up.

So I now have 2 trigger nodes set to repeat an incoming message 3 times at 500ms intervals, in order to get the stats to be responsive to changes.

Happy to help with beta testing :wink:

@smcgann99 thankyou for your beta testing :slight_smile:

i don't understand why you have so much problems with multdevices views.
This is what's append to my flow (2 devices 2 kind of different browser)

and in attachment are my simple flow to manage it.
myflow.json (38.7 KB)

ill try to understand what are de causes of your problems

Looks like your videos didn't upload.

Let me know if you need more information to debug.

Wow , Ok so going over it and over it. I was still having problems.
However, I walked away and came back to it. I missed the flow that you had attached to the ui-control node sample that you sent me. I had just changed my msg. to global instead of flow.
It is now working great. It takes a few moments to catch up on other device but it works good now.
I have another thought or question however.
attached is my flow and obviously I have a few temp gauges here. one is just visual page that I can set on a monitor somewhere in brewery.
My thought is, I have my dropdown UI to select specific temps.
Can I also use that to change the set in your Ui node?
Is it as simple as changing the topic on the dropdown menu?

I did a search for this in the ui-template (ghostthermostat)node and didn't see this there. Am I supposed to remove that from a different node?

I do apologize, I am still very new, I'm learning but still wet behind the ears.

FYI , It is working good now.
just need to find a quicker way of selecting temp target . here is a pick of my computer at home and I'm logged into Computer at brewery at same time


(using teamviewer)