Page 1 of 1

emoji Support

Posted: Thursday 18 January 2018 10:38
by emme
...This was something that struggle me for a while....

I love to give some irony and humor to my messages and scripts (log included)... Emoji was a good way but unfortunately there are few issues on this

UNTIL NOW :D
I'm quite pround to share with you my lua emoji library for Domoticz and LUA that cam be used in dzvents as well

due to a strong limitatin in using unicode in LUA (or at least I did not able to find a way to encode it), the hard and boaring part is to include all emoji into the module... these are a few just for testing, I will fill them up as soon as I will need them :P

The main deal is this:
create a table with the names as index and the copy/paste of the emoji as a value
then a function that retreive and return the unicode emoji as a string for you use....

(I encounter few issues with copy/paste... you'd better do this on the same hardware there domoticz is running)

Install
rename the attached file with extension .lua and place into domoticz/scripts/lua)

Usage
at the top of your script include these 2 lines:

Code: Select all

package.path = package.path .. ';' .. '/home/pi/domoticz/scripts/lua/?.lua'
local emoji = require('libEmoji')
in your code you can use these functions:
- emoji.getEmo(name)
use this to retreive the emojy by calling its name

example in dzVents

Code: Select all

domoticz.log(emoji.getEmo('winking face'))

Code: Select all

local strTest = 'my Text with an emoji '..emoji.getEmo('winking face'))
- emoji.dumpEmo()
print the available library with their names

Code: Select all

domoticz.log(emoji.dumpEmo())
will return:
grinning squinting face ==> 😆
nerd face ==> ðŸĪ“
exploding head ==> ðŸĪŊ
face with monocle ==> 🧐
kissing face with closed eyes ==> 😚
hugging face ==> ðŸĪ—
loudly crying face ==> 😭
frowning face ==> â˜đ
⊛ crazy face ==> ðŸĪŠ
relieved face ==> 😌
squinting face with tongue ==> 😝
slightly frowning face ==> 🙁
face with head-bandage ==> ðŸĪ•
face with thermometer ==> ðŸĪ’
grinning face with big eyes ==> 😃
worried face ==> 😟
weary face ==> ðŸ˜Đ
upside-down face ==> 🙃
grimacing face ==> 😎
sleeping face ==> ðŸ˜ī
grinning face with sweat ==> 😅
confused face ==> 😕
sleepy face ==> 😊
face without mouth ==> ðŸ˜ķ
hope you enjoy it!! :oops: :oops:

Re: emoji Support

Posted: Saturday 27 January 2018 16:48
by Eoreh
Nice :).
Thx, Thank you for sharing and for showing the possibility of a log :D

Re: emoji Support

Posted: Wednesday 23 December 2020 11:03
by Ivo1986
https://rouwette.com/emoji-telegram-bot/ (in Dutch)

Will work with Telegram notifications