Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

[SCENE] Smart Message Hub {v1.2} - NEW RELEASE


AutoFrank

Question

Hi Everyone

 

Smart Message Hub v1.2 (SMsgH v1.2) is now available.

This release includes fixes tor three bugs that had various impacts and support for international characters.

Thanks to @Sankotronic and @szmyk for locating the faults and extra feature for international characters

 

"FIRST TIME USERS" -  Please read below and follow the instructions laid out for first time users

UPGRADING FROM 1.1b to 1.2 - Please use this

Please login or register to see this link.

 - if you are a current user and may wish to consider  avail of the fixes or extra feature

 

This scene enables a user to send a message from either a scene or a virtual device to a number of notification and TTS services with a startScene call

Please login or register to see this code.

The scene also enables messages to be re-routed or queued depending on whether the house is set to Away mode, Sleep mode or if internet is not available. (See below for more details)

 

A demo  VD {v1.1} is also available to help demonstrate the scene features.

 

SCENE FEATURES

Smart Configuration options include the ability to re-route and/or queue all messages under certain conditions. (Internet unavailability , home occupancy mode presentState = Away)

Messages with international characters are also supported

  • Notification messages can be redirected to Home Center 2 Popup notification service if the internet is offline or unavailable
  • Notification messages can be queued if the internet is offline or unavailable. 
    • All Messages in the queue will be released as one combined message once the internet come s back online.
  • All TTS messages can be redirected to Home Center 2 Popup notification service if the internet is unavailable or offline or if the sonosAPI is offline if this solution is being leveraged
    • All TTS messages can be queued if presentsState = Away. 
  • All TTS messages in the queue will be announced once presentsState = Home
  • Simplified the message invocation method to startScene
    • Invoked via startScene(SMsgHid, {message string} (SMsgHid is the id of the SMsgH scene when it is saved to your system )
    • See below for examples
    • messageHub global no longer required (please delete when you have migrated all your scenes to using 1.1)
  • Added support for sleepState (no TTS messages if set to Sleep)
  • Additional support for HC2 popup notifications
    • Types (Critical, Successs, Info, Warning)
    • Images (use full url)
    • Buttons (represented as a table) - See @Sankotronic 

      Please login or register to see this link.

      on popup notifications to see how to format
    • Added ability to delay unloading of TTS messages by predefined time in seconds
    • Added support for custom language in for TTS and Notify redirects default Popup title and subtitle
    • Minor bug fixing and code cleaning

 

Configuration options also include a default message notification target, title, subtitle and volume but all these can also be specified as part of the message invocation.

There are three levels of debug verbosity. In normal mode there is a minimal amount of information displayed as the scene is triggered.

The two other modes allow for much more expressive displaying of scene variables as well as configuration settings if enabled

deBgVar is enabled in the scene so you can see the interactions- it can be disabled in normal running mode

 

SCENE MESSAGING OPTIONS
The supported services in this release include the following (supported in 1.0 & 1.1)

  • Pushover Notifications ------------------------------------------------------->  

    Please login or register to see this link.

  • allinone ( jompa68 scene)
  • Telegram messages
  • hc2email (Home Center 2 email service) 
  • hc2push (Home Center 2 push notification service)
  • hc2popup (Home Center 2 Popup Notification service) -------------------> [TUTORIAL}

    Please login or register to see this link.

     
  • Sonos-api based TTS -------------------------------------------------------->  [TUTORIAL] 

    Please login or register to see this link.

  • Sonos VD Remote based TTS ----------------------------------------------->

    Please login or register to see this link.

 

I have also included a Companion Demo VD. The virtual device will allow the user to demonstrate the scenes queuing/unloading capabilities.

CAUTION: The companion VD in demo mode can adjust the presentState and sleepState globals and will cause any other scene you may have with this as a trigger to execute

 

A simplified version of the LAN Monitor VD called  the WWWAPI Monitor will monitor just the sonos-api if desired and does not any in-built notification options like the LAN Monitor VD 2.5.Smart Message Hub users should use either the WWWAPI Monitor or LAN Monitor 2.6

 

Special thanks extended to  @Sankotronic @petergebruers, @jompa68 and @szmyk for their contributions leading to 1.2

 

Once the scene configuration is complete I would recommend running the demonstration virtual device.

This will give you a better understanding of the options and features as well providing some sample messages that you can run.

 

Ideas for subsequent revisions are always welcome
_f

    
  RELEASE CHANGELOG
  v1.0  - First release (march 4th 2017)

  v1.1 - Second release (march 17th 2017)

  v1.2 - Third Release (june 24th 2017) 

 

 

                                                                            ================================================

                                                                             FIRST TIME USERS - INSTALLATION & CONFIGURATION

                                                                            ================================================
The code is available in both lua and txt format below

Paste code into scene and run - All global variables will be automatically created (Please do not adjust global triggers in scene header)

  • Configure options as required at top of scene (line 100 onwards)
  • Configure enable smart redirects
  • Configure HC2 email settings, HC2 push settings and TTS services
  • Configure default message titles, subtitles and volume
  • Configuration notification settings, tokens, etc
  • Enable/Disable increased debug and config verbosity for troubleshooting

  
MESSAGE INVOCATION
  This message hub can be called from either a scene or a virtual device using a startScene call. The following is an example Sample invocations are included below

Please see the section on Message Invocation lower down in this post of you wish to send messages with international characters

Please login or register to see this code.

Note: Replace IDofSMsgHscene with HomeTable reference of numerical ID of the SMsgH scene when it is installed on your system    

You need to include all parameters up to last one you populate. For example, if you want to specify a subtitle, you need to include message, target, volume and title as well.

You CANNOT leave out a parameter in the call. Leave as "" if not used/required and default will be invoked.

 

**USER CONFIGURATIONS & SETTINGS**


OPTIONS FOR SMART RE-ROUTING OF MESSAGES
The following four options can be set to true or false depending on what features you wish to enable.

Please login or register to see this code.

Set to true to enables re-routing of sonos TTS messages from either the Sonos VD or the sonos-api solution to HC2 notification Popup if the sonos-http-api or Internet is unavailable/offline to your local LAN  

Please login or register to see this code.

Enable to Silence  TTS announcement in sleepState, TTS announcements are NOT queued, they are simply discarded

Please login or register to see this code.

 

Enable a Delay before TTS announcements are unloaded (seconds). Leave as "" for no delay

Please login or register to see this code.

 

Set to true to enable Sonos TTS messages to queue when presentState = 'Away'. When presentState is set to Home it triggers the scene to automatically unload all the messages in the TTS queue to the default player that has been named in the configuration section  

Please login or register to see this code.

Set to true to enable all notifications to re-route to HC2Popup notifications if the internet is unavailable/offline to your local LAN  

Please login or register to see this code.

Set to true to enable all notifications to queue when presentState= 'Away'. When presentState is set to Home it triggers the scene automatically and unloads the message in the notifications queue to the default notification service that has been named in the configuration section below

 

The scene as provided has all these 4 options set to true and this is the recommended setup if you wish to leverage full functionality and the demo
  
OPTIONS TO MONITOR THE INTERNET STATUS
To achieve the most benefit from this scene the internet and sonos-api should be dynamically monitored. Dynamically monitoring the internet will enable messages (TTS and notifications) to be queued while the internet if offline. Queued message can also be sent as hc2 pop notifications on the local LAN. The preferred monitoring option is named here. The example below is setup to use the LAN Monitor VD 2.5

Please login or register to see this code.

There are 3 options available: 

  • Select 'manual' if you wish internet and sonos-api to be permanently set to online. Please 
  • note that this option does NOT enable queuing of notification messages.
  • Select 'networkTable' to leverage the LAN Monitor VD 2.5, 
  • Select 'wwwapiTable' to leverage the new simplified WWWAPI Monitor 1.0

                               
 

HC2 EMAIL CONFIGURATION

Please login or register to see this code.

List all users that you want to be able send messages to. The user id's are located from the HC2. Select Configuration, then Access Control to see the current users.

 

 

HC2 PUSH CONFIGURATION

Please login or register to see this code.

List all users that you want to be able send push messages to. The mobile devices ID can be found by going to http://<HC_IP>/docs/ and looking under iosDevices section. 

Please login or register to see this code.

Select a default user from this list and this is used if there is no user specified as part of the message invocation. 

                               
 

TTS PREFERENCES

Select your TTS preference. If you use the sonos-http-api solution please enter API. 
If you use the Sonos VD Remote solution please enter REM. 

Please login or register to see this code.

Default volume for TTS announcements

Please login or register to see this code.

This allows you to select a default volume and this aplies to both the API and REM sonos solutions. This volume can be changed by including a different volume in the message invocation

 

 

SONOS-API PREFERENCES
Configure this section if you have selected API in the above section.

Please login or register to see this code.

List all the sonos players you want to send TTS messages to.

The zone/player names must match exactly what is on your sonos native application

Please login or register to see this code.

The default player/zone selected is used to unload the TTS message when presentState = Home.

The default player must be included in the overall players list above

Please login or register to see this code.

                          

The ip address and port are of the device that is hosting the sonos-api

Please login or register to see this code.

The final item here is the language or voice code for the respective TTS service. Thisoculd be something like en-gb for google or Amy for AWS Polly
                                 

 

SONOS REMOTE VD PREFERENCES
Configure this section if you have selected REM in the above section.

Please login or register to see this code.

List all the sonos player virtual devices you want to send TTS messages to. The virtual device id's and process button id’s much match exactly what is on your HC2 for each virtual device. Please note the process button may differ if you have modified the standard virtual device. 

Please login or register to see this code.

The default player/zone is user to unload the TTS message when presentState = Home.

This zone must be included in the overall REMplayers table and the name must match exactly.

Please login or register to see this code.

The final item in this section is the language or voice code for the respective TTS service

 

 

DEFAULT TITLES AND SUBTITLES

This scene has default titles and subtitles and these are used if no title or subtitle is included in the message invocation. 

Please login or register to see this code.

Adjust the default titles and subtitles as you require. Note: Subtitles are only used for PopUp Notifications

 

 

NOTIFICATION SERVICES
There is a broad range of notification services available to use. Some are native to the home center and others are third party services provided by external vendors.

Please login or register to see this code.

                               
Select the default notification service that you wish to use. This default service will be used if no service is invoked in the message and is also used as the service to unload the queued messages when presentState = Home

 

 

PUSHOVER CONFIGURATION
This service is provided by pushover.org. You will need to register with them and obtain a token and user key.

Please login or register to see this code.

     
Once registered you will need to select the devices that you wish to send the pushover notifications to. Once they are added to your pushover account you will need to add their details below. Currently there is only one setting for device which means that all messages to pushover will be send to the devices named in this list. Priority can be set at ) like I have below

Please login or register to see this code.

                                  
TELEGRAM CONFIGURATION
This service is provided by telegram.org. You will need to register with them and obtain a token and a chat ID

Please login or register to see this code.

DEBUG VERBOSITY OPTIONS
This allows a number of levels of debug verbosity. There is a minimal amount of debug window responses running in normal mode but these two capabilities allow the user to observe extra information in the debug window when  the scene is running. 

Please login or register to see this code.

 

OCCUPANCY/PRESENCE STATE

I am also supporting the presentState as it is defined by Sankotronic and others.
-- "PresentState" is predefined global value that determines if you are at home
-- or away. This variable value is set by other scene or VD. Enter name of your
-- global variable between "" if called different or leave as it is

Please login or register to see this code.

-- Enter corresponding values that you use for presence in your language. Change
-- the one in quotes or leave as it is

Please login or register to see this code.


HOMETABLE
There is also support for the hometable solution. Hometable is a approach to storing all device ID in a global variable. Please Uncomment the following line if you wish to use Hometable data in scene

Please login or register to see this code.

 

 

POPUP MESSAGE TYPES

Default popup message type, possible values: Success, Info, Warning, Critical.

Please define popup message default popup type, button caption and buttons if you wish

These defaults can be left as is or modified/translated into your own language 

Please login or register to see this code.

Please refer to Sankotronic Tutorial "Popup Notifications and Custom Images" for format and examples

 

POPUP REDIRECT TITLES AND SUBTITLES

Please amend the text sent to PopUp Notification when Internet or TTS is offline to your own language if you wish. Both Title and subtitle can be modified

Please login or register to see this code.

 
SAMPLE MESSAGE INVOCATIONS
The message function can be invoked with as little as one parameter or as many as five parameters. The following examples will provide a good understanding. 
 
Send message to default notification service, with default titles/subtitles

Please login or register to see this code.

Send message to specific notification service
(The notification service must match exactly what is contained in the notifySve table in the variables section)

Please login or register to see this code.

(The hc2user in the message invocation must match exactly what is contained in the hc2emailUsers table in the user configuration section)

Please login or register to see this code.

(The hc2push device in the message invocation must match exactly what is contained in the hc2emailUsers table in the user configuration section)

Please login or register to see this code.

(The sonos player name in the message invocation must match exactly what is contained in either the APIplayers or REMplayers table in the user configuration section)

 

The target can also specify sonos player or VD id for TTS with options

Please login or register to see this code.

Custom titles and subtitles can also be specified. These will overwrite the default titles and subtitles. Subtitles are only available for HC2 Popup notifications. They can be used with or with a target notification. If the target is omitted it will send to the default notification service that has been named in the configuration section

Please login or register to see this code.

Finally an example of a Message to popup with specified popup type

 

Please login or register to see this code.

 

MESSAGE WITH INTERNATIONAL CHARACTERS

 

If you want to send message with special characters just use urlencode function:

Please login or register to see this code.

Please login or register to see this code.

 

COMPANION DEMONSTRATION VD INSTRUCTIONS (1.1)

A number of sample notification and TTS messages can be activated  giving the user an understanding of the message invocation format and options
Demonstration mode enabled the toggling of 'Internet online/offline', presentState Home/Away, sleepState Sleep/Awake modes. This capability allows the used to observe the queuing and unloading of queued notification messages and TTS messages in action. 

 

Import the VD into your home center 2.

Review the messages and adjust based on your own implementation of Smart Message Hub
Send messages and TTS as required
To demonstrate the queuing and unload of queue’s

  1. Set demo mode to ON. 
  2. Send messages and TTS and observe in selected notification services and apps, 
  3. Set internet to offline, sent messages and observe queuing, 
  4. Set internet to online, observer unloading of queue. 
  5. Set presetState to Away, send messages and observe queuing. 
  6. Set presentState to Home and observe unloading of queue. 
  7. Set sleepState to Sleep and observe TTS are silenced. 
  8. For normal operation - set Demo mode to OFF

 

 

FILES

[Smart Message Hub SCENE]  

Please login or register to see this attachment.

    (lua file)

 

WWWAPI Monitor Virtual Device

[VIRTUAL DEVICE] 

Please login or register to see this attachment.

 

Companion Virtual Device

[VIRTUAL DEVICE] 

Please login or register to see this attachment.

  

Edited by AutoFrank
Link to comment
Share on other sites

Recommended Posts

  • 0
  • Inquirer
  • 27 minutes ago, Hoggle said:

    Yes, I am missing the "1"  for sonos api....

     

    Here ist my start-code:

    Please login or register to see this code.

    Please login or register to see this link.

    Please login or register to see this attachment.

     

     

    hi @Hoggle

     

    have you configured the SMH to use the WWWAPI ?

    I also noticed that there is a slight spelling difference between the player in the VD (Kuche) and your message call (Kueche)

    The SMH looks for literal matching 

    Link to comment
    Share on other sites

    • 0

    I set SMH to:

    Please login or register to see this code.

    The spelling difference is only for the label of the VD.

     

    I will test another text and another Player...

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 18 minutes ago, Hoggle said:

    I set SMH to:

    Please login or register to see this code.

    The spelling difference is only for the label of the VD.

     

    I will test another text and another Player...

     

     

    Hi @Hoggle

     

    Thanks

    Let me know how you get on.

     

    The other two settingst that impact TTS is sleepState and presentState depending on how you have the system setup

     

    with 'tts2sleep = true' => sleepState = Sleep will silence all TTS 

    with 'tts2queue = true' => presentState = Away will cause all TTS to queue (from the screenshot you sent on it doesn't appear to be queuing)

     

    If you still have difficulties could you PM me the message hub invocation scene/vd and your full SMH so I can see the whole setup

     

    BR

    -f

     

     

     

    Edited by AutoFrank
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 11 hours ago, AutoFrank said:

     

    Hi @Hoggle

     

    Thanks

    Let me know how you get on.

     

    The other two settingst that impact TTS is sleepState and presentState depending on how you have the system setup

     

    with 'tts2sleep = true' => sleepState = Sleep will silence all TTS 

    with 'tts2queue = true' => presentState = Away will cause all TTS to queue (from the screenshot you sent on it doesn't appear to be queuing)

     

    If you still have difficulties could you PM me the message hub invocation scene/vd and your full SMH so I can see the whole setup

     

    BR

    -f

     

     

     

     

    @Hoggle

     

    Glad we got it sorted ..

     

    enjoy

    -f

     

    Link to comment
    Share on other sites

    • 0

     @AutoFrank

     

    very cool tool.

     

    Can you also implement - with further upgrades - the SayAll-TTS-function (for Sonos-API)?

     

    Hoggle

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 30 minutes ago, Hoggle said:

     @AutoFrank

     

    very cool tool.

     

    Can you also implement - with further upgrades - the SayAll-TTS-function (for Sonos-API)?

     

    Hoggle

     @Hoggle

     

    Thanks 

    I'll add it to the list...

     

    Btw- You should take a look at the presets function of the api If you haven't already 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 11 hours ago, AutoFrank said:

    the SayAll-TTS-function

     

     

    @Hoggle

     

    I was thinking about this afterwards and came across a possible issue - volume

    Just providing an option to send a SayAll instead of a Say may not be enough..

    I have never used SayAll but I assume it will either send the SayAll with one volume level for all players or the volume that is currently set on the players.

    I have a spread of Sonos models (from the play1, 3, 5 to the connect and connect amp) and they all need a different volume setting to 'announce' at the same level

     

    I'd appreciate your thoughts..

    -f

     

     

     

     

    Link to comment
    Share on other sites

    • 0

    @AutoFrank,

     

    im using Sonos Playbar, 1 and 5 with SayAll and with the sanme volumelevel. That works fine. There is no big difference.

    But you are right. the Sonos AMP needs a higher volumelevel. But my AMP is more offline than online.....

    Therefore,  I am happy with only one volumelevel for SayAll

     

    Hoggle

     

    Link to comment
    Share on other sites

    • 0


    Slight problem with hc2popup images, and types...

    regardless of if I set type to "Success" or "Critical" the info below comes out (it did change to a red popup on critical though!)

    and the popimg just doesn't work

     


    [DEBUG] 13:56:06: main function triggered
    [DEBUG] 13:56:06: Message String: 1 -- Good Morning Shaun.. Quietly get up!
    [DEBUG] 13:56:06: Message String: 2 -- hc2popup
    [DEBUG] 13:56:06: Message String: 3 -- 20
    [DEBUG] 13:56:06: Message String: 4 -- Shaun Wakeup
    [DEBUG] 13:56:06: Message String: 5 --
    [DEBUG] 13:56:06: Message String: 6 -- Critical
    [DEBUG] 13:56:06: Message String: 7 -- http://192.168.1.179/fibaro/icons/scena/User1004.png
    [DEBUG] 13:56:06: Message String: 8 --
    [DEBUG] 13:56:06: Warning: Popup Type did not match, default Popup Type used
    [DEBUG] 13:56:06: == VARIABLES ==
    [DEBUG] 13:56:06: Message: Good Morning Shaun.. Quietly get up!
    [DEBUG] 13:56:06: Title: Shaun Wakeup
    [DEBUG] 13:56:06: Subtitle: Event
    [DEBUG] 13:56:06: Target: hc2popup
    [DEBUG] 13:56:06: Message Type: notify
    [DEBUG] 13:56:06: Message Service: hc2popup
    [DEBUG] 13:56:06: TTS Volume: 20
    [DEBUG] 13:56:06: Internet State: 1
    [DEBUG] 13:56:06: Sonos API State:
    [DEBUG] 13:56:06: Occupancy State: Home
    [DEBUG] 13:56:06: Sleep State: Awake
    [DEBUG] 13:56:06: Unload Notify Q: false
    [DEBUG] 13:56:06: Unload TTS Q: false
    [DEBUG] 13:56:06: .....end of variables
    [DEBUG] 13:56:06: Info: HC2 Popup notification sent

    Link to comment
    Share on other sites

    • 0
    2 hours ago, shaunfrost said:


    Slight problem with hc2popup images, and types...

    regardless of if I set type to "Success" or "Critical" the info below comes out (it did change to a red popup on critical though!)

    and the popimg just doesn't work

     

     

    ok move the end from line 599 up to 595 as its catching the pMatch value every time round the loop I think..

    Something is still going wrong with popup images, I think some places its popimg and some its popimage.. trying to track it down now...

    33 minutes ago, shaunfrost said:

     

    ok move the end from line 599 up to 595 as its catching the pMatch value every time round the loop I think..

    Something is still going wrong with popup images, I think some places its popimg and some its popimage.. trying to track it down now...

     

    line 783 should be popimg

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thanks @shaunfrost

     

    The poptype should be working okay as I did a lot of testing on that and I'm reasonably sure the matching/logic on that should be solid

    The image I didn't test too much as it was a late add but I'll take a look at both later.

     

    -f

    Link to comment
    Share on other sites

    • 0
    1 minute ago, AutoFrank said:

    Thanks @shaunfrost

     

    The poptype should be working okay as I did a lot of testing on that and I'm reasonably sure the matching/logic on that should be solid

    The image I didn't test too much as it was a late add but I'll take a look at both later.

     

    -f

    its working, but your debug line gets written out.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 5 minutes ago, shaunfrost said:

    its working, but your debug line gets written out.

     

     

     

     

    @shaunfrost, sorry, just leaving work now .. didn't catch all your post :oops:,

    I'll make that correction... I'll take a look at the poptype as I thought I had that correct.

     

    Thanks for tracking it it down.

     

    BTW - I found one more bug on the buttons (when deBugVar echo tries to display a table thinking its a string) ..

    I'm thinking I might patch these couple of parts and upload a 1.1b (with instructions on what lines to change so 1.1 users can get the fixes as well)..

     

    ... anyway thanks again for chasing and sorry for the bugs :-(

     

    -f

     

     

     

     

     

     

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Please login or register to see this code.

    Hi @shaunfrost

    I did some testing this evening and good catch with the imagepop the should have been popimg on line 783.

     

    Please login or register to see this attachment.

     

    I'll add a note to the first post as well should anybody else encounter the issue but will also add a modded 1.1b

    The custom images now work okay.

     

     

    I'm still a bit puzzled why the popup types didn't popup.

    It was a bit tricky to code and I recall testing all variations.

    I did the same this evening and all passed okay 

     

    This is the sample code I used

     

    Please login or register to see this code.

    and the results all came back okay

     

    Please login or register to see this attachment.

     

    I took a look at that part of the code where you made the change and I think you should change it back as it's needed

    I'll explain what it is doing and you should see that its needed

     

    Please login or register to see this attachment.

     

    the popup type is passed through the 6 table entry

    line 586 - checks if it hasn't been sent as part of the message invocation

      -> if not then it sets it as default 

    Please login or register to see this code.

    else

        sets a tracking variable 'pMatch = false' ( as I need to check twice more)

     

    line 591 - checks what is sent in the invocation and tries to match it against whats in the table at line 319

    Please login or register to see this code.

    It needs to match exactly or else the popup notification won't work

       -> If it gets a match then it takes what was passed in the invocation jMsg[6] as being valid and a assigns that to poptype

       -> pMatch gets set to true and we're done

       -> If it can't confirm a match then pMatch is still false and moves to the third loop  

     

    This can happen if somebody mis-spells [Waring] or gets the case wrong [success]  in the invocation

      -> If this happens it sets the type to default type

     

    If you keep the change in then it won't pick up if you mis-spell a custom type

     

    This negative check is one of my test cases and I included it again this evening.

    You can see it in the second screenshot in on the second. I mi-spelled critical ( as Critcal)

     

    The issue you had look like you had either mis-spelled the invocation (which didn't look like the case) or what it was trying to match in the table

     

    Could you take anther look and see if you can see what the matter is 

     

    Thanks

    -f

     

     

     

     

     

    ...

    Edited by AutoFrank
    Link to comment
    Share on other sites

    • 0
    33 minutes ago, AutoFrank said:

    Please login or register to see this code.

     

     

       -> If it can't confirm a match then pMatch is still false and moves to the third loop  

     

    This can happen if somebody mis-spells [Waring] or gets the case wrong [success]  in the invocation

      -> If this happens it sets the type to default type

     

    If you keep the change in then it won't pick up if you mis-spell a custom type

     

    This negative check is one of my test cases and I included it again this evening.

    You can see it in the second screenshot in on the second. I mi-spelled critical ( as Critcal)

     

    @AutoFrank

    So, this is what I read..

    1. The popups do work, and always have (I indicated that they changed colour as expected)

    2. The problem is that the FOR loop contains the debug if statement, for every time around the loop it DOESNT match, it will debug "Warning: Popup Type did not match, default Popup Type used" which you can see in your debug log, and in my earlier post.

     

    I pulled the END to the FOR loop up so it ran through the popupTypes table before deciding if it failed the match (pMatch) and then it will debug correctly.

     

    I confirm its all working over here, I still have to check the buttons in table form myself yet.

     

    Hope this makes sense..

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 4 minutes ago, shaunfrost said:

    Hope this makes sense.

     

    @shaunfrost

     

    I'm glad its working but TBH it doesn't make sense based on the way I wrote the code

    The code makes three checks...

    1 - check if poptype is blank in the invocation. Yes - use default, No - move to check #2

    2 - can it match the invocation against what's in the table. Yes - use what was passed via the invocation, No - move to check #3

    3 - Use default ( as some thing was sent but scene can't use it)

     

    By pulling up the End you indicated, it will still work but it won't complete the last check and if, in the unlikely event of you making a minor spell/case mistake in the invocation, the code won't pick that up and the popup may fail.

     

    Re the buttons - I checked the code I published and it doesn't contain the other small bug so you should be good there

     

    glad it all worked out and sorry again for the img bug

     

    -f

    Link to comment
    Share on other sites

    • 0

    I'm having the same problem as another user mentioned earlier, however I can't find a solution.

    Please login or register to see this code.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 29 minutes ago, wpeeters said:

    I'm having the same problem as another user mentioned earlier, however I can't find a solution.

    Please login or register to see this code.

     

    hi @wpeeters

     

    could you add a bit more context to what your trying and perhaps some screenshots of the debug window..

     

    thx 

     

    Link to comment
    Share on other sites

    • 0

    Hi @AutoFrank , that's the only line in the debug window. It appears once the scene is saved. I tried to follow the installation steps 1 by 1. But no result so far.

     

     

     

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 2 minutes ago, wpeeters said:

    Hi @AutoFrank , that's the only line in the debug window. It appears once the scene is saved. I tried to follow the installation steps 1 by 1. But no result so far.

     

     

     

     

    Please login or register to see this attachment.

     

    Thanks @wpeeters

     

    Line 74 is in the comments, so I can't tell from that.

     

    Could you pm me you full scene and I'll take a look

     

    thanks

     

     

     

     

     

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...