Well, you can use $locationMode for the current mode. However, where are you getting the $previousState and $currentState system variables? I don’t see them in the list of those that are available.
But if the old mode system variable does not exist…you could just keep track of it yourself. You just have to let it change once so that it gets stored (or configure it in the GUI on the piston interface). But the logic would go something like this:
define string oldMode;
IF Location mode changes and…
then
speak text “home mode has changed from” oldMode to $locationMode
set variable oldMode = $locationMode
Like I said, initially oldMode will be empty…but once it changes one time it will fall in line properly.