What made a dashboard for a smart home
I use several dashboards where I show parameters from the smart home system.
My dashboards are made on the basis of iPads, these are quite old two iPads that can no longer do anything useful in principle, everything starts to slow down on them, and toys and just even surfing the Internet, so the only thing that can work normally on them is to open some simple website and an application can run on it without any additional graphics.
Even many programs can not be downloaded and installed on these iPads, one I have an iPad, this is an iPad 2 very old it is very many years more than 10, the second iPad, this is an iPad Air 2, which is of course newer, but it is also old.
Now there are new iPads with the same names, but these are completely different iPads and, accordingly, they have a completely different power.
Of course, the batteries of these iPads have already died, one had to replace the old one, the new one, so to speak, does not work either, in principle, it can only hold 5. The battery replacement itself is not very expensive, but this is still some intervention in the design, which probably does not reflect very well on reliability, but in general they are quite suitable for my needs.
They work in constant mode, iPads have a problem in general, they are certainly much worse in terms of some settings or manageability than, say, Android tablets. For example, iPads have a problem with adjusting the brightness, it is either automatic, which often does not fit at all and it also works quite incomprehensibly, in principle, it is certainly added very quickly in the direction of increasing, but in the direction of decreasing it happens very slowly and for example, when turning off the light in the room, it is very inconvenient, it continues to glow for a very long time.
The dashboards themselves are completely self-made, in fact it's just a web page, it's certainly not static, it is updated using special JavaScript scripts, accesses the database, reads new parameters of the necessary sensors and displays these sensors. But this happens in principle with a small delay, I made the time 2 seconds, but since I use an internal server on the local network, and not an external one, it works quite quickly, requests come quickly and do not create any load on the network.
Previously, I used to connect to an external hosting service, since the data is not stored there, and this is of course with such a frequency of request from the hosting service, the blocking mode was turned on and, accordingly, the connection between the iPad and this site was lost.
In order to display this site there are several programs, I use a special program downloaded, not all run on these versions of the operation, so I found the one that runs. These are programs that allow you to open web pages in the so-called kiosk mode, that is, it unfolds in full screen mode, and there are different options, for example, related to blocking button presses or blocking offset, but I use the lite version of such a program and, accordingly, it has some restrictions related to settings. It also turns out in the lite version that it reloads the page every hour, which on the one hand is basically convenient, the page even if it starts working incorrectly is updated every hour and after that, in case of any failures, it still continues to work again. But if the update itself turns on the white light for the entire screen and, for example, at night it is not very convenient, the entire room is illuminated.
Because of the brightness settings on iPads, you have to turn out a fairly large brightness on the device itself, it is probably higher than average, but in order not to blind it at night, I have made it so that it darkens its values in the site settings of this web page, which show its text displayed and thus at night it is displayed in the it looks quite dark in principle, in principle it can even go down to zero, that is, completely extinguish the display.
But a little bit of course is highlighted it is clear that this TFT is actually a display, and not OLED, and of course it is slightly translucent on it. There are problems related to the fact that during the long operation of the iPad, my LEDs began to burn out unevenly over several years. This is due to the fact that the information is placed on the page in rows and those rows that turned out to be dark, where the LEDs in these places they did not light up and, accordingly, they are certainly stronger when illuminated, and the LEDs that glowed constantly became dimmer and, accordingly, it becomes noticeable on some homogeneous pages if you open it just for the test.
Well, since my iPad works in the smart home dashboard display mode all the time, of course I never turn on white pages on the whole screen and this is invisible, but I had to make a small life hack that allows you to use all the LEDs evenly. I made a white border around the entire dashboard, so the iPad has to turn on all the LEDs in order to illuminate the entire screen correctly. And due to this, the LEDs, although they sit down, but they down evenly, which, in principle, based on the total brightness reserve, this is enough.
At night, my iPad turns out to shine at a very low percentage, because even if you put five percent of the total brightness there, it's very bright in the middle of the night and basically illuminates the room and interferes with sleep.
Also, in order to control the brightness, I have made special scripts that evaluate the sensor readings in the room and based on this makes a decision which brightness to make on the corresponding iPad. To do this, I use a light sensor, in one room I have a homemade one, it's just essentially a photoresistor that determines the amount of light that falls on it and then transmits the value to the smart home system. In principle, it is quite simple, it is very cheap, and it works quite stably, and it runs on batteries and I probably haven't changed the battery in this sensor for more than a year. Moreover, this sensor is combined, it also measures the temperature and humidity in the room, so in principle such a combined device is very convenient.
I also have it estimated by time of day, that is, if it is day, then accordingly I have one mode of operation and one brightness by default, if it is night, then another mode of operation and another brightness by default. You can use the value of dawn or sunset, but this is not always convenient, because twilight is quite long, and in principle you need to focus either on the end of twilight, which is usually very difficult to get from any sources. For example, information about sunrise and sunset can be obtained from the weather site. I use Open Weather and there is a parameter that can be read and determined based on this. But there is no parameter for the beginning and ending of twilight, so of course you need to do some additional calculations here.
I also made my own algorithm that simply averages when the day begins and the night begins I just take the shortest day and the longest day and distribute the increase in the time of day and the decrease in time according to some formula. And I also process the value from switches, that is, if the switch in the room is turned on, for example, general light, then the maximum brightness of the dashboard is turned on, because if it is at the minimum, for example, night mode, then it becomes invisible, or it is very poorly visible and it is no longer possible to see some small numbers from afar.
If, for example, a bedside lamp or some other specific light source is turned on, then the brightness is combined accordingly and the corresponding one is turned on. If I turn off all the lights in the room and at this moment just let's say it's night mode, then the iPad quickly switches between night and low brightness mode.
On the dashboard itself, I display mainly the parameters of smart home system sensors, mainly temperature, humidity, and the status of all sockets and switches. This is very convenient and, in principle, allows you to quickly understand what is happening in the smart home, why a certain scenario does not work or may not work.
Moreover, it is very important that I also display the last update time of this parameter. I made a certain sign. if the value is not updated for more than an hour, an exclamation mark appears. For example, if the value is not updated for more than two hours, or for example for several hours, then a question mark appears there. This is how I can see that the value has not been updated for a long time, perhaps the sensor simply does not work anymore.
Automation in a smart home should be useful and create additional comfort, but sometimes everything goes wrong… The reasons for this, and how to configure everything, see on my channel.