Comments (5)
There are several ways to get it work, but the easist way might be following:
- add "get_attributes" function
- spec: name: get_attributes description: Get attributes of any home assistant entity parameters: type: object properties: entity_id: type: string description: entity_id required: - entity_id function: type: template value_template: "{{states[entity_id]}}"
- expose your
weather.xxxxxx
entity.
In my case, I had to increase max token to 200 to avoid JsonDecodeError.
I will probably add more examples like this soon.
Reference
from extended_openai_conversation.
This works great for me! I can ask for the forecast today, tomorrow, etc and it works very well.
from extended_openai_conversation.
thanks the max tokens to 200 is what fixed it for me too.
from extended_openai_conversation.
Before this, I exposed entities of weather, humidity, temperature separately for current weather and registered a function for forecasts like below.
- spec:
name: get_weather_forecasts
description: Get the weather forecasts between two dates.
parameters:
type: object
properties:
start:
type: string
description: The start date.
end:
type: string
description: The end date.
required:
- start
- end
function:
type: template
value_template: >
{% set data = states['weather.naver_weather'].attributes['forecast'] | selectattr('datetime', '>=', strptime(start, "%Y-%m-%d")) | selectattr('datetime', '<=', strptime(end + " 23:59:59", "%Y-%m-%d %H:%M:%S")) | list %}
```csv
datetime,templow,temperature,condition,condition_am,condition_pm,rain_rate_am,rain_rate_pm
{% for forecast in data -%}
{{ forecast['datetime'] }},{{ forecast['templow'] }},{{ forecast['temperature'] }},{{ forecast['condition'] }},{{ forecast['condition_am'] }},{{ forecast['condition_pm'] }},{{ forecast['rain_rate_am'] }},{{ forecast['rain_rate_pm'] }}
{% endfor -%}
```
from extended_openai_conversation.
Feel free to reopen the issue.
from extended_openai_conversation.
Related Issues (20)
- Calendar: Ask about specific events HOT 2
- Google Search Error HOT 6
- Custom Functions & Retrival of Documents, Notes... with PrivateGPT or Anything LLM HOT 5
- llama_cpp.server -- Input should be [...] and 500 Internal Server Error HOT 2
- Example Function "is_valid_entity" verifies given entity_ids if they are exposed, visible, etc.
- Expose service to call AI assistant to generate message in automatisation (Feature) HOT 1
- [Feature Request] Make helper function is_exposed() more available
- Something went wrong. Service call requested response data but did not match any entities. HOT 7
- What "expected_output" for open interpreter?
- Converting Llama3/Ollama to CrewAI creates an unusable (and angry) LLM
- No context history HOT 5
- Internet Access? HOT 8
- panic: Unrecognized schema: map[] HOT 6
- "Unexpected exception" error during integration suggests a problem with the OpenAI server URL
- Something went wrong service sensor.read not found HOT 2
- [Request] Schedule things ("turn off fan in 20 minutes") HOT 1
- Blocking call to open inside event loop warnings on 2024.6 dev HOT 2
- get_attributes function only pulls current day from weather.forecast_home HOT 1
- How to upgrade to gpt-4o HOT 5
- Migrate to native LLM API support in Home Assistant
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from extended_openai_conversation.