Question about notifications in dzVents

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

Moderator: leecollings

User avatar
waltervl
Posts: 6691
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Question about notifications in dzVents

Post by waltervl »

Those costs are only calculated when requested by the web user interface Log and reports and not stored in Domoticz.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HvdW
Posts: 664
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Question about notifications in dzVents

Post by HvdW »

Xavier82 wrote: Thursday 05 January 2023 16:04 My gas consumption is automatically updated every minute. I use a P1 cable which is connected to our Smart Energy meter (incl. gas) and directly to my Rpi.
The gas consumption is frighteningly accurate on day and montly level to what Essent counts and charges me.
Still wondering.
In my Domoticz gas from P1 is read every minute or so.
Electricity updates about once a minute.
In the same readings gas is measured as well.
Difference is that the tile in Domoticz updates about once an hour.

Or is it different in your setup.
Bugs bug me.
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Question about notifications in dzVents

Post by Xavier82 »

HvdW wrote: Friday 06 January 2023 2:04
Xavier82 wrote: Thursday 05 January 2023 16:04 My gas consumption is automatically updated every minute. I use a P1 cable which is connected to our Smart Energy meter (incl. gas) and directly to my Rpi.
The gas consumption is frighteningly accurate on day and montly level to what Essent counts and charges me.
Still wondering.
In my Domoticz gas from P1 is read every minute or so.
Electricity updates about once a minute.
In the same readings gas is measured as well.
Difference is that the tile in Domoticz updates about once an hour.

Or is it different in your setup.
Thats strange about your update time, I don't have any specific timer or something to update the switches, the switches are just updated, the same for temperature, weather and Utiliy devices by the way.
User avatar
waltervl
Posts: 6691
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Question about notifications in dzVents

Post by waltervl »

Today/this week (=ShortLog) Gas devices in Domoticz are always logged as bar graphs per hour. No option to change that (yet).
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HvdW
Posts: 664
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Question about notifications in dzVents

Post by HvdW »

Next question.
Data being pushed by Google Cloud Messaging are displayed on one line, despite the '\n' found in @Xavier82 script.
Any idea how to force a new line?
Bugs bug me.
HvdW
Posts: 664
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Question about notifications in dzVents

Post by HvdW »

Thanks @Xavier82 for your contribution.
I implemented it.
Last part of the code I'm using:

Code: Select all

--Verzend informatie. Dit is 1 bericht, met alle informatie. regels uit -- ervoor anders ze ervoor weg halen om te krijgen
local subject = 'Mijn Energie overzicht : '
local message = 'Mijn Energie Overzicht : ' .. os.date("%d-%m-%Y")..'\n' ..
         --'--------------P1 Elektriciteitmeter-----------' .. '\n' .. 
        'Stroomkosten Totaal : € ' .. tonumber(dz.utils.round( (kwhPrijs * vandaagKwh) + kwhPrijsVast,2)).. '\n' ..
        'Stroomkosten Hoog : € ' .. tonumber(dz.utils.round( (kwhPrijs * vandaagKwhvh) ,2)).. '\n' .. 
        'Stroomkosten Laag : € ' .. tonumber(dz.utils.round( (kwhPrijs * vandaagKwhvl) ,2)).. '\n' .. 
        'Teruglevering Hoog : € ' .. tonumber(dz.utils.round( (kwhPrijs * vandaagKwhth) ,2)).. '\n' .. 
        'Teruglevering Laag : € ' .. tonumber(dz.utils.round( (kwhPrijs * vandaagKwhtl) ,2)).. '\n' .. 
        'Verbruik Hoog       : ' ..vandaagKwhvh.. ' kWh'.. '\n' ..
        'Verbruik Laag       : ' ..vandaagKwhvl.. ' kWh'.. '\n' ..
        'Teruglevering Hoog : ' ..vandaagKwhth.. ' kWh' .. '\n' ..
        'Teruglevering Laag : ' ..vandaagKwhtl.. ' kWh' .. '\n' ..
        'Totaal Verbruik Elektra vandaag : ' ..vandaagKwh.. ' kWh'.. '\n' .. 
		 --'--------------P1 Gasmeter---------------------' .. '\n' .. 
        'Gaskosten vandaag M3              : € ' .. tonumber(dz.utils.round( (gasM3Prijs * vandaagM3Gas) + gasM3PrijsVast,2))..'\n' ..
 		'Totaal Verbruik Gas vandaag     : ' ..vandaagM3Gas.. ' M3'.. '\n' .. 
--           '--------------Watermeter----------------------' .. '\n' ..
--           'Water : € ' .. tonumber(dz.utils.round( (waterM3Prijs * vandaagM3Water)/1000 + waterM3PrijsVast,2))..'\n' ..
--      	   'Totaal Verbruik Water vandaag   : ' ..vandaagM3Water.. ' M3'.. '\n' .. 
         --'--------------Zonnepanelen--------------------' .. '\n' .. 
          --'Totaal Opbrengst Zonnepanelen :  ' ..vandaagKwhzon.. ' kWh'.. '\n' ..
          --'Zonopbrengst Totaal € ' .. tonumber(dz.utils.round( (kwhPrijs * vandaagKwhzon) + kwhPrijsVast,2))..'\n' ..
          '-------------- Einde Dag Overzicht -------------'

 
-- Notificatie voor verschillende aanbieders
            dz.notify(subject, message, dz.PRIORITY_NORMAL)
When I do not add 'subject' to the message everything shows bold, plus the first lines are nicely one string one line.
After 5 lines things get mixed up.
What's happening here and how can I influence it.

I'm using Google Cloud messaging
Screenshot_20230114-152200.png
Screenshot_20230114-152200.png (268.25 KiB) Viewed 260 times
This is the popup that shows on my phone.
Screenshot_20230114-151835.png
Screenshot_20230114-151835.png (386.25 KiB) Viewed 260 times
This is the message as shown in the Domoticz app.
(differences explained above)

My question is on how to influence /n behaviour.
Why does it change after five lines in the bold text and why does it behave like it does when I add the subject to the push message.
Bugs bug me.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest