Closed ILiveInAHouse closed 5 months ago
I am not famliar with pyscript, however I suggest as a starting point that you enable debug logging for Chime TTS in order to review the full logs. This should allow you to understand:
chime_tts.say
serviceTo turn on debug logging:
Change the logging level for Chime TTS:
service: logger.set_level
data:
custom_components.chime_tts: debug
With debug logging enabled, call the pyrscript which in turn calls the chime_tts.say
service.
Check your log for Chime TTS messages:
https://{YOUR_HOME_ASSISTANT_ADDRESS}:8123/config/logs?filter=chime_tts
and click LOAD FULL LOGS
Thanks.. here's the log. I must not be formatting the data section of the service call correctly.
2024-01-29 10:37:45.068 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v0.13.0 ----- 2024-01-29 10:37:45.072 DEBUG (MainThread) [custom_components.chime_tts.helpers] ----- General Parameters ----- 2024-01-29 10:37:45.073 DEBUG (MainThread) [custom_components.chime_tts.helpers] entity_ids = [] 2024-01-29 10:37:45.073 DEBUG (MainThread) [custom_components.chime_tts.helpers] cache = False 2024-01-29 10:37:45.073 DEBUG (MainThread) [custom_components.chime_tts.helpers] offset = 450.0 2024-01-29 10:37:45.073 DEBUG (MainThread) [custom_components.chime_tts.helpers] final_delay = 0.0 2024-01-29 10:37:45.073 DEBUG (MainThread) [custom_components.chime_tts.helpers] tts_playback_speed = 100.0 2024-01-29 10:37:45.073 DEBUG (MainThread) [custom_components.chime_tts.helpers] announce = False 2024-01-29 10:37:45.073 DEBUG (MainThread) [custom_components.chime_tts.helpers] volume_level = -1.0 2024-01-29 10:37:45.073 DEBUG (MainThread) [custom_components.chime_tts.helpers] join_players = False 2024-01-29 10:37:45.073 DEBUG (MainThread) [custom_components.chime_tts.helpers] * unjoin_players = False 2024-01-29 10:37:45.074 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path
Now I'm on the right track with some additional debugging I added to helpers.py. This is what the syntax should look like from pyscript:
service.call("chime_tts", "say",
entity_id="media_player.entrywalltablet",
chime_path="custom_chime_path_2",
offset=0,
volume_level=1,
message="Not Ready",
tts_platform="google_translate",
gender="female")
Solution found above https://github.com/nimroddolev/chime_tts/issues/75#issuecomment-1915839484
Checklist
Is your feature request related to a problem? Please describe.
I can't figure out how to call the chime_tts.say service from within pyscript. I'm not getting any errors, but I'm also not getting any audio from the media_player. Specifically, I don't think I'm indicating the target/entity_id properly. Here is what I've tried:
This is the yaml in Developer->Services that does work (produces audio):
Any idea how to make the call from pyscript?
Describe the solution you'd like
I need help with the pyscript call.
Describe alternatives you've considered
I also tried
Additional context
I'm not getting any related errors in the system log.