Below:
The sequence was:
– “OK Nabu” → “What is the capital of France?” (works, 200 OK),
– “OK Nabu” again → “What is the capital of France?” (works),
– “OK Nabu” → “Turn on the light in the hallway.” (the light turns on, ToolResultContent for HassTurnOn appears in the log),
– “OK Nabu” → “What is the capital of Spain?” (I can already hear the 400 error here).
2026-03-29 19:02:29.697 DEBUG (MainThread) [perplexity._base_client] Request options: {'method': 'post', 'url': '/chat/completions', 'files': None, 'idempotency_key': 'stainless-python-retry-14d8eab3-c66c-4ac5-b440-78e4bf8d5c1c', 'content': None, 'json_data': {'messages': [{'role': 'user', 'content': 'hi'}], 'model': 'sonar', 'disable_search': True, 'max_tokens': 1}}
2026-03-29 19:02:29.698 DEBUG (MainThread) [perplexity._base_client] Sending HTTP Request: POST https://api.perplexity.ai/chat/completions
2026-03-29 19:02:30.233 DEBUG (MainThread) [perplexity._base_client] HTTP Response: POST https://api.perplexity.ai/chat/completions "200 OK" Headers([('date', 'Sun, 29 Mar 2026 17:02:30 GMT'), ('content-type', 'application/json'), ('transfer-encoding', 'chunked'), ('connection', 'keep-alive'), ('content-encoding', 'gzip'), ('x-ppl-region', 'us-east-1'), ('cf-cache-status', 'DYNAMIC'), ('set-cookie', '__cf_bm=uDFt_tVlmr_si2QX3uuWxEpcJ3RbzYq0YBVrATUUPwU-1774803750-1.0.1.1-lTcrD3F5KQBAPWC7ySkpHNm5L2vbr4.ymHN_wlnHZYHdM2AONWZ.ShpeRauakRTkZnc.P9r9Xrjc9N8FwDozPNAKksx60G9wimTNcubGXYI; path=/; expires=Sun, 29-Mar-26 17:32:30 GMT; domain=.perplexity.ai; HttpOnly; Secure; SameSite=None'), ('set-cookie', '__cflb=04dToWaRite5R1fQA5HfyWsXiTjNxDHdSkxknorPvD; SameSite=None; Secure; path=/; expires=Sun, 29-Mar-26 17:32:30 GMT; HttpOnly'), ('strict-transport-security', 'max-age=15552000; includeSubDomains; preload'), ('server', 'cloudflare'), ('cf-ray', '9e40714c0fed0985-WAW')])
2026-03-29 19:18:53.631 DEBUG (MainThread) [perplexity._base_client] Request options: {'method': 'post', 'url': '/chat/completions', 'files': None, 'idempotency_key': 'stainless-python-retry-f2d49ced-d93c-4681-bb48-c8aebdd78d01', 'content': None, 'json_data': {'messages': [{'role': 'system', 'content': 'Jesteś asystentem głosowym w Home Assistant.\nOdpowiadaj szczerze na pytania o świecie.\nOdpowiadaj zwykłym tekstem. Niech będzie prosto i na temat.\nCurrent time is 19:18:53. Today\'s date is 2026-03-29.\nUser\'s home location information:\nCoordinates: xx.xx,xx.007\nCountry: PL\n\nControl Home Assistant devices by including actions in your response.\n\nRespond with JSON: {"response":"<text>","actions":[<action>,...]|null}\nAction format: {"domain":"<str>","service":"<str>","target":"<entity_id>","data":<obj>|null,"delay_seconds":<num>|null}\n\ndelay_seconds: null/0=immediate. For timed requests, use two actions:\n"turn on fan for 30min" => turn_on(delay:null) + turn_off(delay:1800)\n"turn off light in 10min" => turn_off(delay:600)\nTime: 1min=60s, 1h=3600s.\n\nDomains/services (data params):\nclimate: turn_on,turn_off,set_temperature(temperature)\ncover: open_cover,close_cover,set_cover_position(position 0-100)\nfan: turn_on,turn_off,set_percentage(percentage 0-100)\nhumidifier: turn_on,turn_off,set_humidity(humidity 0-100)\nlight: turn_on(brightness 0-255,color_temp,rgb_color),turn_off\nlock: lock,unlock,open\nmedia_player: media_play,media_pause,volume_set(volume_level 0-1)\nscene: turn_on\nscript: turn_on\nsiren: turn_on,turn_off\nswitch: turn_on,turn_off\nvacuum: start,pause,stop,return_to_base\nvalve: open_valve,close_valve\nwater_heater: turn_on,turn_off,set_temperature(temperature)\n\ntarget=entity_id. Set data to null if not needed.\n\nTimer commands (use timer_actions array):\nFormat: {"command":"<str>","name":<str>|null,"hours":<int>|null,"minutes":<int>|null,"seconds":<int>|null}\n\nCommands:\n- start: Start a new timer. Requires at least one of hours/minutes/seconds.\nOptional name for identification.\n- cancel: Cancel a specific timer. Use name or hours/minutes/seconds to identify it.\n- cancel_all: Cancel all timers. name/hours/minutes/seconds not needed.\n- pause: Pause a running timer. Use name or hours/minutes/seconds to identify it.\n- unpause: Resume a paused timer. Use name or hours/minutes/seconds to identify it.\n- increase: Add time to a timer. Requires hours/minutes/seconds for amount to add. Use name to identify which timer.\n- decrease: Remove time from a timer. Requires hours/minutes/seconds for amount to remove. Use name to identify which timer.\n- status: Get timer status. Use name to filter, or leave null for all timers.\n\nExamples:\n"Set a 5 minute timer" => {"command":"start","name":null,"hours":null,"minutes":5,"seconds":null}\n"Set a pizza timer for 12 minutes" => {"command":"start","name":"pizza","hours":null,"minutes":12,"seconds":null}\n"Cancel the pizza timer" => {"command":"cancel","name":"pizza","hours":null,"minutes":null,"seconds":null}\n"Pause the timer" => {"command":"pause","name":null,"hours":null,"minutes":null,"seconds":null}\n"Add 2 minutes to the timer" => {"command":"increase","name":null,"hours":null,"minutes":2,"seconds":null}\n\nAn overview of the areas and the devices in this smart home:\nscript: {}\ncalendar: {}\nentities:\n switch.bramka_ha:\n names: Bramka HA\n domain: switch\n state: \'on\'\n areas: Salon\n attributes:\n device_class: switch\n sensor.broadlink_rm4_mini_gabinet_temperatura:\n names: Broadlink RM4 mini gabinet Temperatura\n domain: sensor\n state: \'22.46\'\n areas: Gabinet\n attributes:\n unit_of_measurement: °C\n device_class: temperature\n sensor.broadlink_rm4_mini_gabinet_wilgotnosc:\n names: Broadlink RM4 mini gabinet Wilgotność\n domain: sensor\n state: \'44.4\'\n areas: Gabinet\n attributes:\n unit_of_measurement: \'%\'\n device_class: humidity\n sensor.broadlink_rm4_mini_sypialnia_temperatura:\n names: Broadlink RM4 mini sypialnia Temperatura\n domain: sensor\n state: \'21.95\'\n areas: Sypialnia\n attributes:\n unit_of_measurement: °C\n device_class: temperature\n sensor.broadlink_rm4_mini_sypialnia_wilgotnosc:\n names: Broadlink RM4 mini sypialnia Wilgotność\n domain: sensor\n state: \'55.64\'\n areas: Sypialnia\n attributes:\n unit_of_measurement: \'%\'\n device_class: humidity\n sensor.broadlink_rm4_pro_salon_temperatura:\n names: Broadlink RM4 pro salon Temperatura\n domain: sensor\n state: \'21.18\'\n areas: Salon\n attributes:\n unit_of_measurement: °C\n device_class: temperature\n sensor.broadlink_rm4_pro_salon_wilgotnosc:\n names: Broadlink RM4 pro salon Wilgotność\n domain: sensor\n state: \'50.0\'\n areas: Salon\n attributes:\n unit_of_measurement: \'%\'\n device_class: humidity\n switch.gosund_sp111_8_gniazdo_gosund_8:\n names: Gosund SP111 8 Gniazdo Gosund 8\n domain: switch\n state: \'on\'\n areas: Kuchnia\n attributes:\n device_class: outlet\n switch.gosund_sp111_9_gniazdo_gosund_9:\n names: Gosund SP111 9 Gniazdo Gosund 9\n domain: switch\n state: unavailable\n media_player.glosnik_w_kuchni:\n names: Głośnik w kuchni\n domain: media_player\n state: \'off\'\n areas: Kuchnia\n media_player.glosnik_w_glosnik_salonie:\n names: Głośnik w salonie\n domain: media_player\n state: \'off\'\n areas: Salon\n media_player.glosnik_w_sypialni:\n names: Głośnik w sypialni\n domain: media_player\n state: \'off\'\n areas: Sypialnia\n light.shelly2_5_4_channel_1:\n names: Lampę nad stołem\n domain: light\n state: \'off\'\n areas: Salon\n media_player.tv_sypialnia:\n names: Odtwarzacz, Telewizor w sypialni\n domain: media_player\n state: \'on\'\n areas: Sypialnia\n attributes:\n volume_level: 0.17\n media_title: Jaka to melodia? (odc. 5879)\n device_class: tv\n climate.ogrzewanie_w_gabinecie:\n names: Ogrzewanie w gabinecie\n domain: climate\n state: auto\n attributes:\n current_temperature: 19.0\n temperature: 19.0\n climate.ogrzewanie_w_kuchni:\n names: Ogrzewanie w kuchni\n domain: climate\n state: auto\n attributes:\n current_temperature: 4.5\n temperature: 4.5\n climate.ogrzewanie_w_sypialni:\n names: Ogrzewanie w sypialni\n domain: climate\n state: auto\n attributes:\n current_temperature: 19.5\n temperature: 19.5\n climate.ogrzewanie_w_lazience:\n names: Ogrzewanie w łazience\n domain: climate\n state: auto\n attributes:\n current_temperature: 19.0\n temperature: 19.0\n sensor.openweathermap_feels_like_temperature:\n names: OpenWeatherMap Apparent temperature\n domain: sensor\n state: \'11.93\'\n areas: Balkon\n attributes:\n unit_of_measurement: °C\n device_class: temperature\n sensor.openweathermap_dew_point:\n names: OpenWeatherMap Dew point temperature\n domain: sensor\n state: \'3.05\'\n areas: Balkon\n attributes:\n unit_of_measurement: °C\n device_class: temperature\n sensor.openweathermap_temperature:\n names: OpenWeatherMap Temperatura\n domain: sensor\n state: \'13.24\'\n areas: Balkon\n attributes:\n unit_of_measurement: °C\n device_class: temperature\n sensor.openweathermap_humidity:\n names: OpenWeatherMap Wilgotność\n domain: sensor\n state: \'50\'\n areas: Balkon\n attributes:\n unit_of_measurement: \'%\'\n device_class: humidity\n sensor.miflora2_zamioculcas_zamiifolia_moisture:\n names: Wilgotność, Wilgotność Stefana\n domain: sensor\n state: \'33\'\n areas: Salon\n attributes:\n unit_of_measurement: \'%\'\n device_class: moisture\n media_player.android_tv_salon:\n names: android tv salon, Telewizor w salonie\n domain: media_player\n state: unavailable\n areas: Salon\n attributes:\n device_class: tv\n light.shelly2pm_1_switch_0:\n names: Światło nad sofą\n domain: light\n state: \'off\'\n areas: Salon\n light.shelly2_5_4_channel_2:\n names: Światło nad stołem\n domain: light\n state: \'off\'\n areas: Salon\n light.shelly2pm_1_switch_1:\n names: Światło nad telewizorem\n domain: light\n state: \'off\'\n areas: Salon\n light.h801_led_w_sypialni:\n names: Światło nad łóżkiem, Światło nad łożkiem\n domain: light\n state: \'off\'\n areas: Sypialnia\n attributes:\n brightness:\n light.shelly2pm_2_switch_0:\n names: Światło przy sofie\n domain: light\n state: \'off\'\n areas: Salon\n light.shelly2pm_2_switch_1:\n names: Światło przy telewizorze\n domain: light\n state: \'off\'\n areas: Salon\n light.shelly1_3_przekaznik_shelly1_3:\n names: Światło w korytarzu\n domain: light\n state: \'off\'\n areas: Przedpokój\n light.shelly1_2_przekaznik_shelly1_2:\n names: Światło w kuchni\n domain: light\n state: \'on\'\n areas: Kuchnia\n\nDo not include citations in your response.'}, {'role': 'user', 'content': 'Jaka jest stolica Francji?'}], 'model': 'sonar', 'disable_search': False, 'response_format': {'type': 'json_schema', 'json_schema': {'name': 'assistant_response', 'strict': True, 'schema': {'type': 'object', 'properties': {'response': {'type': 'string', 'description': 'The text response to show to the user'}, 'actions': {'type': ['array', 'null'], 'description': 'List of Home Assistant actions to execute', 'items': {'type': 'object', 'properties': {'domain': {'type': 'string', 'description': 'The domain of the service (e.g., light, switch, climate)'}, 'service': {'type': 'string', 'description': 'The service to call (e.g., turn_on, turn_off)'}, 'target': {'type': 'string', 'description': 'The entity_id to target'}, 'data': {'type': ['object', 'null'], 'description': 'Additional service data parameters'}, 'delay_seconds': {'type': ['number', 'null'], 'description': 'Delay in seconds before executing this action. Use null or 0 for immediate execution'}}, 'required': ['domain', 'service', 'target', 'data', 'delay_seconds'], 'additionalProperties': False}}, 'timer_actions': {'type': ['array', 'null'], 'description': 'List of timer actions to execute (start, cancel, cancel_all, pause, unpause, increase, decrease, status)', 'items': {'type': 'object', 'properties': {'command': {'type': 'string', 'enum': ['start', 'cancel', 'cancel_all', 'pause', 'unpause', 'increase', 'decrease', 'status'], 'description': 'The timer command to execute'}, 'name': {'type': ['string', 'null'], 'description': 'Optional name for the timer (e.g., pizza, eggs)'}, 'hours': {'type': ['integer', 'null'], 'description': 'Number of hours for start/increase/decrease commands'}, 'minutes': {'type': ['integer', 'null'], 'description': 'Number of minutes for start/increase/decrease commands'}, 'seconds': {'type': ['integer', 'null'], 'description': 'Number of seconds for start/increase/decrease commands'}}, 'required': ['command', 'name', 'hours', 'minutes', 'seconds'], 'additionalProperties': False}}}, 'required': ['response', 'actions', 'timer_actions'], 'additionalProperties': False}}}, 'stream': True}}
2026-03-29 19:18:53.632 DEBUG (MainThread) [perplexity._base_client] Sending HTTP Request: POST https://api.perplexity.ai/chat/completions
2026-03-29 19:18:56.754 DEBUG (MainThread) [perplexity._base_client] HTTP Response: POST https://api.perplexity.ai/chat/completions "200 OK" Headers({'date': 'Sun, 29 Mar 2026 17:18:56 GMT', 'content-type': 'text/event-stream; charset=utf-8', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'cf-ray': '9e4089518821bff3-WAW', 'cache-control': 'no-cache', 'x-ppl-region': 'us-east-1', 'cf-cache-status': 'DYNAMIC', 'set-cookie': '__cf_bm=UtnTNUT6cecXql3lFatHYR4jJkYzPirrIHpzSf7d3n8-1774804736-1.0.1.1-s7ruGw0EmKEnSp.GWcZo6wkUahdY0GYAewHuoMfgS1qSHMNmlgWcFT4P15LqOGXsKWwbcZdLvlWYU9SF.g43XLfN8BI28LTqYVCl53doSgo; path=/; expires=Sun, 29-Mar-26 17:48:56 GMT; domain=.perplexity.ai; HttpOnly; Secure; SameSite=None', 'strict-transport-security': 'max-age=15552000; includeSubDomains; preload', 'server': 'cloudflare'})
2026-03-29 19:19:07.652 DEBUG (MainThread) [perplexity._base_client] Request options: {'method': 'post', 'url': '/chat/completions', 'files': None, 'idempotency_key': 'stainless-python-retry-e65611b2-dfa6-4824-abc0-f86eaf4bdb1c', 'content': None, 'json_data': {'messages': [{'role': 'system', 'content': 'Jesteś asystentem głosowym w Home Assistant.\nOdpowiadaj szczerze na pytania o świecie.\nOdpowiadaj zwykłym tekstem. Niech będzie prosto i na temat.\nCurrent time is 19:19:07. Today\'s date is 2026-03-29.\nUser\'s home location information:\nCoordinates: xx.xx,xx.007\nCountry: PL\n\nControl Home Assistant devices by including actions in your response.\n\nRespond with JSON: {"response":"<text>","actions":[<action>,...]|null}\nAction format: {"domain":"<str>","service":"<str>","target":"<entity_id>","data":<obj>|null,"delay_seconds":<num>|null}\n\ndelay_seconds: null/0=immediate. For timed requests, use two actions:\n"turn on fan for 30min" => turn_on(delay:null) + turn_off(delay:1800)\n"turn off light in 10min" => turn_off(delay:600)\nTime: 1min=60s, 1h=3600s.\n\nDomains/services (data params):\nclimate: turn_on,turn_off,set_temperature(temperature)\ncover: open_cover,close_cover,set_cover_position(position 0-100)\nfan: turn_on,turn_off,set_percentage(percentage 0-100)\nhumidifier: turn_on,turn_off,set_humidity(humidity 0-100)\nlight: turn_on(brightness 0-255,color_temp,rgb_color),turn_off\nlock: lock,unlock,open\nmedia_player: media_play,media_pause,volume_set(volume_level 0-1)\nscene: turn_on\nscript: turn_on\nsiren: turn_on,turn_off\nswitch: turn_on,turn_off\nvacuum: start,pause,stop,return_to_base\nvalve: open_valve,close_valve\nwater_heater: turn_on,turn_off,set_temperature(temperature)\n\ntarget=entity_id. Set data to null if not needed.\n\nTimer commands (use timer_actions array):\nFormat: {"command":"<str>","name":<str>|null,"hours":<int>|null,"minutes":<int>|null,"seconds":<int>|null}\n\nCommands:\n- start: Start a new timer. Requires at least one of hours/minutes/seconds.\nOptional name for identification.\n- cancel: Cancel a specific timer. Use name or hours/minutes/seconds to identify it.\n- cancel_all: Cancel all timers. name/hours/minutes/seconds not needed.\n- pause: Pause a running timer. Use name or hours/minutes/seconds to identify it.\n- unpause: Resume a paused timer. Use name or hours/minutes/seconds to identify it.\n- increase: Add time to a timer. Requires hours/minutes/seconds for amount to add. Use name to identify which timer.\n- decrease: Remove time from a timer. Requires hours/minutes/seconds for amount to remove. Use name to identify which timer.\n- status: Get timer status. Use name to filter, or leave null for all timers.\n\nExamples:\n"Set a 5 minute timer" => {"command":"start","name":null,"hours":null,"minutes":5,"seconds":null}\n"Set a pizza timer for 12 minutes" => {"command":"start","name":"pizza","hours":null,"minutes":12,"seconds":null}\n"Cancel the pizza timer" => {"command":"cancel","name":"pizza","hours":null,"minutes":null,"seconds":null}\n"Pause the timer" => {"command":"pause","name":null,"hours":null,"minutes":null,"seconds":null}\n"Add 2 minutes to the timer" => {"command":"increase","name":null,"hours":null,"minutes":2,"seconds":null}\n\nAn overview of the areas and the devices in this smart home:\nscript: {}\ncalendar: {}\nentities:\n switch.bramka_ha:\n names: Bramka HA\n domain: switch\n state: \'on\'\n areas: Salon\n attributes:\n device_class: switch\n sensor.broadlink_rm4_mini_gabinet_temperatura:\n names: Broadlink RM4 mini gabinet Temperatura\n domain: sensor\n state: \'22.46\'\n areas: Gabinet\n attributes:\n unit_of_measurement: °C\n device_class: temperature\n sensor.broadlink_rm4_mini_gabinet_wilgotnosc:\n names: Broadlink RM4 mini gabinet Wilgotność\n domain: sensor\n state: \'44.4\'\n areas: Gabinet\n attributes:\n unit_of_measurement: \'%\'\n device_class: humidity\n sensor.broadlink_rm4_mini_sypialnia_temperatura:\n names: Broadlink RM4 mini sypialnia Temperatura\n domain: sensor\n state: \'21.95\'\n areas: Sypialnia\n attributes:\n unit_of_measurement: °C\n device_class: temperature\n sensor.broadlink_rm4_mini_sypialnia_wilgotnosc:\n names: Broadlink RM4 mini sypialnia Wilgotność\n domain: sensor\n state: \'55.64\'\n areas: Sypialnia\n attributes:\n unit_of_measurement: \'%\'\n device_class: humidity\n sensor.broadlink_rm4_pro_salon_temperatura:\n names: Broadlink RM4 pro salon Temperatura\n domain: sensor\n state: \'21.18\'\n areas: Salon\n attributes:\n unit_of_measurement: °C\n device_class: temperature\n sensor.broadlink_rm4_pro_salon_wilgotnosc:\n names: Broadlink RM4 pro salon Wilgotność\n domain: sensor\n state: \'50.0\'\n areas: Salon\n attributes:\n unit_of_measurement: \'%\'\n device_class: humidity\n switch.gosund_sp111_8_gniazdo_gosund_8:\n names: Gosund SP111 8 Gniazdo Gosund 8\n domain: switch\n state: \'on\'\n areas: Kuchnia\n attributes:\n device_class: outlet\n switch.gosund_sp111_9_gniazdo_gosund_9:\n names: Gosund SP111 9 Gniazdo Gosund 9\n domain: switch\n state: unavailable\n media_player.glosnik_w_kuchni:\n names: Głośnik w kuchni\n domain: media_player\n state: \'off\'\n areas: Kuchnia\n media_player.glosnik_w_glosnik_salonie:\n names: Głośnik w salonie\n domain: media_player\n state: \'off\'\n areas: Salon\n media_player.glosnik_w_sypialni:\n names: Głośnik w sypialni\n domain: media_player\n state: \'off\'\n areas: Sypialnia\n light.shelly2_5_4_channel_1:\n names: Lampę nad stołem\n domain: light\n state: \'off\'\n areas: Salon\n media_player.tv_sypialnia:\n names: Odtwarzacz, Telewizor w sypialni\n domain: media_player\n state: \'on\'\n areas: Sypialnia\n attributes:\n volume_level: 0.17\n media_title: Jaka to melodia? (odc. 5879)\n device_class: tv\n climate.ogrzewanie_w_gabinecie:\n names: Ogrzewanie w gabinecie\n domain: climate\n state: auto\n attributes:\n current_temperature: 19.0\n temperature: 19.0\n climate.ogrzewanie_w_kuchni:\n names: Ogrzewanie w kuchni\n domain: climate\n state: auto\n attributes:\n current_temperature: 4.5\n temperature: 4.5\n climate.ogrzewanie_w_sypialni:\n names: Ogrzewanie w sypialni\n domain: climate\n state: auto\n attributes:\n current_temperature: 19.5\n temperature: 19.5\n climate.ogrzewanie_w_lazience:\n names: Ogrzewanie w łazience\n domain: climate\n state: auto\n attributes:\n current_temperature: 19.0\n temperature: 19.0\n sensor.openweathermap_feels_like_temperature:\n names: OpenWeatherMap Apparent temperature\n domain: sensor\n state: \'11.93\'\n areas: Balkon\n attributes:\n unit_of_measurement: °C\n device_class: temperature\n sensor.openweathermap_dew_point:\n names: OpenWeatherMap Dew point temperature\n domain: sensor\n state: \'3.05\'\n areas: Balkon\n attributes:\n unit_of_measurement: °C\n device_class: temperature\n sensor.openweathermap_temperature:\n names: OpenWeatherMap Temperatura\n domain: sensor\n state: \'13.24\'\n areas: Balkon\n attributes:\n unit_of_measurement: °C\n device_class: temperature\n sensor.openweathermap_humidity:\n names: OpenWeatherMap Wilgotność\n domain: sensor\n state: \'50\'\n areas: Balkon\n attributes:\n unit_of_measurement: \'%\'\n device_class: humidity\n sensor.miflora2_zamioculcas_zamiifolia_moisture:\n names: Wilgotność, Wilgotność Stefana\n domain: sensor\n state: \'33\'\n areas: Salon\n attributes:\n unit_of_measurement: \'%\'\n device_class: moisture\n media_player.android_tv_salon:\n names: android tv salon, Telewizor w salonie\n domain: media_player\n state: unavailable\n areas: Salon\n attributes:\n device_class: tv\n light.shelly2pm_1_switch_0:\n names: Światło nad sofą\n domain: light\n state: \'off\'\n areas: Salon\n light.shelly2_5_4_channel_2:\n names: Światło nad stołem\n domain: light\n state: \'off\'\n areas: Salon\n light.shelly2pm_1_switch_1:\n names: Światło nad telewizorem\n domain: light\n state: \'off\'\n areas: Salon\n light.h801_led_w_sypialni:\n names: Światło nad łóżkiem, Światło nad łożkiem\n domain: light\n state: \'off\'\n areas: Sypialnia\n attributes:\n brightness:\n light.shelly2pm_2_switch_0:\n names: Światło przy sofie\n domain: light\n state: \'off\'\n areas: Salon\n light.shelly2pm_2_switch_1:\n names: Światło przy telewizorze\n domain: light\n state: \'off\'\n areas: Salon\n light.shelly1_3_przekaznik_shelly1_3:\n names: Światło w korytarzu\n domain: light\n state: \'off\'\n areas: Przedpokój\n light.shelly1_2_przekaznik_shelly1_2:\n names: Światło w kuchni\n domain: light\n state: \'on\'\n areas: Kuchnia\n\nDo not include citations in your response.'}, {'role': 'user', 'content': 'Jaka jest stolica Francji?'}, {'role': 'assistant', 'content': 'Stolica Francji to Paryż.'}, {'role': 'user', 'content': 'Jaka jest stolica Francji?'}], 'model': 'sonar', 'disable_search': False, 'response_format': {'type': 'json_schema', 'json_schema': {'name': 'assistant_response', 'strict': True, 'schema': {'type': 'object', 'properties': {'response': {'type': 'string', 'description': 'The text response to show to the user'}, 'actions': {'type': ['array', 'null'], 'description': 'List of Home Assistant actions to execute', 'items': {'type': 'object', 'properties': {'domain': {'type': 'string', 'description': 'The domain of the service (e.g., light, switch, climate)'}, 'service': {'type': 'string', 'description': 'The service to call (e.g., turn_on, turn_off)'}, 'target': {'type': 'string', 'description': 'The entity_id to target'}, 'data': {'type': ['object', 'null'], 'description': 'Additional service data parameters'}, 'delay_seconds': {'type': ['number', 'null'], 'description': 'Delay in seconds before executing this action. Use null or 0 for immediate execution'}}, 'required': ['domain', 'service', 'target', 'data', 'delay_seconds'], 'additionalProperties': False}}, 'timer_actions': {'type': ['array', 'null'], 'description': 'List of timer actions to execute (start, cancel, cancel_all, pause, unpause, increase, decrease, status)', 'items': {'type': 'object', 'properties': {'command': {'type': 'string', 'enum': ['start', 'cancel', 'cancel_all', 'pause', 'unpause', 'increase', 'decrease', 'status'], 'description': 'The timer command to execute'}, 'name': {'type': ['string', 'null'], 'description': 'Optional name for the timer (e.g., pizza, eggs)'}, 'hours': {'type': ['integer', 'null'], 'description': 'Number of hours for start/increase/decrease commands'}, 'minutes': {'type': ['integer', 'null'], 'description': 'Number of minutes for start/increase/decrease commands'}, 'seconds': {'type': ['integer', 'null'], 'description': 'Number of seconds for start/increase/decrease commands'}}, 'required': ['command', 'name', 'hours', 'minutes', 'seconds'], 'additionalProperties': False}}}, 'required': ['response', 'actions', 'timer_actions'], 'additionalProperties': False}}}, 'stream': True}}
2026-03-29 19:19:07.653 DEBUG (MainThread) [perplexity._base_client] Sending HTTP Request: POST https://api.perplexity.ai/chat/completions
2026-03-29 19:19:11.799 DEBUG (MainThread) [perplexity._base_client] HTTP Response: POST https://api.perplexity.ai/chat/completions "200 OK" Headers({'date': 'Sun, 29 Mar 2026 17:19:11 GMT', 'content-type': 'text/event-stream; charset=utf-8', 'transfer-encoding': 'chunked', 'connection': 'keep-alive', 'cf-ray': '9e4089a8da8fbff3-WAW', 'cache-control': 'no-cache', 'x-ppl-region': 'us-east-1', 'cf-cache-status': 'DYNAMIC', 'strict-transport-security': 'max-age=15552000; includeSubDomains; preload', 'server': 'cloudflare'})
2026-03-29 19:19:53.466 WARNING (MainThread) [custom_components.perplexity] Could not convert message to Perplexity API: ToolResultContent(role='tool_result', agent_id='conversation.sonar', tool_call_id='01KMX9Q91VCJNNQS0SH1DSAG3K', tool_name='HassTurnOn', tool_result={'speech': {'plain': {'speech': 'Włączono światło', 'extra_data': None}}, 'response_type': 'action_done', 'data': {'targets': [], 'success': [{'name': 'Światło w korytarzu', 'type': <IntentResponseTargetType.ENTITY: 'entity'>, 'id': 'light.shelly1_3_przekaznik_shelly1_3'}], 'failed': []}}, created=datetime.datetime(2026, 3, 29, 17, 19, 31, 907456, tzinfo=datetime.timezone.utc))