Maximising Home Aut...
 
Notifications
Clear all

Maximising Home Automation: Integrating Octopus Energy & More

17 Posts
4 Users
9 Reactions
963 Views
Transparent
(@transparent)
Illustrious Member Moderator
Joined: 4 years ago
Posts: 2785
 

Posted by: @batpred

So it is important to be transparent. 

Quite.

I am being Transparent!


Save energy... recycle electrons!


   
😂
1
ReplyQuote
Majordennisbloodnok
(@majordennisbloodnok)
Famed Member Moderator
Joined: 4 years ago
Posts: 1197
Topic starter  

Posted by: @batpred

...

With all due respect, there is no need to make new definitions for these simple terms. 

TCP/IP is a set of protocols that broadly fits into layers 2-4s. 

ethernet covers a set of protocols that map to layers 1-2.

...

I understand what you're trying to say but the above is not accurate.

802.x (ethernet, wifi, token ring etc.) are technical standards. Although a "protocol" in the grammatical sense is a "set of standards", in networking these technical standards covering layers 1 and 2 of the OSI model are not referred to as protocols.

TCP/IP is a network protocol that happens to operate low down on the OSI model - layers 3 and 4. However, there are other (generally obsolete) network protocols that were designed to operate in higher layers (IPX/SPX and NetBEUI for example). Irrespective, these are standards defining the packets of data transmitted over the physical and datalink layers, and so are communications protocols rather than technical standards for the physical network.

As a result, I'm not making new definitions; I'm sticking to the commonly understood and accepted terminology of IT networking. If I didn't, it would get very confusing very quickly.

Posted by: @batpred

...

This is still a good reference model. When (inter)networking started being implemented and deployed, I can confirm the OSI model was very useful. 

...

I had no intention of suggesting anything else. It's not just useful; it is the de facto model and therefore a standard reference in the industry.

Posted by: @batpred

...

A Home Assistant box with all its connections is usually a gateway in that OSI terminology, that spans layers 1-4. 

Um, no.

The physical computer that Home Assistant is installed on will contain one or more network cards that allow connection to the network. When Home Assistant is installed (ignoring variations for simplicity) HAOS (Home Assistant Operating System) goes onto that box and the rest of Home Assistant sits on top.

Bluntly, Home Assistant is purely working at the application layer - layer 7. The operating system (HAOS) interacts with the computer and with Home Assistant and so is providing the presentation and then session layer to the application. It could also be argued that the presentation layer is fulfilled by Home Assistant rather than the operating system but even then it certainly doesn't reach down below layer 6.

Any communication with Home Assistant (including for it to act as a gateway) will require any communication to span the whole 7 layers.

 

 


105 m2 bungalow in South East England
Mitsubishi Ecodan 8.5 kW air source heat pump
18 x 360W solar panels
1 x 6 kW GroWatt battery and SPH5000 inverter
1 x Myenergi Zappi
1 x VW ID3
Raised beds for home-grown veg and chickens for eggs

"Semper in excretia; sumus solum profundum variat"


   
ReplyQuote
Transparent
(@transparent)
Illustrious Member Moderator
Joined: 4 years ago
Posts: 2785
 

Haven't reached the stage where one of you is going to post a generic diagram of the 7-level OSI model?

There will be others considering HA in future, who arrive in months to come and won't understand this important point.


Save energy... recycle electrons!


   
👍
1
ReplyQuote



Majordennisbloodnok
(@majordennisbloodnok)
Famed Member Moderator
Joined: 4 years ago
Posts: 1197
Topic starter  

Of course, @transparent; you're right. In fact, it's a bit of a red herring rather than an important point but since it has been mentioned I'll explain so people can see why it's not relevant.

In IT, we love our compartmentalising, and we will often do so logically with what are termed abstraction layers. When we try to print something, the application we're printing from isn't talking with the printer; the printer is being controlled by the operating syste and our application just dumps the print request on the operating system and says "go sort it". In that sense, the application is abstracted from anything to do with printing.

In the context of networking, the whole computer networking process is described by seven abstracted layers:

  1. The physical layer. This is all about actually moving the data between devices.
  2. The datalink layer. This is all about preparing data for transmission. Physical addressing (such as the MAC address) is dealt with at this layer.
  3. The network layer. This is about logical addressing; working out the best path to reach a particular destination adress, for instance.
  4. The transport layer. Breaking the data to be sent into segments - packets - ready to be sent in such a way that the recipient can package it all back together again.
  5. The session layer. This is about setting up, managing and ending logical sessions between network resources. If you ever get to see an Internet error that a web site is unreachable, it's because a check at this layer has found the destination isn't available.
  6. The presentation layer. This takes the data to be sent and translates it into a format that can be sent over the network; encrypting and compressing, for example.
  7. The application layer. This is the layer that provides a user interface for sending and receiving the data.

 

So when you want Home Assistant to, for instance, query the Octopus API, the request coming from HA (the application) is repackaged by the presentation layer, a session is esatablished with Octopus' server at the session layer, the data is broken into packets at the transport layer, the route sorted out at the network layer, the physical device address worked out at the datalink layer and the packet is actually transmitted at the physical layer. Octopus' server then receives it at the physical layer, works out where the packet physically came from at the datalink layer and the data steadily works back up the same stack until it's presented to the application layer at Octopus' end. Octopus' application (Kraken) will understand what that request is intended to achieve, go get the data from Octopus' database and then transmit the results back to your Home Assistant box following the same process of working down the network stack to physically send the data, whereby your HA box, as recipient, similarly starts at the physical layer and works up the stack again until the results as intelligible data are handed to your Home Assistant instance.

Phew.

How a network is used - at least to this level of detail - is utterly irrelevant to most people. The reason it got mentioned at all was because I was oversimplifying on another explanation and talked about "ethernet over wifi", which @batpred questioned by introducing the OSI model. The point I was trying to make is that most physical networks support "talking" over what might be thought of as a party line, whereby if two devices are talking at the same time no-one can understand the conversation. In network terms, this is termed a collision, the transmitted packet is lost and the sender needs to resend. This somewhat hit and miss process means lost time and so slows down what might otherwise be a fast network. Although ethernet is just as bad as wifi for this, modern ethernet networks are based around switches which isolate each client so that only traffic to or from a client is allowed into that "bubble", so network performance is largely the same as if there were only two computers directly connected to each other. Wifi technology has got better but it still has to share a restricted bandwidth with multiple clients and so will degrade in performance as more clients connect. That, along with the inherent possibility of lost wifi connections, is why it is better to use a physical cabled connection whenever possible and leave wifi for times when cables can't be used (your kit doesn't have a network socket or you need the mobility).

Here endeth the rather involved lesson.

Oh, and just to be clear, @batpred is correct that the IP protocol does operate on top of wifi, and also on top of ethernet. As I said, in trying to simplify I overdid it and ended up sending us down an unnecessary rabbit hole.


105 m2 bungalow in South East England
Mitsubishi Ecodan 8.5 kW air source heat pump
18 x 360W solar panels
1 x 6 kW GroWatt battery and SPH5000 inverter
1 x Myenergi Zappi
1 x VW ID3
Raised beds for home-grown veg and chickens for eggs

"Semper in excretia; sumus solum profundum variat"


   
ReplyQuote
(@batpred)
Honorable Member Member
Joined: 11 months ago
Posts: 302
 

Posted by: @majordennisbloodnok

How a network is used - at least to this level of detail - is utterly irrelevant to most people. The reason it got mentioned at all was because I was oversimplifying on another explanation and talked about "ethernet over wifi", which @batpred questioned by introducing the OSI model. The point I was trying to make is that most physical networks support "talking" over what might be thought of as a party line, whereby if two devices are talking at the same time no-one can understand the conversation.

Thank you and I agree most people can stay clear of networking, specially with matter and thread protocols. The OSI model helps me when the odd manufacturer´s marketing confuses the concepts!

And yes, the HA box going above layer 4. But the OSI model is a stretch to apply above layer 4, it was mainly designed around the modem terminal session use case. 

Reliability and automation of all these things is particularly important to me.

So right now I am getting into some involved discussions with the Solis engineers on how Solis AI works from an operational point of view... Since the answers are still in English, there will be many more iterations on it. 😀 I can only hope the European manufacturers are beating this. 

 


This post was modified 3 weeks ago by Batpred

16kWh Seplos Fogstar battery; 8kW Solis S6-EH1P8K-L-PLUS hybrid inverter; Ohme Home Pro EV charger; 100Amp head, HA lab on mini PC


   
ReplyQuote
Page 2 / 2



Share:

Join Us!

Latest Posts

Click to access the login or register cheese
x  Powerful Protection for WordPress, from Shield Security
This Site Is Protected By
ShieldPRO