jokob-sk / NetAlertX

🖧🔍 WIFI / LAN intruder detector. Scans for devices connected to your network and alerts you if new and unknown devices are found.
GNU General Public License v3.0
3.07k stars 186 forks source link

MQTT does recognize diacritics #813

Closed NightMean closed 1 month ago

NightMean commented 1 month ago

Is there an existing issue for this?

Current Behavior

Devices which have diacritics in their name (e.g. ľ,š,č,ť,ž,ý,á,í,é,ô, etc..) are not correctly published into MQTT. I have a device name called Peter-NTB - Firemný) which is correctly shown in the NetAlertX UI but when the device is sent to MQTT, theý` is stripped out.

image

Home Assistant: image

Expected Behavior

MQTT should send the full name even with the diacritics

Steps To Reproduce

  1. Use diacritics in any device name
  2. Publish devices via MQTT to Home Assitant

app.conf

No response

docker-compose.yml

No response

What branch are you running?

Production

app.log

23:18:18 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.178", "is_new": "1", "vendor": "OnePlus Tech Shenzhen Ltd", "mac_address": "xy:yz:ee:bb:cc:aa", "last_connection": "2024-09-28 21:05:36+02:00", "first_connection": "2024-09-28 21:05:36+02:00"} 23:18:18 [MQTT] Existing, skip Device Name : Michal-NTB - Firemn 23:18:18 [MQTT] Publishing sensor number 0 23:18:18 [MQTT] Existing, skip Device Name : Michal-NTB - Firemn 23:18:18 [MQTT] Publishing sensor number 0 23:18:18 [MQTT] Existing, skip Device Name : Michal-NTB - Firemn 23:18:18 [MQTT] Publishing sensor number 0 23:18:18 [MQTT] Existing, skip Device Name : Michal-NTB - Firemn 23:18:18 [MQTT] Publishing sensor number 0 23:18:18 [MQTT] Existing, skip Device Name : Michal-NTB - Firemn 23:18:18 [MQTT] Publishing sensor number 0 23:18:18 [MQTT] Existing, skip Device Name : Michal-NTB - Firemn 23:18:18 [MQTT] Publishing sensor number 0 23:18:18 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_xy_yz_ee_bb_cc_aa/state 23:18:18 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.210", "is_new": "1", "vendor": "Liteon Technology Corporation", "mac_address": "xy_yz_ee_bb_cc_aa", "last_connection": "2024-09-28 21:10:42+02:00", "first_connection": "2024-09-28 21:10:42+02:00"} 23:18:18 [MQTT] Existing, skip Device Name : Michal-NTB - Firemn 23:18:18 [MQTT] Publishing sensor number 0 23:18:18 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_xy_yz_ee_bb_cc_aa/state 23:18:18 [MQTT] Sending MQTT message: {"is_present": "OFF"} 23:18:18 [MQTT] Existing, skip Device Name : Michal-NTB - Firemn 23:18:18 [MQTT] Publishing sensor number 0 23:18:18 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_xy_yz_ee_bb_cc_aa/state 23:18:18 [MQTT] Sending MQTT message: away 23:18:18 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_xy_yz_ee_bb_cc_aa/attributes 23:18:18 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.210", "is_new": "1", "vendor": "Liteon Technology Corporation", "mac_address": "xy_yz_ee_bb_cc_aa", "last_connection": "2024-09-28 21:10:42+02:00", "first_connection": "2024-09-28 21:10:42+02:00"}

Debug enabled

jokob-sk commented 1 month ago

Thanks for the report!

I normalized the string, e.g. ý -> y before passing it to the broker.

This should be available in the next release. It would be great if you could test this. Can you please switch to the netalertx-dev docker image (backup everything at first), in about 15 minutes (or after the last action finishes) from now.

Make sure you refresh your browser cache - and click the 🔄 refresh button in the top right corner.

Thanks in advance, j

NightMean commented 1 month ago

Normalization works as well :) Thanks for the quick fix! I was able to see it straight away when I switched from prod to dev branch.

image

However after doing some further testing with the dev branch from scratch, there seems to be an issue with the mqtt publisher. I'm able to see all devices after couple of minutes in HomeAssistant in prod but if I delete the topic, move to dev branch (different volumes), the mqtt data is almost never picked up by HomeAssistant. I was able to sometimes see 25/36 devices but I'm not able to reproduce it consistently. The devices do show up in MQTT Explorer but not in HomeAssistant. I think, it might be related to fix from b7b2e0bc6572fc66c9c13079b71c6aa9abbd7bac but I can't confirm that.

Will do some more testing and then create a new issue for this when I get to the bottom of it :)

jokob-sk commented 1 month ago

Thanks for testing - let me know how you go.

FYI @ingoratsdorf - just so you know there might be an issue with the latest MQTT changes - let's see what @NightMean comes back with.

ingoratsdorf commented 1 month ago

The latest MQTT changes only pertain to connecting up with the broker properly. None of the publishing routines have been touched. If stuff shows up in MQTT Explorer but not in HA, then this may be an issue with the HA config in MQTT, not the actual topic publishing. Just to remember, HA relies on the actual published data (/system-sensors/#) and the config section (/homeassistant/#). We'd need to know where in MQTT Explorer things are sitting.

@NightMean, could you please check system-sensors/sensor/mac_xy_yz_ee_bb_cc_aa/state in MQTT Explorer vs the actual sensor config in homeassistant in MQTT Explorer homeassistant/sensor/mac_xy_yz_ee_bb_cc_aa/mac_address/config

Please note if you want to delete a sensor in HA, you have to delete the HA config, ie either through HA itself or delete the config section in MQTT Explorer in Homeassistant. Deleting a publish top will not delete the HA config and the sensor changes will not be picked up. image

It also looks like if nothing on the device changes, the device config is NOT getting published as it is in the NetAlertX database. I deleted for a test my 'Bonny' server config in HA and it is not getting published again from Netalertx. NetalertX is publishing the topic, but not the HA config again, which I deleted via HA.

14:07:30 [MQTT] Existing, skip Device Name    : Bonny on Proxmox1
14:07:30 [MQTT] Publishing sensor number 0
14:07:30 [MQTT] Existing, skip Device Name    : Bonny on Proxmox1
14:07:30 [MQTT] Publishing sensor number 0
14:07:30 [MQTT] Existing, skip Device Name    : Bonny on Proxmox1
14:07:30 [MQTT] Publishing sensor number 0
14:07:30 [MQTT] Existing, skip Device Name    : Bonny on Proxmox1
14:07:30 [MQTT] Publishing sensor number 0
14:07:30 [MQTT] Existing, skip Device Name    : Bonny on Proxmox1
14:07:30 [MQTT] Publishing sensor number 0
14:07:30 [MQTT] Existing, skip Device Name    : Bonny on Proxmox1
14:07:30 [MQTT] Publishing sensor number 0
14:07:30 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_bc_24_11_8e_f8_00/state
14:07:30 [MQTT] Sending MQTT message: {"last_ip": "192.168.100.2", "is_new": "0", "vendor": "Proxmox Server Solutions GmbH", "mac_address": "bc:24:11:8e:f8:00", "last_connection": "2024-09-22 18:06:36", "first_connection": "2024-09-02 06:55:55+12:00"}
14:07:30 [MQTT] Existing, skip Device Name    : Bonny on Proxmox1
14:07:30 [MQTT] Publishing sensor number 0
14:07:30 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_bc_24_11_8e_f8_00/state
14:07:30 [MQTT] Sending MQTT message: {"is_present": "OFF"}
14:07:30 [MQTT] Existing, skip Device Name    : Bonny on Proxmox1
14:07:30 [MQTT] Publishing sensor number 0
14:07:30 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_bc_24_11_8e_f8_00/state
14:07:30 [MQTT] Sending MQTT message: away
14:07:30 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_bc_24_11_8e_f8_00/attributes
14:07:30 [MQTT] Sending MQTT message: {"last_ip": "192.168.100.2", "is_new": "0", "vendor": "Proxmox Server Solutions GmbH", "mac_address": "bc:24:11:8e:f8:00", "last_connection": "2024-09-22 18:06:36", "first_connection": "2024-09-02 06:55:55+12:00"}

As a workaround, one could be checking if the config is still there before publishing the topic, but that would take more calls and logic than simply publishing the config again every time (which would in turn add quite some overhead).

Ideas?

ingoratsdorf commented 1 month ago

On that matter, I changed the location field for my bonny server, but it still get's skipped in the config publish. Looks like we might also update the HA config when any device info changes?

Looking at the code in mqtt.py, the sensor is only getting updated on changes to id, name, type and icon, not anything else like location etc.

        # Define your input string
        input_string = str(self.deviceId) + str(self.deviceName) + str(self.sensorType) + str(self.sensorName) + str(self.icon)

        # Hash the input string and convert the hash to a string
        # Update the hash object with the bytes of the input string
        md5_hash.update(input_string.encode('utf-8'))

        # Get the hexadecimal representation of the MD5 hash
        md5_hash_hex = md5_hash.hexdigest()
        hash_value = str(md5_hash_hex)

        self.hash = hash_value

        plugObj = getPluginObject({"Plugin":"MQTT", "Watched_Value3":hash_value}) 

        # mylog('verbose', [f"[{pluginName}] Previous plugin object entry: {json.dumps(plugObj)}"])        

        if plugObj == {}:
            self.isNew = True
            mylog('verbose', [f"[{pluginName}] New sensor entry name         : {self.deviceName}"])  
            mylog('verbose', [f"[{pluginName}] New sensor entry mac          : {self.mac}"])  
            mylog('verbose', [f"[{pluginName}] New sensor entry hash_value   : {hash_value}"])  
        else:
            device_name = plugObj.get("Watched_Value1", "Unknown")
            mylog('verbose', [f"[{pluginName}] Existing, skip Device Name    : {device_name}"])
            self.isNew = False

So I changed the icon and name and voila, the new config is geeting published to HA:

14:36:44 [MQTT] New sensor entry name         : Bonny on Proxmox1_
14:36:44 [MQTT] Sending MQTT message: {"name": "last_ip", "state_topic": "system-sensors/sensor/mac_bc_24_11_8e_f8_00/state", "value_template": "{{value_json.last_ip}}", "unique_id": "mac_bc_24_11_8e_f8_00_sensor_last_ip", "device": {"identifiers": ["mac_bc_24_11_8e_f8_00_sensor"], "manufacturer": "NetAlertX", "name": "Bonny on Proxmox1_"}, "icon": "mdi:ip-network"}
14:36:45 [MQTT] New sensor entry name         : Bonny on Proxmox1_
14:36:45 [MQTT] Sending MQTT message: {"name": "mac_address", "state_topic": "system-sensors/sensor/mac_bc_24_11_8e_f8_00/state", "value_template": "{{value_json.mac_address}}", "unique_id": "mac_bc_24_11_8e_f8_00_sensor_mac_address", "device": {"identifiers": ["mac_bc_24_11_8e_f8_00_sensor"], "manufacturer": "NetAlertX", "name": "Bonny on Proxmox1_"}, "icon": "mdi:folder-key-network"}
14:36:46 [MQTT] New sensor entry name         : Bonny on Proxmox1_
14:36:46 [MQTT] Sending MQTT message: {"name": "is_new", "state_topic": "system-sensors/sensor/mac_bc_24_11_8e_f8_00/state", "value_template": "{{value_json.is_new}}", "unique_id": "mac_bc_24_11_8e_f8_00_sensor_is_new", "device": {"identifiers": ["mac_bc_24_11_8e_f8_00_sensor"], "manufacturer": "NetAlertX", "name": "Bonny on Proxmox1_"}, "icon": "mdi:bell-alert-outline"}
14:36:47 [MQTT] New sensor entry name         : Bonny on Proxmox1_
14:36:47 [MQTT] Sending MQTT message: {"name": "vendor", "state_topic": "system-sensors/sensor/mac_bc_24_11_8e_f8_00/state", "value_template": "{{value_json.vendor}}", "unique_id": "mac_bc_24_11_8e_f8_00_sensor_vendor", "device": {"identifiers": ["mac_bc_24_11_8e_f8_00_sensor"], "manufacturer": "NetAlertX", "name": "Bonny on Proxmox1_"}, "icon": "mdi:cog"}
14:36:48 [MQTT] New sensor entry name         : Bonny on Proxmox1_
14:36:48 [MQTT] Sending MQTT message: {"name": "first_connection", "state_topic": "system-sensors/sensor/mac_bc_24_11_8e_f8_00/state", "value_template": "{{value_json.first_connection}}", "unique_id": "mac_bc_24_11_8e_f8_00_sensor_first_connection", "device": {"identifiers": ["mac_bc_24_11_8e_f8_00_sensor"], "manufacturer": "NetAlertX", "name": "Bonny on Proxmox1_"}, "icon": "mdi:calendar-start"}
14:36:49 [MQTT] New sensor entry name         : Bonny on Proxmox1_
14:36:49 [MQTT] Sending MQTT message: {"name": "last_connection", "state_topic": "system-sensors/sensor/mac_bc_24_11_8e_f8_00/state", "value_template": "{{value_json.last_connection}}", "unique_id": "mac_bc_24_11_8e_f8_00_sensor_last_connection", "device": {"identifiers": ["mac_bc_24_11_8e_f8_00_sensor"], "manufacturer": "NetAlertX", "name": "Bonny on Proxmox1_"}, "icon": "mdi:calendar-end"}
14:36:50 [MQTT] New sensor entry name         : Bonny on Proxmox1_
14:36:50 [MQTT] Sending MQTT message: {"name": "is_present", "state_topic": "system-sensors/binary_sensor/mac_bc_24_11_8e_f8_00/state", "value_template": "{{value_json.is_present}}", "unique_id": "mac_bc_24_11_8e_f8_00_sensor_is_present", "device": {"identifiers": ["mac_bc_24_11_8e_f8_00_sensor"], "manufacturer": "NetAlertX", "name": "Bonny on Proxmox1_"}, "icon": "mdi:wifi"}
14:36:51 [MQTT] New sensor entry name         : Bonny on Proxmox1_
14:36:51 [MQTT] Sending MQTT message: {"state_topic": "system-sensors/device_tracker/mac_bc_24_11_8e_f8_00/state", "json_attributes_topic": "system-sensors/device_tracker/mac_bc_24_11_8e_f8_00/attributes", "name": "is_home", "payload_home": "home", "payload_not_home": "away", "unique_id": "mac_bc_24_11_8e_f8_00_device_tracker_is_home", "icon": "mdi:home", "device": {"identifiers": ["mac_bc_24_11_8e_f8_00_sensor", "mac_bc_24_11_8e_f8_00_device_tracker_is_home"], "manufacturer": "NetAlertX", "name": "Bonny on Proxmox1_"}}
NightMean commented 1 month ago

If stuff shows up in MQTT Explorer but not in HA, then this may be an issue with the HA config in MQTT, not the actual topic publishing.

I'm not sure about this. The data in MQTT explorer looked the same for me from prod to dev branch but for some reason, HA refused to show those devices. It was very strange when I was playing with it yesterday.

Please note if you want to delete a sensor in HA, you have to delete the HA config, ie either through HA itself or delete the config section in MQTT Explorer in Homeassistant. Deleting a publish top will not delete the HA config and the sensor changes will not be picked up.

Honestly, I was restoring my HA backup in Proxmox everytime I cleaned it, just to be sure :) Regardless of that, the results were very different almost each time. Although it worked more times in prod than in dev.

It also looks like if nothing on the device changes, the device config is NOT getting published as it is in the NetAlertX database.

I also noticed that. Afterwards instead of long restore process in Proxmox I just deleted the MQTT integration and added it again. That seemed to work most of the times. Now that you mentioned this, this is actually what led me to play with this as I deleted the entity in HASS for the test above and it was not getting published anymore. At least I was not hallucinating :)

Will be playing with this deeper today/tomorrow.

NightMean commented 1 month ago

First setup: NetAlertX: Production

  1. Started HA from a backup that never saw MQTT topics from NetAlertX.
  2. Enabled MQTT Publisher in NetAlertX to run always after scan
  3. HA was slowly but surely filling up with devices but from 36 devices, only 26 were visible. I was able to narrow it down by finding that some devices are not being published into topic homeassistant/sensor/mac_xy_yz_ee_bb_cc_aa/mac_address/config. I can see all devices in system-sensors/sensor/mac_xy_yz_ee_bb_cc_aa/state

image

Other device that shows as expected: image

Here is the first app.log ``` 21:52:45 [Plugins] Executing: python3 /app/front/plugins/_publisher_mqtt/mqtt.py devices={devices} 21:52:45 [MQTT](publisher) In script 21:52:45 [MQTT] Connected to broker 21:52:45 [MQTT] Existing, skip Device Name : NetAlertX 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : NetAlertX 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : NetAlertX 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : NetAlertX 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : NetAlertX 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : NetAlertX 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/sensor/netalertx/state 21:52:45 [MQTT] Sending MQTT message: {"online": 28, "down": 8, "all": 36, "archived": 0, "new": 35, "unknown": 0} 21:52:45 [MQTT] Estimated delay: 360s (6.0min) 21:52:45 [MQTT] Existing, skip Device Name : Internet 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Internet 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Internet 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Internet 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Internet 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Internet 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_internet/state 21:52:45 [MQTT] Sending MQTT message: {"last_ip": "xx.yyy.zzz.hh", "is_new": "0", "vendor": "BitComp sro", "mac_address": "Internet", "last_connection": "2021-01-01 00:00:00", "first_connection": "2021-01-01 00:00:00"} 21:52:45 [MQTT] Existing, skip Device Name : Internet 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_internet/state 21:52:45 [MQTT] Sending MQTT message: {"is_present": "ON"} 21:52:45 [MQTT] Existing, skip Device Name : Internet 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_internet/state 21:52:45 [MQTT] Sending MQTT message: home 21:52:45 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_internet/attributes 21:52:45 [MQTT] Sending MQTT message: {"last_ip": "xx.yyy.zzz.hh", "is_new": "0", "vendor": "BitComp sro", "mac_address": "Internet", "last_connection": "2021-01-01 00:00:00", "first_connection": "2021-01-01 00:00:00"} 21:52:45 [MQTT] Existing, skip Device Name : Portainer 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Portainer 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Portainer 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Portainer 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Portainer 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Portainer 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_36_98_4a_f1_6e_af/state 21:52:45 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.11", "is_new": "1", "vendor": "None", "mac_address": "36:98:4a:f1:6e:af", "last_connection": "2024-09-28 19:10:43+02:00", "first_connection": "2024-09-28 19:10:43+02:00"} 21:52:45 [MQTT] Existing, skip Device Name : Portainer 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_36_98_4a_f1_6e_af/state 21:52:45 [MQTT] Sending MQTT message: {"is_present": "ON"} 21:52:45 [MQTT] Existing, skip Device Name : Portainer 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_36_98_4a_f1_6e_af/state 21:52:45 [MQTT] Sending MQTT message: home 21:52:45 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_36_98_4a_f1_6e_af/attributes 21:52:45 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.11", "is_new": "1", "vendor": "None", "mac_address": "36:98:4a:f1:6e:af", "last_connection": "2024-09-28 19:10:43+02:00", "first_connection": "2024-09-28 19:10:43+02:00"} 21:52:45 [MQTT] Existing, skip Device Name : ASUS RT-AC68U 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : ASUS RT-AC68U 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : ASUS RT-AC68U 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : ASUS RT-AC68U 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : ASUS RT-AC68U 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : ASUS RT-AC68U 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_0c_9d_92_52_f9_c8/state 21:52:45 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.1", "is_new": "1", "vendor": "ASUSTek COMPUTER INC", "mac_address": "0c:9d:92:52:f9:c8", "last_connection": "2024-09-28 19:25:53+02:00", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:45 [MQTT] Existing, skip Device Name : ASUS RT-AC68U 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_0c_9d_92_52_f9_c8/state 21:52:45 [MQTT] Sending MQTT message: {"is_present": "ON"} 21:52:45 [MQTT] Existing, skip Device Name : ASUS RT-AC68U 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_0c_9d_92_52_f9_c8/state 21:52:45 [MQTT] Sending MQTT message: home 21:52:45 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_0c_9d_92_52_f9_c8/attributes 21:52:45 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.1", "is_new": "1", "vendor": "ASUSTek COMPUTER INC", "mac_address": "0c:9d:92:52:f9:c8", "last_connection": "2024-09-28 19:25:53+02:00", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:45 [MQTT] Existing, skip Device Name : Home Assistant 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Home Assistant 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Home Assistant 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Home Assistant 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Home Assistant 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Home Assistant 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_00_60_2f_19_98_57/state 21:52:45 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.10", "is_new": "1", "vendor": "Cisco Systems Inc", "mac_address": "00:60:2f:19:98:57", "last_connection": "2024-09-30 21:30:52", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:45 [MQTT] Existing, skip Device Name : Home Assistant 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_00_60_2f_19_98_57/state 21:52:45 [MQTT] Sending MQTT message: {"is_present": "ON"} 21:52:45 [MQTT] Existing, skip Device Name : Home Assistant 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_00_60_2f_19_98_57/state 21:52:45 [MQTT] Sending MQTT message: home 21:52:45 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_00_60_2f_19_98_57/attributes 21:52:45 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.10", "is_new": "1", "vendor": "Cisco Systems Inc", "mac_address": "00:60:2f:19:98:57", "last_connection": "2024-09-30 21:30:52", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:45 [MQTT] Existing, skip Device Name : Yamaha HTR-4071 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Yamaha HTR-4071 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Yamaha HTR-4071 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Yamaha HTR-4071 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Yamaha HTR-4071 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Yamaha HTR-4071 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_64_cf_d9_15_14_0e/state 21:52:45 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.46", "is_new": "1", "vendor": "Texas Instruments", "mac_address": "64:cf:d9:15:14:0e", "last_connection": "2024-09-28 19:25:53+02:00", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:45 [MQTT] Existing, skip Device Name : Yamaha HTR-4071 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_64_cf_d9_15_14_0e/state 21:52:45 [MQTT] Sending MQTT message: {"is_present": "ON"} 21:52:45 [MQTT] Existing, skip Device Name : Yamaha HTR-4071 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_64_cf_d9_15_14_0e/state 21:52:45 [MQTT] Sending MQTT message: home 21:52:45 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_64_cf_d9_15_14_0e/attributes 21:52:45 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.46", "is_new": "1", "vendor": "Texas Instruments", "mac_address": "64:cf:d9:15:14:0e", "last_connection": "2024-09-28 19:25:53+02:00", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:45 [MQTT] Existing, skip Device Name : Proxmox Server 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Proxmox Server 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Proxmox Server 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Proxmox Server 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Proxmox Server 21:52:45 [MQTT] Publishing sensor number 0 21:52:45 [MQTT] Existing, skip Device Name : Proxmox Server 21:52:45 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_40_a8_f0_66_03_1a/state 21:52:46 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.100", "is_new": "1", "vendor": "Hewlett Packard", "mac_address": "40:a8:f0:66:03:1a", "last_connection": "2024-09-28 19:25:53+02:00", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:46 [MQTT] Existing, skip Device Name : Proxmox Server 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_40_a8_f0_66_03_1a/state 21:52:46 [MQTT] Sending MQTT message: {"is_present": "ON"} 21:52:46 [MQTT] Existing, skip Device Name : Proxmox Server 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_40_a8_f0_66_03_1a/state 21:52:46 [MQTT] Sending MQTT message: home 21:52:46 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_40_a8_f0_66_03_1a/attributes 21:52:46 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.100", "is_new": "1", "vendor": "Hewlett Packard", "mac_address": "40:a8:f0:66:03:1a", "last_connection": "2024-09-28 19:25:53+02:00", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:46 [MQTT] Existing, skip Device Name : Michal-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Michal-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Michal-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Michal-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Michal-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Michal-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_f8_32_e4_c0_27_74/state 21:52:46 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.101", "is_new": "1", "vendor": "ASUSTek COMPUTER INC", "mac_address": "f8:32:e4:c0:27:74", "last_connection": "2024-09-30 07:55:41", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:46 [MQTT] Existing, skip Device Name : Michal-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_f8_32_e4_c0_27_74/state 21:52:46 [MQTT] Sending MQTT message: {"is_present": "ON"} 21:52:46 [MQTT] Existing, skip Device Name : Michal-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_f8_32_e4_c0_27_74/state 21:52:46 [MQTT] Sending MQTT message: home 21:52:46 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_f8_32_e4_c0_27_74/attributes 21:52:46 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.101", "is_new": "1", "vendor": "ASUSTek COMPUTER INC", "mac_address": "f8:32:e4:c0:27:74", "last_connection": "2024-09-30 07:55:41", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:46 [MQTT] Existing, skip Device Name : Peter-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Peter-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Peter-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Peter-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Peter-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Peter-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_54_a0_50_7e_bf_a7/state 21:52:46 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.102", "is_new": "1", "vendor": "ASUSTek COMPUTER INC", "mac_address": "54:a0:50:7e:bf:a7", "last_connection": "2024-09-30 18:06:07", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:46 [MQTT] Existing, skip Device Name : Peter-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_54_a0_50_7e_bf_a7/state 21:52:46 [MQTT] Sending MQTT message: {"is_present": "ON"} 21:52:46 [MQTT] Existing, skip Device Name : Peter-PC 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_54_a0_50_7e_bf_a7/state 21:52:46 [MQTT] Sending MQTT message: home 21:52:46 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_54_a0_50_7e_bf_a7/attributes 21:52:46 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.102", "is_new": "1", "vendor": "ASUSTek COMPUTER INC", "mac_address": "54:a0:50:7e:bf:a7", "last_connection": "2024-09-30 18:06:07", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:46 [MQTT] Existing, skip Device Name : NVIDIA Shield TV 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : NVIDIA Shield TV 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : NVIDIA Shield TV 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : NVIDIA Shield TV 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : NVIDIA Shield TV 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : NVIDIA Shield TV 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_48_b0_2d_15_42_d3/state 21:52:46 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.104", "is_new": "1", "vendor": "NVIDIA Corporation", "mac_address": "48:b0:2d:15:42:d3", "last_connection": "2024-09-28 19:25:53+02:00", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:46 [MQTT] Existing, skip Device Name : NVIDIA Shield TV 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_48_b0_2d_15_42_d3/state 21:52:46 [MQTT] Sending MQTT message: {"is_present": "ON"} 21:52:46 [MQTT] Existing, skip Device Name : NVIDIA Shield TV 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_48_b0_2d_15_42_d3/state 21:52:46 [MQTT] Sending MQTT message: home 21:52:46 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_48_b0_2d_15_42_d3/attributes 21:52:46 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.104", "is_new": "1", "vendor": "NVIDIA Corporation", "mac_address": "48:b0:2d:15:42:d3", "last_connection": "2024-09-28 19:25:53+02:00", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:46 [MQTT] Existing, skip Device Name : Michal-W11-VM 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Michal-W11-VM 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Michal-W11-VM 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Michal-W11-VM 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Michal-W11-VM 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Existing, skip Device Name : Michal-W11-VM 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_be_ef_f7_cd_c2_4d/state 21:52:46 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.110", "is_new": "1", "vendor": "Unknown locally administered", "mac_address": "be:ef:f7:cd:c2:4d", "last_connection": "2024-09-28 19:25:53+02:00", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:46 [MQTT] Existing, skip Device Name : Michal-W11-VM 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_be_ef_f7_cd_c2_4d/state 21:52:46 [MQTT] Sending MQTT message: {"is_present": "ON"} 21:52:46 [MQTT] Existing, skip Device Name : Michal-W11-VM 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_be_ef_f7_cd_c2_4d/state 21:52:46 [MQTT] Sending MQTT message: home 21:52:46 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_be_ef_f7_cd_c2_4d/attributes 21:52:46 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.110", "is_new": "1", "vendor": "Unknown locally administered", "mac_address": "be:ef:f7:cd:c2:4d", "last_connection": "2024-09-28 19:25:53+02:00", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:46 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "eb1572716b475324b54dacfc270a7df6"} 21:52:46 [MQTT] New sensor entry name : Peter-NTB - Firemn 21:52:46 [MQTT] New sensor entry mac : 68:17:29:42:58:0b 21:52:46 [MQTT] New sensor entry hash_value : eb1572716b475324b54dacfc270a7df6 21:52:46 [MQTT] Publishing sensor number 0 21:52:46 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_68_17_29_42_58_0b/last_ip/config 21:52:46 [MQTT] Sending MQTT message: {"name": "last_ip", "state_topic": "system-sensors/sensor/mac_68_17_29_42_58_0b/state", "value_template": "{{value_json.last_ip}}", "unique_id": "mac_68_17_29_42_58_0b_sensor_last_ip", "device": {"identifiers": ["mac_68_17_29_42_58_0b_sensor"], "manufacturer": "NetAlertX", "name": "Peter-NTB - Firemn"}, "icon": "mdi:ip-network"} 21:52:48 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "9921196c8521df19b5472e441b6b152d"} 21:52:48 [MQTT] New sensor entry name : Peter-NTB - Firemn 21:52:48 [MQTT] New sensor entry mac : 68:17:29:42:58:0b 21:52:48 [MQTT] New sensor entry hash_value : 9921196c8521df19b5472e441b6b152d 21:52:48 [MQTT] Publishing sensor number 1 21:52:48 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_68_17_29_42_58_0b/mac_address/config 21:52:48 [MQTT] Sending MQTT message: {"name": "mac_address", "state_topic": "system-sensors/sensor/mac_68_17_29_42_58_0b/state", "value_template": "{{value_json.mac_address}}", "unique_id": "mac_68_17_29_42_58_0b_sensor_mac_address", "device": {"identifiers": ["mac_68_17_29_42_58_0b_sensor"], "manufacturer": "NetAlertX", "name": "Peter-NTB - Firemn"}, "icon": "mdi:folder-key-network"} 21:52:50 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "84a11347a1ee77afd52bef51a635b39f"} 21:52:50 [MQTT] New sensor entry name : Peter-NTB - Firemn 21:52:50 [MQTT] New sensor entry mac : 68:17:29:42:58:0b 21:52:50 [MQTT] New sensor entry hash_value : 84a11347a1ee77afd52bef51a635b39f 21:52:50 [MQTT] Publishing sensor number 2 21:52:50 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_68_17_29_42_58_0b/is_new/config 21:52:50 [MQTT] Sending MQTT message: {"name": "is_new", "state_topic": "system-sensors/sensor/mac_68_17_29_42_58_0b/state", "value_template": "{{value_json.is_new}}", "unique_id": "mac_68_17_29_42_58_0b_sensor_is_new", "device": {"identifiers": ["mac_68_17_29_42_58_0b_sensor"], "manufacturer": "NetAlertX", "name": "Peter-NTB - Firemn"}, "icon": "mdi:bell-alert-outline"} 21:52:52 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "ece0f6aa14d04ae4cb9c98193e3f47c5"} 21:52:52 [MQTT] New sensor entry name : Peter-NTB - Firemn 21:52:52 [MQTT] New sensor entry mac : 68:17:29:42:58:0b 21:52:52 [MQTT] New sensor entry hash_value : ece0f6aa14d04ae4cb9c98193e3f47c5 21:52:52 [MQTT] Publishing sensor number 3 21:52:52 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_68_17_29_42_58_0b/vendor/config 21:52:52 [MQTT] Sending MQTT message: {"name": "vendor", "state_topic": "system-sensors/sensor/mac_68_17_29_42_58_0b/state", "value_template": "{{value_json.vendor}}", "unique_id": "mac_68_17_29_42_58_0b_sensor_vendor", "device": {"identifiers": ["mac_68_17_29_42_58_0b_sensor"], "manufacturer": "NetAlertX", "name": "Peter-NTB - Firemn"}, "icon": "mdi:cog"} 21:52:54 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "8022e8f2827d3eb70b168c52bf5b82f4"} 21:52:54 [MQTT] New sensor entry name : Peter-NTB - Firemn 21:52:54 [MQTT] New sensor entry mac : 68:17:29:42:58:0b 21:52:54 [MQTT] New sensor entry hash_value : 8022e8f2827d3eb70b168c52bf5b82f4 21:52:54 [MQTT] Publishing sensor number 4 21:52:54 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_68_17_29_42_58_0b/first_connection/config 21:52:54 [MQTT] Sending MQTT message: {"name": "first_connection", "state_topic": "system-sensors/sensor/mac_68_17_29_42_58_0b/state", "value_template": "{{value_json.first_connection}}", "unique_id": "mac_68_17_29_42_58_0b_sensor_first_connection", "device": {"identifiers": ["mac_68_17_29_42_58_0b_sensor"], "manufacturer": "NetAlertX", "name": "Peter-NTB - Firemn"}, "icon": "mdi:calendar-start"} 21:52:56 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "db24c428066ef68511c21fdfc0ae78a9"} 21:52:56 [MQTT] New sensor entry name : Peter-NTB - Firemn 21:52:56 [MQTT] New sensor entry mac : 68:17:29:42:58:0b 21:52:56 [MQTT] New sensor entry hash_value : db24c428066ef68511c21fdfc0ae78a9 21:52:56 [MQTT] Publishing sensor number 5 21:52:56 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_68_17_29_42_58_0b/last_connection/config 21:52:56 [MQTT] Sending MQTT message: {"name": "last_connection", "state_topic": "system-sensors/sensor/mac_68_17_29_42_58_0b/state", "value_template": "{{value_json.last_connection}}", "unique_id": "mac_68_17_29_42_58_0b_sensor_last_connection", "device": {"identifiers": ["mac_68_17_29_42_58_0b_sensor"], "manufacturer": "NetAlertX", "name": "Peter-NTB - Firemn"}, "icon": "mdi:calendar-end"} 21:52:58 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_68_17_29_42_58_0b/state 21:52:58 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.19", "is_new": "1", "vendor": "Intel Corporate", "mac_address": "68:17:29:42:58:0b", "last_connection": "2024-09-30 18:10:18", "first_connection": "2024-09-28 19:25:53+02:00"} 21:52:58 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "ba5a0258f91cc20de67b94e1ee960ef7"} 21:52:58 [MQTT] New sensor entry name : Peter-NTB - Firemn 21:52:58 [MQTT] New sensor entry mac : 68:17:29:42:58:0b 21:52:58 [MQTT] New sensor entry hash_value : ba5a0258f91cc20de67b94e1ee960ef7 21:52:58 [MQTT] Publishing sensor number 6 21:52:58 [MQTT] Sending MQTT topic: homeassistant/binary_sensor/mac_68_17_29_42_58_0b/is_present/config 21:52:58 [MQTT] Sending MQTT message: {"name": "is_present", "state_topic": "system-sensors/binary_sensor/mac_68_17_29_42_58_0b/state", "value_template": "{{value_json.is_present}}", "unique_id": "mac_68_17_29_42_58_0b_sensor_is_present", "device": {"identifiers": ["mac_68_17_29_42_58_0b_sensor"], "manufacturer": "NetAlertX", "name": "Peter-NTB - Firemn"}, "icon": "mdi:wifi"} 21:53:00 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_68_17_29_42_58_0b/state 21:53:00 [MQTT] Sending MQTT message: {"is_present": "ON"} 21:53:00 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "3d4b56f7a1b3ef3a853bd4bfd92ab376"} 21:53:00 [MQTT] New sensor entry name : Peter-NTB - Firemn 21:53:00 [MQTT] New sensor entry mac : 68:17:29:42:58:0b 21:53:00 [MQTT] New sensor entry hash_value : 3d4b56f7a1b3ef3a853bd4bfd92ab376 21:53:00 [MQTT] Publishing sensor number 7 21:53:00 [MQTT] Sending MQTT topic: homeassistant/device_tracker/mac_68_17_29_42_58_0b/config 21:53:00 [MQTT] Sending MQTT message: {"state_topic": "system-sensors/device_tracker/mac_68_17_29_42_58_0b/state", "json_attributes_topic": "system-sensors/device_tracker/mac_68_17_29_42_58_0b/attributes", "name": "is_home", "payload_home": "home", "payload_not_home": "away", "unique_id": "mac_68_17_29_42_58_0b_device_tracker_is_home", "icon": "mdi:home", "device": {"identifiers": ["mac_68_17_29_42_58_0b_sensor", "mac_68_17_29_42_58_0b_device_tracker_is_home"], "manufacturer": "NetAlertX", "name": "Peter-NTB - Firemn"}} 21:53:02 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_68_17_29_42_58_0b/state 21:53:02 [MQTT] Sending MQTT message: home 21:53:02 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_68_17_29_42_58_0b/attributes 21:53:02 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.19", "is_new": "1", "vendor": "Intel Corporate", "mac_address": "68:17:29:42:58:0b", "last_connection": "2024-09-30 18:10:18", "first_connection": "2024-09-28 19:25:53+02:00"} ```

From what I noticed from the logs above, NetAlertX thinks that the devices already exist but in fact, HA never saw them. Maybe it's somewhere in the NetAlertX MQTT database as I'm using the same stack which I used since day 1 with all of the data.

  1. Deleted the MQTT integration and set it up again (36 out of 47 devices were shown as before)
  2. Deleted MQTT topic system-sensors but nothing really happened other than that NetAlertX started populating the topic again.
  3. Changed device name of Portainer to Portainers and after couple of seconds, I had 46 out of 47 devices discovered in HA.
Here is the second app after rename.log ``` 22:29:37 [Plugins] Executing: python3 /app/front/plugins/_publisher_mqtt/mqtt.py devices={devices} 22:29:37 [MQTT](publisher) In script 22:29:37 [Database] Opening DB 22:29:37 [MQTT] Connected to broker 22:29:37 [MQTT] Existing, skip Device Name : NetAlertX 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Existing, skip Device Name : NetAlertX 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Existing, skip Device Name : NetAlertX 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Existing, skip Device Name : NetAlertX 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Existing, skip Device Name : NetAlertX 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Existing, skip Device Name : NetAlertX 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Sending MQTT topic: system-sensors/sensor/netalertx/state 22:29:37 [MQTT] Sending MQTT message: {"online": 26, "down": 10, "all": 36, "archived": 0, "new": 35, "unknown": 0} 22:29:37 [MQTT] Estimated delay: 360s (6.0min) 22:29:37 [MQTT] Existing, skip Device Name : Internet 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Existing, skip Device Name : Internet 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Existing, skip Device Name : Internet 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Existing, skip Device Name : Internet 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Existing, skip Device Name : Internet 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Existing, skip Device Name : Internet 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_internet/state 22:29:37 [MQTT] Sending MQTT message: {"last_ip": "xx.yyy.zzz.hh", "is_new": "0", "vendor": "BitComp sro", "mac_address": "Internet", "last_connection": "2021-01-01 00:00:00", "first_connection": "2021-01-01 00:00:00"} 22:29:37 [MQTT] Existing, skip Device Name : Internet 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_internet/state 22:29:37 [MQTT] Sending MQTT message: {"is_present": "ON"} 22:29:37 [MQTT] Existing, skip Device Name : Internet 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_internet/state 22:29:37 [MQTT] Sending MQTT message: home 22:29:37 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_internet/attributes 22:29:37 [MQTT] Sending MQTT message: {"last_ip": "xx.yyy.zzz.hh", "is_new": "0", "vendor": "BitComp sro", "mac_address": "Internet", "last_connection": "2021-01-01 00:00:00", "first_connection": "2021-01-01 00:00:00"} 22:29:37 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "8fe30ba63f7e437cbf70cc98387f51df"} 22:29:37 [MQTT] New sensor entry name : Portainers 22:29:37 [MQTT] New sensor entry mac : 36:98:4a:f1:6e:af 22:29:37 [MQTT] New sensor entry hash_value : 8fe30ba63f7e437cbf70cc98387f51df 22:29:37 [MQTT] Publishing sensor number 0 22:29:37 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_36_98_4a_f1_6e_af/last_ip/config 22:29:37 [MQTT] Sending MQTT message: {"name": "last_ip", "state_topic": "system-sensors/sensor/mac_36_98_4a_f1_6e_af/state", "value_template": "{{value_json.last_ip}}", "unique_id": "mac_36_98_4a_f1_6e_af_sensor_last_ip", "device": {"identifiers": ["mac_36_98_4a_f1_6e_af_sensor"], "manufacturer": "NetAlertX", "name": "Portainers"}, "icon": "mdi:ip-network"} 22:29:39 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "720a35e7568db379eb174e581da9f393"} 22:29:39 [MQTT] New sensor entry name : Portainers 22:29:39 [MQTT] New sensor entry mac : 36:98:4a:f1:6e:af 22:29:39 [MQTT] New sensor entry hash_value : 720a35e7568db379eb174e581da9f393 22:29:39 [MQTT] Publishing sensor number 1 22:29:39 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_36_98_4a_f1_6e_af/mac_address/config 22:29:39 [MQTT] Sending MQTT message: {"name": "mac_address", "state_topic": "system-sensors/sensor/mac_36_98_4a_f1_6e_af/state", "value_template": "{{value_json.mac_address}}", "unique_id": "mac_36_98_4a_f1_6e_af_sensor_mac_address", "device": {"identifiers": ["mac_36_98_4a_f1_6e_af_sensor"], "manufacturer": "NetAlertX", "name": "Portainers"}, "icon": "mdi:folder-key-network"} 22:29:41 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "5fdaf0af12053738284ab09b3ce202db"} 22:29:41 [MQTT] New sensor entry name : Portainers 22:29:41 [MQTT] New sensor entry mac : 36:98:4a:f1:6e:af 22:29:41 [MQTT] New sensor entry hash_value : 5fdaf0af12053738284ab09b3ce202db 22:29:41 [MQTT] Publishing sensor number 2 22:29:41 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_36_98_4a_f1_6e_af/is_new/config 22:29:41 [MQTT] Sending MQTT message: {"name": "is_new", "state_topic": "system-sensors/sensor/mac_36_98_4a_f1_6e_af/state", "value_template": "{{value_json.is_new}}", "unique_id": "mac_36_98_4a_f1_6e_af_sensor_is_new", "device": {"identifiers": ["mac_36_98_4a_f1_6e_af_sensor"], "manufacturer": "NetAlertX", "name": "Portainers"}, "icon": "mdi:bell-alert-outline"} 22:29:43 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "ff2cac5bc62018ecf4ede7feaa6f3124"} 22:29:43 [MQTT] New sensor entry name : Portainers 22:29:43 [MQTT] New sensor entry mac : 36:98:4a:f1:6e:af 22:29:43 [MQTT] New sensor entry hash_value : ff2cac5bc62018ecf4ede7feaa6f3124 22:29:43 [MQTT] Publishing sensor number 3 22:29:43 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_36_98_4a_f1_6e_af/vendor/config 22:29:43 [MQTT] Sending MQTT message: {"name": "vendor", "state_topic": "system-sensors/sensor/mac_36_98_4a_f1_6e_af/state", "value_template": "{{value_json.vendor}}", "unique_id": "mac_36_98_4a_f1_6e_af_sensor_vendor", "device": {"identifiers": ["mac_36_98_4a_f1_6e_af_sensor"], "manufacturer": "NetAlertX", "name": "Portainers"}, "icon": "mdi:cog"} 22:29:45 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "144203852dc7b259f10191d19325d674"} 22:29:45 [MQTT] New sensor entry name : Portainers 22:29:45 [MQTT] New sensor entry mac : 36:98:4a:f1:6e:af 22:29:45 [MQTT] New sensor entry hash_value : 144203852dc7b259f10191d19325d674 22:29:45 [MQTT] Publishing sensor number 4 22:29:45 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_36_98_4a_f1_6e_af/first_connection/config 22:29:45 [MQTT] Sending MQTT message: {"name": "first_connection", "state_topic": "system-sensors/sensor/mac_36_98_4a_f1_6e_af/state", "value_template": "{{value_json.first_connection}}", "unique_id": "mac_36_98_4a_f1_6e_af_sensor_first_connection", "device": {"identifiers": ["mac_36_98_4a_f1_6e_af_sensor"], "manufacturer": "NetAlertX", "name": "Portainers"}, "icon": "mdi:calendar-start"} 22:29:47 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "059b597cf96c35aab97e174b5dd7d197"} 22:29:47 [MQTT] New sensor entry name : Portainers 22:29:47 [MQTT] New sensor entry mac : 36:98:4a:f1:6e:af 22:29:47 [MQTT] New sensor entry hash_value : 059b597cf96c35aab97e174b5dd7d197 22:29:47 [MQTT] Publishing sensor number 5 22:29:47 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_36_98_4a_f1_6e_af/last_connection/config 22:29:47 [MQTT] Sending MQTT message: {"name": "last_connection", "state_topic": "system-sensors/sensor/mac_36_98_4a_f1_6e_af/state", "value_template": "{{value_json.last_connection}}", "unique_id": "mac_36_98_4a_f1_6e_af_sensor_last_connection", "device": {"identifiers": ["mac_36_98_4a_f1_6e_af_sensor"], "manufacturer": "NetAlertX", "name": "Portainers"}, "icon": "mdi:calendar-end"} 22:29:49 [MQTT] Sending MQTT topic: system-sensors/sensor/mac_36_98_4a_f1_6e_af/state 22:29:49 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.11", "is_new": "1", "vendor": "", "mac_address": "36:98:4a:f1:6e:af", "last_connection": "2024-09-28 19:10:43+02:00", "first_connection": "2024-09-28 19:10:43+02:00"} 22:29:49 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "993836643e489aa6e0c43b465b8c7549"} 22:29:49 [MQTT] New sensor entry name : Portainers 22:29:49 [MQTT] New sensor entry mac : 36:98:4a:f1:6e:af 22:29:49 [MQTT] New sensor entry hash_value : 993836643e489aa6e0c43b465b8c7549 22:29:49 [MQTT] Publishing sensor number 6 22:29:49 [MQTT] Sending MQTT topic: homeassistant/binary_sensor/mac_36_98_4a_f1_6e_af/is_present/config 22:29:49 [MQTT] Sending MQTT message: {"name": "is_present", "state_topic": "system-sensors/binary_sensor/mac_36_98_4a_f1_6e_af/state", "value_template": "{{value_json.is_present}}", "unique_id": "mac_36_98_4a_f1_6e_af_sensor_is_present", "device": {"identifiers": ["mac_36_98_4a_f1_6e_af_sensor"], "manufacturer": "NetAlertX", "name": "Portainers"}, "icon": "mdi:wifi"} 22:29:51 [MQTT] Sending MQTT topic: system-sensors/binary_sensor/mac_36_98_4a_f1_6e_af/state 22:29:51 [MQTT] Sending MQTT message: {"is_present": "ON"} 22:29:51 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "ed9e13f04de47180bd32a4962b52e76b"} 22:29:51 [MQTT] New sensor entry name : Portainers 22:29:51 [MQTT] New sensor entry mac : 36:98:4a:f1:6e:af 22:29:51 [MQTT] New sensor entry hash_value : ed9e13f04de47180bd32a4962b52e76b 22:29:51 [MQTT] Publishing sensor number 7 22:29:51 [MQTT] Sending MQTT topic: homeassistant/device_tracker/mac_36_98_4a_f1_6e_af/config 22:29:51 [MQTT] Sending MQTT message: {"state_topic": "system-sensors/device_tracker/mac_36_98_4a_f1_6e_af/state", "json_attributes_topic": "system-sensors/device_tracker/mac_36_98_4a_f1_6e_af/attributes", "name": "is_home", "payload_home": "home", "payload_not_home": "away", "unique_id": "mac_36_98_4a_f1_6e_af_device_tracker_is_home", "icon": "mdi:home", "device": {"identifiers": ["mac_36_98_4a_f1_6e_af_sensor", "mac_36_98_4a_f1_6e_af_device_tracker_is_home"], "manufacturer": "NetAlertX", "name": "Portainers"}} 22:29:53 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_36_98_4a_f1_6e_af/state 22:29:53 [MQTT] Sending MQTT message: home 22:29:53 [MQTT] Sending MQTT topic: system-sensors/device_tracker/mac_36_98_4a_f1_6e_af/attributes 22:29:53 [MQTT] Sending MQTT message: {"last_ip": "192.168.1.11", "is_new": "1", "vendor": "", "mac_address": "36:98:4a:f1:6e:af", "last_connection": "2024-09-28 19:10:43+02:00", "first_connection": "2024-09-28 19:10:43+02:00"} ```

