Custom Message in Notifications!!

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
Ressler
Posts: 3
Joined: Wednesday 11 September 2019 9:43
Target OS: -
Domoticz version:
Contact:

Custom Message in Notifications!!

Post by Ressler »

Hi all,

I'm trying to use notifications on an alert (dummy) to send myself a Pushover message.
This alert is activated via MQTT. I'm able to trigger the alert and the set Pushover action using the sensor but am struggling with the content of the message itself. I found that $value in the 'custom message' field returns me the state of the alert - 0/1/2/3/ etc. but not the text itself inside of my received Pushover message. What is the variable to use for this text?[url=https://reversephonelookup.onl/]reverse phone lookup[/url]nba reddit pcpartpicker


Thanks in advance.
Last edited by Ressler on Thursday 12 December 2019 3:42, edited 1 time in total.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Custom Message in Notifications!!

Post by waaren »

Ressler wrote: Tuesday 10 December 2019 14:31 I'm trying to use notifications on an alert (dummy) to send myself a Pushover message.
This alert is activated via MQTT. I'm able to trigger the alert and the set Pushover action using the sensor but am struggling with the content of the message itself. I found that $value in the 'custom message' field returns me the state of the alert - 0/1/2/3/ etc. but not the text itself inside of my received Pushover message. What is the variable to use for this text?
I don't think there is another variable then $value and $name. If you want more flexibility you could consider scripting. In dzVents you can control the complete message. (see dzVents wiki for howto )

Notification.png
Notification.png (113.02 KiB) Viewed 1885 times

When not yet familiar with dzVents please start with reading Get started Before implementing (~ 5 minutes). Special attention please for "In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents disabled' is not checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."

Code: Select all

return 
{
    on = 
    {
        devices = { 'notifyAlert'}, -- Name of your alert device
    },    
    
    execute = function(dz, item)
        local priority = dz.PRIORITY_MODERATE
        
        if item.color == dz.ALERTLEVEL_RED then 
            priority = dz.PRIORITY_HIGH
        end
        
       --[[     
            dz.notify ( 
                        subject, 
                        message, 
                        priority, 
                        sound, 
                        extra, 
                        subsystem
                    )
       ]]--

        dz.notify   (   'My alert',
                        'Alertdevice ' .. item.name .. ' is now at level ' .. item.color .. '. Text is ' .. item.text,
                       priority,
                       nil,
                       nil,
                       { dz.NSS_TELEGRAM, dz.NSS_PUSHOVER }
                    )
    end 
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Larsoss
Posts: 65
Joined: Friday 18 March 2016 10:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: Custom Message in Notifications!!

Post by Larsoss »

So i want to send a message when my thermostat is changed by value.
I want a Telegram Message true http: with the information on what value the thermostat is set on.

Is this possible?

https://ibb.co/NmQqrqV
https://ibb.co/XWMbDXN
Raspberry 4 - USB boot Domoticz /|\ Raspberry 2B - Dashticz /|\ Tasmota device's /|\ Philips Hue & Yeelight
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest