How to create single devices from a device showing 3 values

Moderator: leecollings

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

How to create single devices from a device showing 3 values

Post by BartSr »

Given situation:
Airvalve sending ppm value , temperature , %open
There is no dummy device for such so I tried some who can receive 3 different values.
I ended with 3-phase amp meter.
L1 shows ppm
L2 shows temp
L3 shows % open
Of course they all say AMPERE
Now I am looking for a workaround to get either a device showing these 3 values
Or
3 dummy devices for such.

Any suggestion?
TIA

-Bart
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave2MQTT
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 / 32 espeasy
Zigbee2MQTT
User avatar
waltervl
Posts: 6678
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: How to create single devices from a device showing 3 values

Post by waltervl »

How is that air valve sending it's data?
Can Domoticz get the values with an url? Because then you can use http/https poller or a dzvents script to read the values and put them directly in the correct devices.
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: 489
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.7
Location: Netherlands
Contact:

Re: How to create single devices from a device showing 3 values

Post by BartSr »

Data comes from a modbus which is converted.
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave2MQTT
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 / 32 espeasy
Zigbee2MQTT
User avatar
waltervl
Posts: 6678
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: How to create single devices from a device showing 3 values

Post by waltervl »

And how do you do that? With a domoticz script/plugin or outside Domoticz?
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: 489
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.7
Location: Netherlands
Contact:

Re: How to create single devices from a device showing 3 values

Post by BartSr »

The modbus goes into a nodemcu with ESP easy software.
I just understood that from ESP easy you may use in different tasks same modbus ID#
Futhermore I learnt that ESP Easy has the opportuniy to select a single value and sent to Domoticz by MQTT.
So if there is no easy way inside Domoticz to handle 3 values a time other than using the 3phase amp dummy I will have my heading in the ESP way
-Bart
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave2MQTT
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 / 32 espeasy
Zigbee2MQTT
User avatar
waltervl
Posts: 6678
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: How to create single devices from a device showing 3 values

Post by waltervl »

There is indeed no way to get 3 different values in one device unless it are temp/humidity/barometer values. So you have to split those values on the ESPeasy side.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
habahabahaba
Posts: 266
Joined: Saturday 18 March 2023 14:44
Target OS: Windows
Domoticz version: 2024.4
Contact:

Re: How to create single devices from a device showing 3 values

Post by habahabahaba »

Hi.
You can use virtual sensor type of "text" and put there any string you want.

Code: Select all

return {
	on = {
		timer = { 'every minute',	
		}
	},

	execute = function(domoticz , timer)
	    
	
		local AQI = domoticz . devices(40)  
		
		local temp = '15℃'
		local humi = '65%'
		local anything = '15'..'mg/м³'
		
		local outStr = temp..';   '..humi..';   '..anything

		
	    AQI  .updateText(outStr)  --just an example to set the value
		

		
        domoticz . log(outStr..' - AQI value', domoticz.LOG_ERROR)
		
		
	end
}
2023-03-19_11-07-32.png
2023-03-19_11-07-32.png (5.08 KiB) Viewed 985 times
User avatar
habahabahaba
Posts: 266
Joined: Saturday 18 March 2023 14:44
Target OS: Windows
Domoticz version: 2024.4
Contact:

Re: How to create single devices from a device showing 3 values

Post by habahabahaba »

Of course you can take values from any sensors you want and combine them
BartSr
Posts: 489
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.7
Location: Netherlands
Contact:

Re: How to create single devices from a device showing 3 values

Post by BartSr »

Thanks for your assistance. Unfortunily it is not a solution for my problem. Let me explain. I have a airquality sensor which measures ppm CO2, temp and airpressure. That sensor is hooked up to a nodeMCU. It is not possible for me to forward those three values to three different Domoticz IDX-s. So in Domoticz at long last used a dummy devices for three phase amp. That worked in way off L1 shows ppm, L2 shows temp and L3 shows mBar. This results in a tripleAmp device showing L1 400 Amp. L2 19 Amp L3 1080 Amp. Whereas I need a result showing 400 ppm, 19C, 1080 mBar. For now I have solved the problem by sending the three values individual using command

Code: Select all

on CO2#PPM do    Publish domoticz/in, '{"idx":951,"nvalue":[CO2#PPM]}'[code/] So MQTT is my friend. IDX is a domoticz dummy value. I did same for temp and airpress. Bart
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave2MQTT
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 / 32 espeasy
Zigbee2MQTT
FlyingDomotic
Posts: 463
Joined: Saturday 27 February 2016 0:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: How to create single devices from a device showing 3 values

Post by FlyingDomotic »

You may create an MQTT message (using EspEasy MQTT controller) with all required values, and then extract these values to multiple Domoticz devices.

To extract MQTT message, you may use https://github.com/FlyingDomotic/domoti ... per-plugin, which is able to map MQTT messages without having HomeAssistant description, but definitions in a JSON file.

I can help creating JSON mapping file if required.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest