GPTastic is a Home Assistant add-on that acts as a bridge between MQTT, OpenAI, and Home Assistant entities. It listens for incoming MQTT messages, forwards those messages to the OpenAI API for processing, validates the response, and then updates a Home Assistant entity based on the result.
The add-on is designed to integrate AI-driven decisions into Home Assistant automations in a structured and predictable way.
If you find this project useful, consider supporting it:
Or visit: https://www.buymeacoffee.com/mailmartins
At a high level, GPTastic:
- Subscribes to an MQTT topic
- Receives messages from Home Assistant or external systems
- Sends those messages to the OpenAI API
- Requires the AI to respond in a strict CSV format:
entity_name,value - Validates the response format
- Updates the specified Home Assistant entity with the provided value
This allows AI-generated decisions or text to be safely consumed by Home Assistant automations.
- The GPTastic add-on starts.
- It subscribes to the MQTT topic:
gptastic/incoming
- An MQTT client publishes a message to the Home Assistant MQTT broker.
- The message is sent on:
gptastic/incoming
Example payload:
Will it be sunny tomorrow morning in Pretoria at around 7 ? Only respond with gptastic_usebattery,No or gptastic_usebattery,Yes
- GPTastic receives the MQTT message.
- It sends the message to the OpenAI API.
- GPTastic instructs the AI to respond only in the following CSV format:
entity_name,value
Example response:
gptastic_usebattery,No
- GPTastic receives the AI response.
- It verifies that:
- The response is valid CSV
- Exactly two values are present
- The first value is an entity name
- The second value is the entity state or value
Invalid responses are rejected.
- GPTastic uses the validated CSV data.
- It updates the Home Assistant entity specified in the response.
- The entity state is set to the provided value.
Example result:
sensor.gptastic_usebattery = No
MQTT Input
Will it be sunny tomorrow morning in Pretoria at around 7 ? Only respond with gptastic_usebattery,No or gptastic_usebattery,Yes
AI Response
gptastic_usebattery,Yes
Home Assistant Result
sensor.gptastic_usebatteryis set toYes- Automations can act on this value
MQTT Input
Decide which operating mode the system should use tomorrow.
AI Response
gptastic_mode,eco
Home Assistant Result
sensor.gptastic_modeis set toeco
GPTastic enables controlled use of AI-generated decisions inside Home Assistant by:
- Receiving prompts over MQTT
- Delegating reasoning to OpenAI
- Enforcing strict response formatting
- Updating Home Assistant entities safely
This makes it suitable for automation scenarios where AI output must remain predictable and structured.