Parent/child app

Google amazon polly
You can register for free then make you own to download
Thatā€™s what I did

Andy

1 Like

Thanks. Will take a peek.

You can also use webCoRE to play the mp3's. Works great!

Yes, we're using AWS polly, and yes the very first TTS rendering of a given string will have to be fetched from them, but after that it's returned from local cache...

and even the first request is super fast...

4 Likes

Thanks. I appreciate I can do it with webCoRE.
I just need some mp3 phrases to load on to a RPi (hopefully it will work) and then I'm off and running. (Hopefully. :wink: )

Or.. you could use mp3 event player :slight_smile:

Brilliant!

1 Like

This (post 33) and This (post 35) is still an issue and has stalled the porting of BigTalker.

I need to correct this. The BigTalker2 parent app's TalkNow function works and that's it, until I can resolve the issues mentioned in post 33 and 35.

I can't tell from your posts exactly what your problem is.

I don't know if references to parent,state.x from a child work, I've never seen that before. All of the apps I know about call methods in parent or child to communicate.

So please be more explicit for me as to just what it is that is not working for you.

Child App:
log.trace("Updating settings (Parent Version: ${parent?.state?.appversion}; Child Version: ${state.appversion}; Group Enabled: ${state.groupEnabled})")

Returns:
Updating settings (Parent Version: null; Child Version: C2.0.2; Group Enabled: true)

Expected:
Updating settings (Parent Version: P2.0.2; Child Version: C2.0.2; Group Enabled: true)
This variable is set in the parent app with the following: state.appversion = "P2.0.2" and ideally should be available to the child app(s).
Instead, the child receives null when it queries this variable (and others) from the parent.

So tests like the following are not working when called within the child app:
Line 980 (referenced in the error below):
return (parent?.settings?.speechModesDefault.contains(location.mode)) //True if we are in an allowed Default mode, False if not

Log shows the following for a BT2 scheduled event:
java.lang.NullPointerException: Cannot invoke method contains() on null object on line 980 (onSchedule1Event)

So it appears, a child app is not able to query variables of the parent app. I can do this in the other platform, but not in this one.

Like I said, Iā€™ve never seen this before. Is it documented in ST or just something that you discovered?

Why donā€™t you just use a method to return the value? RM does the same thing, but uses a method.

I don't know that it's documented. It does work there though.

I suppose I could try using a method, but BT is thousands of lines of code with several references between parent/child variables, so I'm trying to port with minimal amount of code changes if possible. I'd like to just add a Hubitat/ST detection and adjust minimally as required otherwise things get heavily fragmented and for a free/hobby app with no staff or other help that just becomes a big chore.

1 Like

Well, a method is going to work on both platforms.

UPDATE: Resolved.. See post 4 at the link below for the working parent function to return setting/state variables to a child app. I'm sure this could be improved, but it's working for me.


@bravenel and/or anyone else that may be able to offer advise..

I'm super close on resolving the parent/child variable issue but have run into an issue I am not sure how to resolve. The parent method/function returning data to the child app is mostly working; however dates are being returned as strings and then when compared with timeOfDayIsBetween() an error is thrown. I'm not sure how to detect/cast these to date/datetime.

I'm moving discussion on this particular issue here under a topic of it's own:

Do we use the same git hub location for Bigtalker rayzurblock ?

Yes, but use the Hubitat-Dev branch.
https://github.com/rayzurbock/BigTalker2/tree/Hubitat-Dev

It's not currently working with Sonos due to lack of playTextAndRestore() and playTextAndResume() functions in the Hubitat driver. You may be able to port a custom Sonos driver and resolve that.
See this thread for the discussion on that: https://community.hubitat.com/clicks/track?url=https%3A%2F%2Fcommunity.hubitat.com%2Ft%2Fsonos-playtrackandrestore-missing%2F2314&post_id=21686&topic_id=2285

I've had confirmations of it working on some other speakers though. So, if it works for you, please post that info and what speaker and driver you are using.

I use LanAnnouncer so this should work then right ?

What's the Allow Personality setting rayzurback ?

Yes, but make sure on install that you set the slider to the option for speechSynthesis (slider to the off position I believe)

1 Like