Second setup: NetAlertX prod - Different volumes

  1. Stopped NetAlertX prod docker stack
  2. Started HA from a backup that never saw MQTT topics from NetAlertX.
  3. Enabled MQTT Publisher in NetAlertX to run always after scan
  4. HA imported only one device, which was newly discovered This was again due to the same issue mentioned in the first setup where NetAlertX thought the devices were already imported
  5. Renamed newly discovered device in NetAlertX, no update for other devices in HA.
  6. Renamed existing device that was previously imported in NetAlertX, devices started appearing in HA.

    Third setup: NetAlertX Dev - Upgraded image from latest prod

  7. Modified docker compose to include the dev image instead of prod and re-pulled the image
  8. Started HA from a backup that never saw MQTT topics from NetAlertX.
  9. Enabled MQTT Publisher in NetAlertX to run always after scan
  10. HA was slowly but surely filling up with devices, 35 out of 36 now :) (Along with the fix for string normalization. This time only the Internet was not imported, same issue as previously mentioned with other devices. After renaming, the Internet device was also imported.

In conclusion, I think that yesterday I got confused when all devices did not appear so I was switching from one docker stack to another, I might have done some mistake during that. Today, I can only confirm that the MQTT does not update the device unless it's removed which I'd consider as a bug. Oh and also, the string normalization works as expected :) Thanks!

jokob-sk commented 1 month ago

Hi,

This behavior is by design to speed up notification processing. I don't consider changing secondary fields and updating them as an issue. The devices can be force updated by removing the Plugin objects associated with the MQTT plugin. I clarified the documentation on the MQTT plugin describing in detail how to force an update on all devices. Hoipe this works:

https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/_publisher_mqtt#forcing-an-update

Let me know if you have any feedback, Thanks, j

NightMean commented 1 month ago

Seems fine to me. Thanks! I'd just modify the readme for HomeAssistant as well to include the information that if a device is deleted from HA, it requires you to force an update of MQTT in NetAlertX. Screenshot just for reference, in case you are not running HA.

image

jokob-sk commented 1 month ago

Good idea - docs updated. 👍

NightMean commented 1 month ago

Looks good to me, thanks!