Hello
I've a text custom sensor and I want to run an event when this TEXT sensor change to a specific value
I've made a blocky event type DEVICE -> does not run
I tried every type same result
Is it possible to do that on domoticz ?
Thank you
Trigger a blocky event on TEXT custom sensor change
Moderators: leecollings, remb0
-
- Posts: 97
- Joined: Friday 05 December 2014 22:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Trigger a blocky event on TEXT custom sensor change
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
Re: Trigger a blocky event on TEXT custom sensor change
Sorry I have no answer to this but want to bump this topic as I'm banging my head with the same thing.
I'm using MySensors and there have been several occasions when I want to pass some variable or parameter back to the node. For example, I have a led strip which has multiple animation modes. Using selector on Domo to change the text sensor status and you could pass parameters to the node.
In MySensors you define the messages and present the sensors to Domoticz. For receiveing data you need naturally define receive functions what to do when receiving data from Domo. So far have over hundred sensor in the house and all the bulk stuff runs just fine, but why in the earth Domoticz cannot inform MySensors node when V_TEXT/S_INFO sensor is updated!? Domo can send that information and MySensors node is just waiting to get that information. Now you have to manually send request (create a dummy, inefficient periodical poll) from node to force Domo to send the data. WHY WHY WHY!?
I'm using MySensors and there have been several occasions when I want to pass some variable or parameter back to the node. For example, I have a led strip which has multiple animation modes. Using selector on Domo to change the text sensor status and you could pass parameters to the node.
In MySensors you define the messages and present the sensors to Domoticz. For receiveing data you need naturally define receive functions what to do when receiving data from Domo. So far have over hundred sensor in the house and all the bulk stuff runs just fine, but why in the earth Domoticz cannot inform MySensors node when V_TEXT/S_INFO sensor is updated!? Domo can send that information and MySensors node is just waiting to get that information. Now you have to manually send request (create a dummy, inefficient periodical poll) from node to force Domo to send the data. WHY WHY WHY!?
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Trigger a blocky event on TEXT custom sensor change
If you are willing to use dzVents for this I might be able to help.Sushukka wrote: ↑Thursday 05 April 2018 10:44
... but why in the earth Domoticz cannot inform MySensors node when V_TEXT/S_INFO sensor is updated!? Domo can send that information and MySensors node is just waiting to get that information. Now you have to manually send request (create a dummy, inefficient periodical poll) from node to force Domo to send the data. WHY WHY WHY!?
What is the (example) command you manually send to MySensors node ?
What are the names of the domoticz V_TEXT/S_INFO devices and on what string / event the command must be send ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: Trigger a blocky event on TEXT custom sensor change
I have written some LUA stuff when followed some heatpump IR remote guide (which was addressing similar type of challenge) from this forum, but I have to admit that I'm not a LUA expert.waaren wrote: ↑Thursday 05 April 2018 12:23If you are willing to use dzVents for this I might be able to help.Sushukka wrote: ↑Thursday 05 April 2018 10:44
... but why in the earth Domoticz cannot inform MySensors node when V_TEXT/S_INFO sensor is updated!? Domo can send that information and MySensors node is just waiting to get that information. Now you have to manually send request (create a dummy, inefficient periodical poll) from node to force Domo to send the data. WHY WHY WHY!?
What is the (example) command you manually send to MySensors node ?
What are the names of the domoticz V_TEXT/S_INFO devices and on what string / event the command must be send ?
Usually the sent data is very short, simply some numbers, short text, hex...I would say that if I'm going over MySensors max. payload size (25bytes) there is a mistake somewhere.
So the latest example I have in my hands goes like this:
- I have a adressable WS2812 strip and using nice WS2812FX library
- This library has 56 different animation modes
- In node sketch I have:
Code: Select all
MyMessage msgLedMode(LED_MODE_ID, V_TEXT); void presentation() { present(LED_MODE_ID, S_INFO, "HomeNumber LED mode"); } void receive(const MyMessage &message) { if (message.type==V_TEXT) { if (message.sensor==LED_MODE_ID) { String LEDtemp = message.getString(); ledMode = LEDtemp.toInt(); if (ledMode == -1) setLedOff(); else if (ledMode < 56 && ledMode >= 0) setLedMode(ledMode); } } }
- I have created a dummy virtual switch in Domo
- This dummy virtual switch is selector switch where I have predefined some modes I want use
- Every selector switch level have an action like:
where nnn is number between 0-56.http://xxx.xxx.xxx.xxx:pppp/json.htm?type=command¶m=udevice&idx=xxx&nvalue=0&svalue=nnn - So now after clicking my virtual switch selector button, the LED_MODE_ID / V_TEXT sensor will be updated to have the requested LED animation mode I want to run...and yes this update happens only on Domoticz level. No updates will be triggered to send the data to the actual node.

- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Trigger a blocky event on TEXT custom sensor change
I am still not sure I completely understand what you exact want but maybe this code will help ?
Code: Select all
--[[
test-text (dzVents >= 2.4.0 )
]]--
return {
on = { devices = { 'test-Text' }},
execute = function(dz, trigger)
if trigger.text == "openurl" then
print (trigger.name .. " is now : " .. trigger.text)
dz.openURL("http://xxx.xxx.xxx.xxx:pppp/json.htm?type=command¶m=udevice&idx=xxx&nvalue=0&svalue=nnn")
end
end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: Trigger a blocky event on TEXT custom sensor change
Does the "execute = function(dz, trigger)" force Domoticz internally to send the text update to MySensors node?waaren wrote: ↑Sunday 08 April 2018 13:13 I am still not sure I completely understand what you exact want but maybe this code will help ?
Code: Select all
--[[ test-text (dzVents >= 2.4.0 ) ]]-- return { on = { devices = { 'test-Text' }}, execute = function(dz, trigger) if trigger.text == "openurl" then print (trigger.name .. " is now : " .. trigger.text) dz.openURL("http://xxx.xxx.xxx.xxx:pppp/json.htm?type=command¶m=udevice&idx=xxx&nvalue=0&svalue=nnn") end end }
Here is my another attempt to explain the problem

- I can define V_TEXT/S_INFO sensor in MySensors node and present it normally to Domoticz
- If I update any switch/light/dimmer type of sensors on Domoticz, this information will be passed directly to my MySensors node.
- If I update V_TEXT sensor in Domoticz, it will be updated in Domoticz's Utility tab, but will never trigger any event to send the actual upate to the node
- To get the current value from Domoticz TEXT sensor, I have to manually give:
command in my sketch whereafter Domoticz will send the value and I can read it in the sketch's receive function:request(LED_MODE_ID, V_TEXT, 0);Code: Select all
"void receive(const MyMessage &message) { if (message.type==V_TEXT) { if (message.sensor==LED_MODE_ID) { ... ...
- Problem is that issuing the "request" command every second or two is not an elegant solution and generates lots of overhead.
Re: Trigger a blocky event on TEXT custom sensor change
Bump for this.
Why is this so hard? This would be a very small update but would help tremendously with all MySensors related stuff. Also MySensors is pretty much the number one home made Arduino/ESP8266 protocol nowadays. Question is still: why Domoticz won't send any update to the the MySensors node or gateway when text sensors is updated in Domo? If you click a switch, change a color, use dimmer etc. Domo will send the update to the node, but not for text sensor. Tested this with OpenHAB and it sends the update like any other two-way sensor. So this is purely Domoticz problem and there are no valid explanation anywhere why it works like this. It just seems to be a peristent bug.
Sorry my negative tone, but getting frustrated to the so common silence here and because this small "feature" is generating lots of extra unnecessary work to many MySensors users.
Why is this so hard? This would be a very small update but would help tremendously with all MySensors related stuff. Also MySensors is pretty much the number one home made Arduino/ESP8266 protocol nowadays. Question is still: why Domoticz won't send any update to the the MySensors node or gateway when text sensors is updated in Domo? If you click a switch, change a color, use dimmer etc. Domo will send the update to the node, but not for text sensor. Tested this with OpenHAB and it sends the update like any other two-way sensor. So this is purely Domoticz problem and there are no valid explanation anywhere why it works like this. It just seems to be a peristent bug.
Sorry my negative tone, but getting frustrated to the so common silence here and because this small "feature" is generating lots of extra unnecessary work to many MySensors users.
-
- Posts: 70
- Joined: Tuesday 27 March 2018 17:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Trigger a blocky event on TEXT custom sensor change
Came across this when looking for a solution. The answer is ...maybe.

I had exactly the same issue with a text sensor. Even though the values reported were correct, couldn't get a script to run based on them.
But found that Blockly would respond to a change in value, so that was used instead. That was good enough in this case, which just switches on a door "Courtesy Light" for a short period at night.
Another oddity - it wouldn't run if an "If/ElseIf" block was used to set additional conditions.
Maybe the result could be used to trigger yet another script, but that seems to be a clumsy way to go.
.
Who is online
Users browsing this forum: Bing [Bot] and 1 guest