LM visualization Voice status response
Example: LM visualization Voice status response
Task
Make dimmable light status response using LogicMachine via Google services.
Use resident script for creating sound files
Rus the following resident script once.
- MP3_Data = {}
-
- -- This % line has a different spoken text
- table.insert(MP3_Data, {filename = "0_PROCENT", text = "Turned off"})
- -- Create batch % files
- for i = 10, 100, 10 do --(Start , End, Stepsize)
- table.insert(MP3_Data, {filename = "" .. i .. "_PROCENT", text = "Turned on at " .. i .. " %"})
- end
- -- Create other spoken text files
- table.insert(MP3_Data, {filename = "PRESENCE_OFF", text = "Presence simulation turned off"})
- table.insert(MP3_Data, {filename = "PRESENCE_ON", text = "Presence simulation turned on"})
- table.insert(MP3_Data, {filename = "CENTRAL_OFF", text = "Everything is turned off you can leave the building"})
- table.insert(MP3_Data, {filename = "TIMER_OFF", text = "Timer turned off"})
- table.insert(MP3_Data, {filename = "TIMER_ON", text = "Timer turned on"})
- table.insert(MP3_Data, {filename = "SCENE_CALL", text = "Scene called"})
- table.insert(MP3_Data, {filename = "SCENE_SAVE", text = "Scene saved"})
- table.insert(MP3_Data, {filename = "SCENE_DELETE", text = "Scene deleted"})
- table.insert(MP3_Data, {filename = "SCENE_LOCKED", text = "Scene locked"})
- table.insert(MP3_Data, {filename = "SCENE_UNLOCKED", text = "Scene unlocked"})
- table.insert(MP3_Data, {filename = "ALARM_OFF", text = "There are no alarms anymore"})
- table.insert(MP3_Data, {filename = "ALARM_ON", text = "Alarm message from airconditioning please check the system"})
-
- -- Loop through array to create the files with above filenames and text (change '&tl=en' inside URL to change your language, check translate.google API for more options)
- for index, MP3Data in pairs(MP3_Data) do
- -- Replace spaces with + sign.
- MP3Data.text = string.gsub(MP3Data.text, " ", "+")
- -- Create .MP3 from Google Translate (note: the DNS settings and default gateway needs to be correct in the system to access the internet)
- os.execute('wget -q -U Mozilla -O /www/scada/vis/' .. MP3Data.filename .. '.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q="' .. MP3Data.text)
- os.sleep(0.5)
- end
- --Remove all created mp3's
- --os.execute('rm /www/scada/vis/*.mp3')
Edit SVG file
Download this SVG file, open it in any redactor like Notaped and edit the *.mp3 file names so they are equal the ones in Resident script. Also define the grp address which by activation will call the mp3 sound files (in this file 0/0/1).
Add SVG to Image and drop in visualization
Add corresponsing object into visualization
In the same floor where SVG file was added, add KNX object in a regular way
Created by Erwin van der Zwart from Schneider Electric