diff --git a/homeassistant/components/webhook/__init__.py b/homeassistant/components/webhook/__init__.py index 84ebdaddad0..04332166c60 100644 --- a/homeassistant/components/webhook/__init__.py +++ b/homeassistant/components/webhook/__init__.py @@ -7,6 +7,7 @@ import voluptuous as vol from homeassistant.components import websocket_api from homeassistant.components.http.view import HomeAssistantView +from homeassistant.components.http.const import KEY_REAL_IP from homeassistant.const import HTTP_OK from homeassistant.core import callback from homeassistant.loader import bind_hass @@ -71,7 +72,14 @@ async def async_handle_webhook(hass, webhook_id, request): # Always respond successfully to not give away if a hook exists or not. if webhook is None: - _LOGGER.warning("Received message for unregistered webhook %s", webhook_id) + peer_ip = request[KEY_REAL_IP] + _LOGGER.warning( + "Received message for unregistered webhook %s from %s", webhook_id, peer_ip + ) + # Look at content to provide some context for received webhook + # Limit to 64 chars to avoid flooding the log + content = await request.content.read(64) + _LOGGER.debug("%s...", content) return Response(status=HTTP_OK) try: