only once set text in text-device

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

Moderator: leecollings

Post Reply
BartSr
Posts: 347
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.3
Location: Netherlands
Contact:

only once set text in text-device

Post by BartSr »

I intend to use text devices on floorplan as 'labels'
What is best way to set text in textdevice only once?
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 espeasy
MQTT
solarboy
Posts: 300
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: only once set text in text-device

Post by solarboy »

In dzvents

Code: Select all

domoticz.devices('My Text Device').updateText('The Text I want to show')
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: only once set text in text-device

Post by waltervl »

Or with a API call:

Code: Select all

/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=TEXT
IDX = id of your device (This number can be found in the devices tab in the column "IDX")
TEXT = Text you want to display

https://www.domoticz.com/wiki/Domoticz_ ... ext_sensor
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
BartSr
Posts: 347
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.3
Location: Netherlands
Contact:

Re: only once set text in text-device

Post by BartSr »

thanks Walter. But how to run this code only once dz starts?
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 espeasy
MQTT
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: only once set text in text-device

Post by waltervl »

BartSr wrote: Monday 04 November 2024 8:18 thanks Walter. But how to run this code only once dz starts?
If you mean the dzvents line, that was not mine proposal. If you want to use dzvents just make a script that runs every minute. Run that line or multiple lines for multiple text devices and stop the script after a few minutes (disable it).

Once the text is in the database there is no need to update the text devices, even after a restart of Domoticz.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest