emoji Support

Moderator: leecollings

Post Reply
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

emoji Support

Post 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:
Attachments
libEmoji.txt
Lua Emoji Library
(4.27 KiB) Downloaded 131 times
The most dangerous phrase in any language is:
"We always done this way"
Eoreh
Posts: 65
Joined: Tuesday 13 October 2015 13:50
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Poland
Contact:

Re: emoji Support

Post by Eoreh »

Nice :).
Thx, Thank you for sharing and for showing the possibility of a log :D
Ivo1986
Posts: 16
Joined: Tuesday 07 January 2020 10:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Urmond - Netherlands
Contact:

Re: emoji Support

Post by Ivo1986 »

https://rouwette.com/emoji-telegram-bot/ (in Dutch)

Will work with Telegram notifications
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest