The documentation page for the Logger integration provides the log entry format description as below.
The log entries are in the form
timestamp log-level thread [namespace ] message
where namespace is the <component_namespace> currently logging.
I have log entries that look like this (for example):
2023-01-16 19:40:02.338 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140686398752560] Received {'type': 'get_config', 'id': 15}
I appreciate homeassistant.components.websocket_api.http.connection
is the namespace, so I’m then understanding from the documentation that the following is then the “message”:
[140686398752560] Received {'type': 'get_config', 'id': 15}
What I would like to know is what is the [140686398752560]
specifically? These seem to be specific, generally, to messages in the example namespace (homeassistant.components.websocket_api.http.connection
) and it is likely the answer will help with my troubleshooting (to which these example are not necessarily related).
What I know/guess…
- The same square bracketed numbers in the message appears several times, so its not a UUID for the message.
- From the below example set of messages for what I believe is the same integration using the websocket, two different values occur so the numbers in question aren’t an ID for the integration either.
2023-01-16 21:06:20.062 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140685444209136] Sending {"id":283,"type":"event","event":{"event_type":"state_changed","data":{"entity_id":"sensor.grid_import_wh_accumulated","old_state":{"entity_id":"sensor.grid_import_wh_accumulated","state":"51955.6","attributes":{"state_class":"total","last_reset":"2023-01-16T21:05:00","type":"Output","last_update":"2023-01-16T13:05:30+00:00","unit_of_measurement":"Wh","device_class":"energy","friendly_name":"grid_import.wh Accumulated"},"last_changed":"2023-01-16T13:05:49.032176+00:00","last_updated":"2023-01-16T13:05:49.032176+00:00","context":{"id":"01GPXAZ6Z8N5DM307KRBH2AJ7Q","parent_id":null,"user_id":null}},"new_state":{"entity_id":"sensor.grid_import_wh_accumulated","state":"51960.1","attributes":{"state_class":"total","last_reset":"2023-01-16T21:05:30","type":"Output","last_update":"2023-01-16T13:06:00+00:00","unit_of_measurement":"Wh","device_class":"energy","friendly_name":"grid_import.wh Accumulated"},"last_changed":"2023-01-16T13:06:20.051517+00:00","last_updated":"2023-01-16T13:06:20.051517+00:00","context":{"id":"01GPXB058KG854R3DZNP8VF6R3","parent_id":null,"user_id":null}}},"origin":"LOCAL","time_fired":"2023-01-16T13:06:20.051517+00:00","context":{"id":"01GPXB058KG854R3DZNP8VF6R3","parent_id":null,"user_id":null}}}
2023-01-16 21:06:20.063 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140685444209136] Sending {"id":283,"type":"event","event":{"event_type":"state_changed","data":{"entity_id":"sensor.gridexport_wh_accumulated","old_state":{"entity_id":"sensor.gridexport_wh_accumulated","state":"168871.4","attributes":{"state_class":"total","last_reset":"2023-01-16T21:05:00","type":"Output","last_update":"2023-01-16T13:05:30+00:00","unit_of_measurement":"Wh","device_class":"energy","friendly_name":"GridExport.wh Accumulated"},"last_changed":"2023-01-16T11:40:17.424818+00:00","last_updated":"2023-01-16T13:05:49.032366+00:00","context":{"id":"01GPXAZ6Z8BJHBWWEMCPWSR0HQ","parent_id":null,"user_id":null}},"new_state":{"entity_id":"sensor.gridexport_wh_accumulated","state":"168871.4","attributes":{"state_class":"total","last_reset":"2023-01-16T21:05:30","type":"Output","last_update":"2023-01-16T13:06:00+00:00","unit_of_measurement":"Wh","device_class":"energy","friendly_name":"GridExport.wh Accumulated"},"last_changed":"2023-01-16T11:40:17.424818+00:00","last_updated":"2023-01-16T13:06:20.051695+00:00","context":{"id":"01GPXB058KX0GPBJGZYK1H6XCP","parent_id":null,"user_id":null}}},"origin":"LOCAL","time_fired":"2023-01-16T13:06:20.051695+00:00","context":{"id":"01GPXB058KX0GPBJGZYK1H6XCP","parent_id":null,"user_id":null}}}
2023-01-16 21:06:20.063 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140685444209136] Sending {"id":283,"type":"event","event":{"event_type":"state_changed","data":{"entity_id":"sensor.gridimport_wh_accumulated","old_state":{"entity_id":"sensor.gridimport_wh_accumulated","state":"51656.1","attributes":{"state_class":"total","last_reset":"2023-01-16T21:05:00","type":"Output","last_update":"2023-01-16T13:05:30+00:00","unit_of_measurement":"Wh","device_class":"energy","friendly_name":"GridImport.wh Accumulated"},"last_changed":"2023-01-16T13:05:49.032959+00:00","last_updated":"2023-01-16T13:05:49.032959+00:00","context":{"id":"01GPXAZ6Z8BPZH2JVTMNVXF8M4","parent_id":null,"user_id":null}},"new_state":{"entity_id":"sensor.gridimport_wh_accumulated","state":"51660.6","attributes":{"state_class":"total","last_reset":"2023-01-16T21:05:30","type":"Output","last_update":"2023-01-16T13:06:00+00:00","unit_of_measurement":"Wh","device_class":"energy","friendly_name":"GridImport.wh Accumulated"},"last_changed":"2023-01-16T13:06:20.051874+00:00","last_updated":"2023-01-16T13:06:20.051874+00:00","context":{"id":"01GPXB058KK9V2WW44ETBMJHRY","parent_id":null,"user_id":null}}},"origin":"LOCAL","time_fired":"2023-01-16T13:06:20.051874+00:00","context":{"id":"01GPXB058KK9V2WW44ETBMJHRY","parent_id":null,"user_id":null}}}
2023-01-16 21:06:20.064 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140685444209136] Sending {"id":283,"type":"event","event":{"event_type":"state_changed","data":{"entity_id":"sensor.totalconsumption_wh_accumulated","old_state":{"entity_id":"sensor.totalconsumption_wh_accumulated","state":"100094.5","attributes":{"state_class":"total","last_reset":"2023-01-16T21:05:00","type":"Output","last_update":"2023-01-16T13:05:30+00:00","unit_of_measurement":"Wh","device_class":"energy","friendly_name":"TotalConsumption.wh Accumulated"},"last_changed":"2023-01-16T13:05:49.033144+00:00","last_updated":"2023-01-16T13:05:49.033144+00:00","context":{"id":"01GPXAZ6Z9KFN0PEZ3BCXJA3SH","parent_id":null,"user_id":null}},"new_state":{"entity_id":"sensor.totalconsumption_wh_accumulated","state":"100099.0","attributes":{"state_class":"total","last_reset":"2023-01-16T21:05:30","type":"Output","last_update":"2023-01-16T13:06:00+00:00","unit_of_measurement":"Wh","device_class":"energy","friendly_name":"TotalConsumption.wh Accumulated"},"last_changed":"2023-01-16T13:06:20.052046+00:00","last_updated":"2023-01-16T13:06:20.052046+00:00","context":{"id":"01GPXB058MGSRPJA8DXRSCMY3A","parent_id":null,"user_id":null}}},"origin":"LOCAL","time_fired":"2023-01-16T13:06:20.052046+00:00","context":{"id":"01GPXB058MGSRPJA8DXRSCMY3A","parent_id":null,"user_id":null}}}
2023-01-16 21:06:20.064 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140686398752560] Sending {"id":7,"type":"event","event":{"c":{"sensor.grid":{"+":{"s":"539","lc":1673874380.046953,"c":"01GPXB058E5KGQZFD98H97FQ4X"}}}}}
2023-01-16 21:06:20.064 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140686398752560] Sending {"id":13,"type":"event","event":{"event_type":"state_changed","data":{"entity_id":"sensor.grid","old_state":{"entity_id":"sensor.grid","state":"552","attributes":{"state_class":"measurement","type":"Input","channel":1,"unit_of_measurement":"W","device_class":"power","friendly_name":"Grid"},"last_changed":"2023-01-16T13:05:49.028457+00:00","last_updated":"2023-01-16T13:05:49.028457+00:00","context":{"id":"01GPXAZ6Z43J6JZR6GG1AJEEXQ","parent_id":null,"user_id":null}},"new_state":{"entity_id":"sensor.grid","state":"539","attributes":{"state_class":"measurement","type":"Input","channel":1,"unit_of_measurement":"W","device_class":"power","friendly_name":"Grid"},"last_changed":"2023-01-16T13:06:20.046953+00:00","last_updated":"2023-01-16T13:06:20.046953+00:00","context":{"id":"01GPXB058E5KGQZFD98H97FQ4X","parent_id":null,"user_id":null}}},"origin":"LOCAL","time_fired":"2023-01-16T13:06:20.046953+00:00","context":{"id":"01GPXB058E5KGQZFD98H97FQ4X","parent_id":null,"user_id":null}}}
2023-01-16 21:06:20.065 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140686398752560] Sending {"id":7,"type":"event","event":{"c":{"sensor.grid_wh":{"+":{"s":"-28670","lc":1673874380.047326,"c":"01GPXB058F7BC77BTV690PNPER"}}}}}