Comments (4)
Can you try again after restarting home assistant?
from google_assistant_sdk_custom.
I've restarted it multiple times. It works if i write out the exact string like this
trigger:
- platform: event
event_type: google_assistant_sdk_custom_event
id: response
event_data:
request: what temperature is the ac at
what i wanted is to have it take a {{states('input_text.name')}}
as request object so i dont need to hard-code every possible request
from google_assistant_sdk_custom.
I don't think you can have templates in triggers. You can just remove the event_data from your trigger. And you can have if then actions where in the if you can have templates based on trigger.event.data.request
from google_assistant_sdk_custom.
Thank you for your support! i've managed to make it work.
posting the working code if anyone else is struggling to make google home only compatible devices work with HA
UPDATE 11.24.2023: If anyone is having problem with the event not triggering the automation:
I don't know if it's a bug or a rewrite, but after reinstalling the integraton, the automations stopped working. Turns out that the event_type
that would trigger the automation name changed from google_assistant_sdk_custom_event
to google_assistant_sdk_custom_custom_event
. If anyone experiencing the automation not getting triggered by the google_assistant_sdk_custom_event
try adding google_assistant_sdk_custom_custom_event
as a 3rd trigger condition.
here's the updated code:
alias: AC sync
description: >-
This automation is resposible for syncing any non HA change made on a Hisense
smart air conditioning unit, (namely on/off state and target temperature) the
response gets regexed to its core components then gets synced with a dummy
generic thermostat.
trigger:
- platform: event
event_type: automation reloaded
- platform: event
event_type: google_assistant_sdk_custom_custom_event
event_data: {}
condition: []
action:
- choose:
- conditions:
- condition: template
value_template: "{{trigger.event.data.request == 'is the ac on'}}"
alias: Ac state check
sequence:
- alias: regex response and set it as ''state'' variable
variables:
state: "{{trigger.event.data.response|regex_findall_index('on|off')}}"
- alias: choose the on/off service
service_template: >-
{% if state == 'on' %} climate.turn_on {% elif state == 'off' %}
climate.turn_off {% else %} stop {% endif %}
data: {}
target:
entity_id: climate.baja_klima
- conditions:
- alias: Ac temperature check
condition: template
value_template: >-
{{trigger.event.data.request == 'what temperature is the ac set
to' and trigger.event.data.response != 'Sorry, I couldn\'t reach
ConnectLife.' and states('climate.baja_klima') != 'off'}}
- condition: template
value_template: >-
{{state_attr('climate.baja_klima','temperature')|round(0) !=
trigger.event.data.response|regex_findall_index('[0-9]{2}')|round(0)}}
sequence:
- service: climate.set_temperature
data:
temperature: "{{trigger.event.data.response|regex_findall_index('[0-9]{2}')}}"
target:
entity_id: climate.baja_klima
default:
- stop: unhandled exception
mode: single
The second part of the automation:
alias: Baja klíma control
description: >-
This automation makes changes on the Hisense air conditioning unit based on
the dummy Generic thermostat. Also it tries to update thegeneric thermostat
every 5 minutes if there was a change that is not made by HA (I.E using the
remote or the default smart home app)
trigger:
- platform: state
entity_id:
- climate.baja_klima
attribute: temperature
id: temp
- platform: state
entity_id:
- climate.baja_klima
id: "off"
to: "off"
- platform: state
entity_id:
- climate.baja_klima
from: "off"
id: "on"
- platform: time_pattern
minutes: /5
id: time
- platform: event
event_type: automation_reloaded
id: time
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: temp
sequence:
- service: google_assistant_sdk_custom.send_text_command
data:
command: >-
Change klíma temperature to
{{state_attr('climate.baja_klima','temperature')}} C
- conditions:
- condition: trigger
id: "on"
sequence:
- service: google_assistant_sdk_custom.send_text_command
data:
command: turn on Klíma
- conditions:
- condition: trigger
id: "off"
sequence:
- service: google_assistant_sdk_custom.send_text_command
data:
command: turn off Klíma
- conditions:
- condition: trigger
id: time
sequence:
- service: google_assistant_sdk_custom.send_text_command
data:
command: is the ac on
- wait_for_trigger:
- platform: state
entity_id:
- automation.baja_klima_sync
to: "0"
for:
hours: 0
minutes: 0
seconds: 0
attribute: current
timeout:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- service: google_assistant_sdk_custom.send_text_command
data:
command: what temperature is the ac set to
- wait_for_trigger:
- platform: state
entity_id:
- automation.baja_klima_sync
to: "0"
for:
hours: 0
minutes: 0
seconds: 0
attribute: current
timeout:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
mode: single
from google_assistant_sdk_custom.
Related Issues (20)
- Test Script Not Working HOT 10
- Failed to apply patch :( since 2023.9 HOT 1
- There are still cases in which the response is not valid. HOT 4
- Event not triggering and response text is null HOT 2
- Does not work since the update from 2023.10.5 to 2023.11.0b0 HOT 1
- Action which requires Voice Match HOT 1
- Unable to run google-oauthlib-tool HOT 2
- Error setting up entry Google Assistant SDK Custom for google_assistant_sdk_custom HOT 8
- Unable to set device name HOT 7
- event_type changed HOT 1
- Possible issue with multiple listeners HOT 1
- Web Scraping? HOT 1
- Access blocked: This app’s request is invalid HOT 8
- No longer loading after most recent HA update HOT 6
- Failed to apply patch :( since ha 2023.7 HOT 2
- Delete HOT 1
- Specific device actions HOT 1
- Allow personal answers notification disappears after tapping in Android HOT 5
- Parsed tekst is not propery handeld for speech assistant HOT 1
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 google_assistant_sdk_custom.