Hello,
I have a device called "Electric (Instant+Counter)". I want to create a new device that only shows the counter value. Can someone give me an example of how to do this in dzVents?
Thank you very much
Split measured value [Solved]
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Split measured value
What kind of device should the target be? A text device or a counter or a custom sensor or something else?Knibor wrote: Friday 05 March 2021 17:32 I want to create a new device that only shows the counter value. Can someone give me an example of how to do this in dzVents?
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
-
Knibor
- Posts: 112
- Joined: Sunday 20 May 2018 12:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: NL
- Contact:
Re: Split measured value
Hi,
I currently have a device of the type "General, kWh".
This device gives me two values. The first is the current solar energy and the second is the value of today's total solar energy in kWh. I would like a separate device that only displays the kWh generated by the solar panels today. The device I would like to use is of the Text device.
I currently have a device of the type "General, kWh".
This device gives me two values. The first is the current solar energy and the second is the value of today's total solar energy in kWh. I would like a separate device that only displays the kWh generated by the solar panels today. The device I would like to use is of the Text device.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Split measured value [Solved]
Could look like script belowKnibor wrote: Saturday 06 March 2021 11:12 I currently have a device of the type "General, kWh".
I would like a separate device that only displays the kWh generated by the solar panels today. The device I would like to use is of the Text device.
Code: Select all
return
{
on =
{
devices =
{
2515, -- change to idx of your solar device
},
},
logging =
{
level = domoticz.LOG_DEBUG, -- change to domoticz.LOG_ERROR when all is ok
marker = 'solar to text',
},
execute = function(dz, item)
local solar = dz.devices('solar energy today') -- change to name of your text device
local currentText = solar.text
local newtext = item.counterToday .. ' kWh'
if currentText ~= newtext then
solar.updateText(newtext)
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
-
Knibor
- Posts: 112
- Joined: Sunday 20 May 2018 12:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: NL
- Contact:
Re: Split measured value
Hi,
Thanks a lot for the script. It works now.
Thanks a lot for the script. It works now.
Who is online
Users browsing this forum: No registered users and 1 guest