Smart house for smart cottages (part 3) setup
One of the main problems at a smart dacha that needs to be solved is, of course, setting up remote access, it is clear that you need to connect a 4G router so that somehow the Internet transmits and put a wi-fi point so that you can distribute this Internet throughout the dacha, throughout the entire site, but of course there may be wired Internet, but in any case, even this does not guarantee that it will be remote access, because if you use some proprietary gateways, then of course they all work through the cloud and, accordingly, of course they can connect to the Internet, and then it is clear that you can get remote access through a proprietary application, and even some scenarios write small ones, or control some devices, or watch some sensors.
But if this is some server that is used and the smart home is open source, for example, as I do in a typical server, this Home Assistant is used, then of course the question arises, but how can I still connect to it, because it has of course a built - in mechanism for connecting to a remote one, but in fact this connection only works on a paid basis and, accordingly, you will need to pay, it is also not clear how to pay for this access, and, accordingly, then of course it will work, but if you do not pay for it, then everything turns out that you cannot connect remotely to Home Assistant and, accordingly, some settings, some management, watch some sensors already it won't work even through a branded app, or even through a website of some kind.
Why is this happening because first of all the server itself is of course located on a local network and now let's say even in many apartments it is impossible to get a white IP address or there are dynamic ones so that you can get some kind of white IP address and there through some service let's say DynDNS, you can at least connect to it, basically, all this is obtained for NAT is located, that is, the internal network and thus it is already impossible to connect directly from the outside and no provider will make it possible to forward some specific ports inside the network, so in fact there are few options for connecting Home Assistant if you do not pay for this paid cloud, then you can of course make VPN access, but first of all, it's not easy and you still need to use some external server in order to connect, there are special services that allow you to also make these two networks, both the country network and the home network, for example, be combined into one, and then you can of course in fact how to access the server via a local network and various equipment and devices that are located in the country, but you will still have to pay, and therefore this is also not the best solution.
Therefore, of course, you can do anything remotely, but you can't change any settings, rewrite the script already in Home Assistant.
But for simple management, of course, there are different ways to do this, that is, for example, you can simply send sensors to the Yandex smart home ecosystem, for example, and then you can go through the Yandex app and even for example you can say there from the speaker located in the apartment just turn on the light at the dacha or turn off the light at the dacha, or turn on the heating and it will work there, that is, in principle, you can even control it, and of course you can go to the Yandex application and see what values of sensors that will be displayed there, and you can control some devices accordingly, turn them on and off.
But in fact, since this will be management, you can take some kind of script and even write a simple one, if you need to automate something urgently, then you don't have to go to the dacha right away, which would probably be nice, but you can just write something quickly right in the Yandex system the solution, a quick script, try it, and then when you already have access to the Home Assistant server right in it, make all these settings in a normal way, in a normal scenario.
I still use a different mechanism for remote access, I have a separate hosting service and an external web server is deployed there and it is made so that all values from all sensors are sent there, from the smart home and, accordingly, devices are also visible there, and I can turn on and off devices and watch the sensor value, well, there I also have the opportunity to save a database of all changes in sensor values and build graphs, but this hosting is also not free, it turns out about 300 rubles a month, which is also exactly for the needs of just remote access, it will also be too much, but it solves another problem, namely storing the database and there for for many years, of course, there have already accumulated more than 30 million records of different values, it is also interesting to see what happened there five years ago, you can make some decisions based on what is happening, for example, the temperature on the street or in the house, and accordingly some scenarios are also provided in this regard.
But of course, very minimal management can be made even easier, that is, first of all, you can use a telegram bot to inform, then different messages about the triggering of different events will simply be sent, the state of sensors can be configured directly from Home Assistant with some frequency to be sent, this is in principle such a solution is also quite interesting to make it it's very simple and some information will still be received, and you can even provide some options for handlers that will also perform some actions in the north, that is, you can write a command in telegram-bot or make a menu button there and, accordingly, in the smart home, it will be changed which one is used.-then the scene is switched, the script is running, but in fact it is quite difficult to reverse the method, because you will need to provide for all the sensors to appear, and I also basically planned to do it with me, so it just automatically generates a list of all devices and if I add a new device, it is also added in Telegram bot and in principle I can also manage it.
But of course I don't use Home Assistant there to work with Telegram, I just have a script written in bash, it's not very difficult to connect in principle, it's just that there is an API through which you can get a bot in telegram get a token and then just perform different actions with one command, for example, send a value, get a value, that is, it is not difficult and of course it is possible to develop the actual management system quite well.
But by and large, if there is no direct need to manage all devices, then of course you can do without and bring out just a few typical commands, but most importantly, of course, the remote access function, this is probably just so that you can restore the entire smart home, that is, it is essentially a reboot different equipment, some of course, for example, a wi-fi router with 4G there, or some network equipment, it will probably be difficult to reboot remotely, for example, via wi-fi, because it will still turn off the power itself, but if you use a zigbee socket, for example, you can run a script there that simply turns off the power and again it will turn on, but you can still set up the automatic power-on mode on the outlet after power is applied, at least in this case it will also turn on later if suddenly the voltage turns off, the electricity is in the country, then when you turn it on again, it will load into the on mode, then all the equipment will turn on, well, this is it went wrong.
But if this is a server reboot, then of course it does not depend on the wi-fi router and you can independently install it, turn it on in a wi-fi outlet, and you can even not connect it to the smart home system, but leave it in an external application, for example, you can connect it to the Yandex system directly and directly from there simply turn it off and on again, and then the server will restart and in principle everything will be restored there and will work correctly.
Well, just in case, of course, you can also do to install an automatic switchboard electric, they are also usually wifi and there is just also possible first of all to see that some electricity consumption is in the house well, if necessary, you can also turn it off and turn everything on, the main thing is that here you can say wi-fi the router seemed to me to be de-energized, otherwise even then you probably won't be able to turn it on.
To set up the network on the site itself, for example, in different buildings, there in a bathhouse, in a garage, or somewhere else, you can also use wi-fi in principle, it is not necessary to lay wires there for various reasons, it can be expensive and difficult to do qualitatively and sometimes impossible, well, even tips there may be large wires on these wires there, from some kind of thunderstorms or some kind of interference, usually there are still transmission lines running where suburban areas are, that is, in principle, it can work quite poorly, so wireless wi-fi can be done in principle at a frequency of 2.4 GHz, it takes quite far, there exactly the entire site, it will be able to catch wi-fi on the entire site quite well, and you can place it somewhere in such a place, closer to the middle of course it will be fine, but either use some additional wi-fi points as routers that can work on wi-fi and continue to relay the signal, or you can just hold one wire to the next point and then connect them like this.
But if it is to use the zigbee network, then it is even easier, in principle, the zigbee coordinator itself and it certainly does not have a very large antenna, that is, in principle, such solutions are sold, but it is still not designed, that is, you need to specifically buy such a zigbee stick, but you can basically solve this problem to solve it differently, that is, either you can put a duplicate of some separate gateway or stick in another room, in another building, but then you will have to figure out how to integrate them in one smart home system, that is, it will not always be easy to do, but it is generally solved because it is zigbee it works in a mesh-network, that is, virtually everything, many devices that work and are powered by the network, they can of course also be routers, then you can generally just buy a stick that is flashed into the router mode exactly and then just turn it on in any usb adapter and it will actually act as a separate device and router, and it will be work on and expand this network.
Well, or you can just install some sockets there that are just smart, working on zigbee and they will act as routers, and since they have enough power, they have quite a good signal and you can put a lot of them in different places, you can also put them there specifically so that they are really needed in every building and accordingly they are they will also bring benefits, and then they really make a large coverage there, and then all sorts of sensors that run on batteries and whose power is small will already relay their signal to the smart home server through this outlet, that is, in principle, it is very reliable and it solves many problems from the point of view of if there is some kind of communication between devices and even if one socket fails, then this is not a big deal, in principle, the network itself is periodically reconfigured there and will still continue to work.
Well, you can also set up the ability to get information about the weather, of course, it is very useful at the dacha, because there you can get information about cloud cover, and whether the sun glows or does not shine, or it rains and how much precipitation has fallen, that is, in principle, it is useful in order to organize some actions there, for example, there is watering or to understand for example that there has been no precipitation for a very long time and just maybe you will need to go and water everything there manually, that is, it is also not difficult to do, it is in the Home Assistant has its own, there is a pre-installed weather informer, and it also shows the forecast for several days ahead and you can it will be used directly in triggers to develop different scenarios, but I use a different weather server, OpenWeather, but it's also not difficult to register there, you just need to create an account there, get a token to connect, and you can also add Home Assistant via the API, and in principle you will also be able to use it in different scenarios both the forecast and precipitation should be taken into account, but the only thing, what is there with the history, you will need to figure out how to store it because this server itself does not represent the history, and in fact that's why I store it there, on an external hosting, in an external database, and I can quickly view this information there, but by and large, the history is also saved in Home Assistant and you can also somehow contact her.
And the forecast is also given there for every 3 hours for 10 days, and in principle this is enough to plan some actions and come up with a scenario that will handle this.
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.