[Solved] Limit HA Entity in MSR
-
Hi @toggledbits
I'm new to HA, and I just finished integrating it with MSR. It was very easy to configure and interact between platforms.
However, one thing that bothered me is that all HA Entities were sent to MSR, and in my opinion, this generates unnecessary integration overload. I searched the manual and here in the forum for a way to delete everything I don't want to come to MSR, such as all this information from Sun *.
Is it possible to configure this, as we already do with Vera, for example? And if possible, would using a wildcard such as hass>sun* automatically exclude all other entities of this type?
Thanks.
-
Hi @toggledbits
I'm new to HA, and I just finished integrating it with MSR. It was very easy to configure and interact between platforms.
However, one thing that bothered me is that all HA Entities were sent to MSR, and in my opinion, this generates unnecessary integration overload. I searched the manual and here in the forum for a way to delete everything I don't want to come to MSR, such as all this information from Sun *.
Is it possible to configure this, as we already do with Vera, for example? And if possible, would using a wildcard such as hass>sun* automatically exclude all other entities of this type?
Thanks.
@wmarcolin said in Limit HA Entity in MSR:
in my opinion, this generates unnecessary integration overload
What's your basis for that opinion? On the HA side, all entities and events are published for everything on HAs websocket API, without filtering, so the data is coming to Reactor regardless. On the Reactor side, even with thousands of entities in my home environment, the load overall is low to Reactor and its host (load average <0.1 at 1, 5, and 15 minute measurement periods on an RPi 4), and HassController is only a fraction of that total load.
You can filter out entities, but it won't stop HA from sending data about them, and it won't stop Reactor from receiving that data and having to process it enough to know it should ignore it. What you want to know is in the docs, if you're committed to it.
-
@wmarcolin said in Limit HA Entity in MSR:
in my opinion, this generates unnecessary integration overload
What's your basis for that opinion? On the HA side, all entities and events are published for everything on HAs websocket API, without filtering, so the data is coming to Reactor regardless. On the Reactor side, even with thousands of entities in my home environment, the load overall is low to Reactor and its host (load average <0.1 at 1, 5, and 15 minute measurement periods on an RPi 4), and HassController is only a fraction of that total load.
You can filter out entities, but it won't stop HA from sending data about them, and it won't stop Reactor from receiving that data and having to process it enough to know it should ignore it. What you want to know is in the docs, if you're committed to it.
Hi @toggledbits
I understand, I know that the system is very robust and supports thousands of interactions, I even imagine that because the two VMs of Reactor and HASS are on the same computer, the speed of communication is enormous.
So, apart from the overload issue that not have, I'm thinking about the practicality of using it, by removing from the list of HASS entity devices that I'm not interested in viewing in Reactor.
Looking at the manual, excuse my incompetence, I really couldn't identify how to configure not to load the Entity in Reactor, I made several attempts and I can't remove the devices. Below is my last attempt. If you can help me with the correct configuration.
- id: hass enabled: true implementation: HassController name: Home Assistant System config: source: 'ws://192.xxx.xxx.xxx:8123' access_token: "eyJhbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc0N> # # ignore_cert - If true, suppresses certificate validation when using wss:// (Websocket # with SSL/TLS) and thus allows a self-signed certificate to be used on # the Hass system. #ignore_cert: false # # dump_all_states - This is for troubleshooting. Do not enable unless asked. #dump_all_states: false exclude_entities: - "hass>sensor_sun*"
Thanks.
-
HassController uses
filter_entity
notexclude_entities
. Here are some examples:- id: hass implementation: HassController config: source: 'ws://192.xxx.xxx.xxx:8123' access_token: "xxxxxxxxxxxxxxxxxxxxxx" filter_entity: - sun_sun # using Reactor entity ID, filter out the entire matching entity - "sun.sun" # using HA domain.entity_id form, filter out entire entity
There are no wildcards.
You can also filter down to the HA attribute level. In this form, you use the HA
domain.entity_id
form combined with HA attribute names (you need to know/discover these from reading HA's integration documentation or examining yourhass_states.json
log file).filter_entity: # This is the abbreviated syntax for a single HA attribute "sun.sun": "last_updated" # ignores only this *one* HA attribute # # This is the full syntax for one or more HA attributes "sun.sun": - last_reported - last_updated
Filtering at the attribute level is intended for when an attribute on the entity changes frequently but isn't of use to your configuration -- by filtering the attribute out, Reactor won't post changes for its interpretation of that attribute, and thus Rules that depend on the entity won't be notified that it may have changed.
-
@wmarcolin By the way, if you really are concerned about performance/load, the other way to accomplish this is to tell HA that you don't need those entities by disabling them through their UI (Settings > Integrations).
-
@wmarcolin By the way, if you really are concerned about performance/load, the other way to accomplish this is to tell HA that you don't need those entities by disabling them through their UI (Settings > Integrations).
Hi @toggledbits
As I mentioned, I don't think it's a performance issue. Looking at the memory and processing of the Reactor and HA VM, the consumption is insignificant. I have more than 370 devices between ZWave and ZigBee, the Reactor is connected to a Hubitat C8, Hubitat C7, Zemismart M1, Aqara, and now HA, and it doesn't even affect processing.
My only desire was to remove elements from the Reactor in Entity that I don't care about. However, this is more a matter of usage habit than performance.
And by the way, the implementation in the latest version of the link to go directly to the rule or devices is fantastic. You still need to tweak the Entity Widgets for the Entity list. I think that instead of calling by Entity Name, it is calling by Canonical ID, and this is not working. But the idea is fantastic.
How is Santa's wish list coming along? You could have a post with this list just so we know what's coming down the road at some point.
Thanks!
-
Hi @toggledbits
As I mentioned, I don't think it's a performance issue. Looking at the memory and processing of the Reactor and HA VM, the consumption is insignificant. I have more than 370 devices between ZWave and ZigBee, the Reactor is connected to a Hubitat C8, Hubitat C7, Zemismart M1, Aqara, and now HA, and it doesn't even affect processing.
My only desire was to remove elements from the Reactor in Entity that I don't care about. However, this is more a matter of usage habit than performance.
And by the way, the implementation in the latest version of the link to go directly to the rule or devices is fantastic. You still need to tweak the Entity Widgets for the Entity list. I think that instead of calling by Entity Name, it is calling by Canonical ID, and this is not working. But the idea is fantastic.
How is Santa's wish list coming along? You could have a post with this list just so we know what's coming down the road at some point.
Thanks!
While you're at it, could you add to Santa's list a request for a function that, when given two coordinates, returns the distance between them?
I'll explain the use case: when Life360 worked on Hubitat, one of the variables was precisely the distance between the device and the point determined as the home. However, as I said, it hasn't worked for a long time.
This was one of the reasons for installing Home Assistance, which works perfectly, but it doesn't have this information, so I had to do the calculation.
I know, you're going to say what a horrible thing, what a mess, but it's working.
I prepared a series of calculations, using the coordinates of my home as a reference, for my phone WIL and my wife's phone ADRI. The phone coordinates come from Life360.
Next, I have the calculations.
So, I have the result.
I used this formula Python.
from math import radians, sin, cos, sqrt, atan2 def haversine(lat1, lon1, lat2, lon2): R = 6371 # raio da Terra em km dlat = radians(lat2 - lat1) dlon = radians(lon2 - lon1) lat1 = radians(lat1) lat2 = radians(lat2) a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2 c = 2 * atan2(sqrt(a), sqrt(1 - a)) return R * c # distância em km
Thanks.