TNDisplay - Super project #2
Replies: 8 comments 2 replies
-
Hi, in my case i use following flow to control the whole lights screen The green "Filter" node just check if the current screen is "Lights" and the bottom part with blue "onChange" node updates the screen when state of any light change: in the "Compose" node i have following code to set up the screen parts depends of current lights states:
So when the current screen is “Lights” every time it is refreshed, the status of all lights is checked and the corresponding icons are displayed. In addition, the screen refreshes automatically when the status of any of the lights changes. |
Beta Was this translation helpful? Give feedback.
-
Thanks, that was helpful. I presume if we want to use only one screen/page just to control for instance 4 lights in one room the whole project has to be changed in NexionEditor, right? If so would simple removing all unused Flows from NR and made 'Lights' flow as a main one? |
Beta Was this translation helpful? Give feedback.
-
I wouldn't change the design in NextionEditor, as some pages are used in the rules to display WiFi/MQTT connection informations and the whole thing is in the display memory anyway. Whether there will be one page with four buttons or all of them according to the original design it won't make any difference in performance or speed and it will give you the possibility to change/extend the functionality of your design from the NodeRed side later. If you want to use TNDisplay only to control lights and have only one page then simply remove the “Back to menu handler”, “Initialize dummy states object” groups and all groups from the “Screens” section except the “Lights” group. In addition, in the “Lights” group, remove the “Lights?” nodes, which will be redundant in the case of only one screen and adjust what is left according to my earlier post. |
Beta Was this translation helpful? Give feedback.
-
Great, that is now more clear, is there any way to change names of the flows like Switches or Climate for our own names adjusting to the room name for instance where that button from MENU screen will go. I presume that other nodes should be then updated with that change, as so far I couldn't figure out how to change that however I did change buttons name in 'compose' node. And last one [I think ;-) ] would be possible to control brightness for instance by holding light button longer than few sec or till desired brightnes is set? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
If I understand correctly and you want the name of the room to be at the top of the screen instead of the word “Lights” then in the “Compose” node change this piece of code:
As for the brightness, holding the button longer is not implemented in this project, so you could, for example, use screen #7 which has 9 buttons and for each of the three lights use three buttons one for on/off and two for lighter/darker. Alternatively, you could make it so that when you click the icon with the selected light, the screen changes to #3 and there using the three buttons control the on/off function and the brightness. The last solution I can think of now is to divide the menu into two items and “Lights” and “Scenes” and in the "Lights" control only the On/Off function and in the "Scenes" set predefined lighting scenarios with a single click instead of changing the brightness of individual lights manually. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Sure, just double-click on the group whose name you want to change and in the newly opened window type a new one :) |
Beta Was this translation helpful? Give feedback.
-
That doesn't work in the top left corner, could that be changed only in the raw code? |
Beta Was this translation helpful? Give feedback.
-
Hey there,
Thanks for this super project, I've done all as you described with some mods for my devices in HA but just struggled to get actual state from the device (light) to get this same on the display. NR is kind of new to me and not sure if that is possilbe to implement to current flow. I mean, for instance when you turn on some light(s) by voice assistant how to get icon change to status ON in TNDisplay? Is it possible at all when display is in sleep mode but when you tap you might see that light is 'ON'.
Beta Was this translation helpful? Give feedback.
All reactions