OS.execute and ANSI character

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Yann
Posts: 12
Joined: Tuesday 17 May 2016 14:42
Target OS: Windows
Domoticz version: 2020.2
Location: France
Contact:

OS.execute and ANSI character

Post by Yann »

I looked on all forums and couldn't find the answer so I count on you :-)
I would like to execute this simple command based on gnotify that I installed on my windows server.
If I run it from the windows CMD line:
gnotify -H 192.168.1.26 -l fr température
Everything works well, I can hear "température" on my google home

Now in domoticz, I run the following:
os.execute('gnotify -H 192.168.1.26 -l fr température')
Google home doesn't pronounce it the right way (like additional special characters are inserted)
I looked on the console windows and see the following:
Status: dzVents: Info: gnotify -H 192.168.1.26 -l fr temp├®rature

So my problem is some kind of ANSI conversion issue when the command is sent by os.execute - don't know how to solve it .... any idea ?
HP Microserver + Domoticz + Aeon Labs Z-Wave USB +RFX433
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: OS.execute and ANSI character

Post by waaren »

Yann wrote: Monday 27 April 2020 17:05 So my problem is some kind of ANSI conversion issue when the command is sent by os.execute - don't know how to solve it .... any idea ?
Could it be related to this forum post ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Yann
Posts: 12
Joined: Tuesday 17 May 2016 14:42
Target OS: Windows
Domoticz version: 2020.2
Location: France
Contact:

Re: OS.execute and ANSI character

Post by Yann »

Unfortunately no ..... I am using internal Domoticz editor for dzVents, not an external one, so there is no UTF-8 parameter to set.
To be sure, I tested with the log function, and it is properly displayed in the log.
It is really the os.execute function that somehow changes the characters.
HP Microserver + Domoticz + Aeon Labs Z-Wave USB +RFX433
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest